Enable external pausing of mutation buffer emissions#224
Enable external pausing of mutation buffer emissions#224eoghanmurray wants to merge 5 commits intorrweb-io:masterfrom
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
freezePagee.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)