-
-
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
Add support for replaying StyleSheetRule events #178
Conversation
Tested via the snippet below and it seemed to work, though the id recorded was -1 (maybe thats correct?), so I was a bit confused: https://codesandbox.io/s/beautiful-babbage-hz2wj
Here's the full output from repl: https://gist.github.com/dcramer/3b8449cf4388663ab7f0c1dbec399fe6 |
c28a90f
to
7af5893
Compare
Aside - willing to help try to get test coverage in for replays (beyond just testing the controller actions), but didn't see any existing. |
Interesting. The example in the gist works because it captures the added DOM:
|
The replayer code looks fine. I believe the Looks like the order of the dynamic stylesheet insertion is:
But the order of rrweb's observer callback is:
I'm not sure whether this works for all the CSS in JS lib, it seems the first insertion will be replayed by the add of DOM, and the following insertion weill be captured correctly. |
Seems like it’d be nice to ignore insertRule until the style is on the dom. Thoughts? Not sure how complex that’d be. Seems like it’d save some bandwidth on payload size. |
Ref: rrweb-io#1343 Co-authored-by: Michael Dellanoce <michael.dellanoce@gmail.com>
Fixes #58
Fixes #104