-
-
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
Throttling/pausing of Mutation Events #221
Comments
Have started some prep work for this in #223 |
@eoghanmurray This will be one of the most exciting features for rrweb! I will start to review your patch today. Thanks a lot! |
I've gone for adding a new API method
|
Let me know if you think the above behavior should be made into a config setting, e.g.
|
Hi @eoghanmurray, thanks a lot for the PRs. Would you like to explain more about the full plan of doing this? Like the data structure, events, browser API, etc. |
So the only other possible change would be to create a separate Page Visibility observer, which could e.g. set a class/state on the <iframe> which could be used by the replayer to indicate that the page is not currently visible to the end user. I feel like that's a separate proposal though. Otherwise, there's not much more to it; the changes I've made in #224 enables me to do all the things we need to achieve (see sample code above) I've sketched out where these config changes could go in statcounter@9f24c10 |
I'm just wondering whether there has been any effort, or rejected effort, to add throttling and/or grouping to the MutationObserver.
I'm recording a website which has an image carousel which transitions images via a setInterval script, so every second, dozens of new mutation events are being generated without any user actions.
All the mutations are happening on the
style
attribute, so there's quite a lot of commonality between the events, which suggests a few different 'packing' strategies, but before delving into this level of complexity, I'm wondering whether an API method to pause mutation tracking would be useful?This could be triggered by e.g. https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API so that if a user isn't actually on the page, then mutation events will be batched up until they return.
The text was updated successfully, but these errors were encountered: