-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add instrumentation to embed iframe #1534
Conversation
const setInterval = win.setInterval; | ||
const intervals = {}; | ||
let intervalId = 0; | ||
win.setInterval = function(fn, time) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the point in overriding this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to chat offline about reasons.
39db54a
to
6768275
Compare
parent.ampManageWin = function(win) { | ||
manageWin(win); | ||
}; | ||
html = html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another +=
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
855c9d3
to
5481383
Compare
This is now ready for review. |
5481383
to
3b1ef85
Compare
* @type {{inViewport: true}} | ||
* @visibleForTesting | ||
*/ | ||
export const docState = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about a module variable here, with a setter method for testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
751934a
to
52190f3
Compare
PTAL |
*/ | ||
export function getDocStateForTesting() { | ||
return docState; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With a setter, there's no longer a need for a docState
object.
let inViewport = true;
export function setViewportForTesting(value) {
inViewport = value
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
LGTM from me. |
52190f3
to
0c69426
Compare
0c69426
to
f0e961b
Compare
Add instrumentation to embed iframe
No description provided.