-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Enable external pausing of mutation buffer emissions #224
Conversation
410756e makes a change to delay processing of the |
…ffer` object, as otherwise `this` referred to the `MutationObserver` object itself
- no automatic pausing based on e.g. pageVisibility yet, assuming such a thing is desirable https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API - user code has to call new API method `freezePage` e.g. when page is hidden or after a timeout - automatically unpauses when the next user initiated event occurs (am assuming everything that isn't a mutation event counts as 'user initiated' either way think this is the correct thing to do until I see a counterexample of an event that shouldn't cause the mutations to be unbufferred)
7397015
to
e8fcfcc
Compare
@Yuyz0112 I've rebased based on current master, would it be possible to get another review and merge if this change is okay? This pull request adds a new API method We are using this to prevent pages which have e.g. a carousel implemented with DOM mutation from generating massive recordings even though the website visitor is not taking any actions (and might not even have the tab in focus) |
Is |
For me, freezePage sounds more intuitive. BTW, if I understand correctly, #385 contains all the changes in this PR and we can only review and discuss that one? |
Yes, #385 is this pull request and more ... all further discussion can go there. |
https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API
freezePage
e.g. when page is hidden or after a timeout(am assuming everything that isn't a mutation event counts as 'user initiated'
either way think this is the correct thing to do until I see a counterexample
of an event that shouldn't cause the mutations to be unbufferred)