rrweb-io / rrweb

record and replay the web

Home Page:https://www.rrweb.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Stopping recording causes all insertRule hooks added after record start to drop

eugene-chang-fs opened this issue · comments

Preflight Checklist

  • I have searched the issue tracker for a bug report that matches the one I want to file, without success.

What package is this bug report for?

rrweb

Version

v1.1.3

Expected Behavior

Sentry/rrweb should not drop hooks on the prototypical chain (shown in demo under output).

See result without rrweb: https://imgur.com/C0veqB0

Actual Behavior

Sentry/rrweb does drop hooks installed.

See result with rrweb extension: https://imgur.com/a/DGIoUSv

Steps to Reproduce

As far as I'm aware, this happens to all versions.

Any hooks added to insertRule are dropped once rrweb stops recording.

  1. Start capturing
  2. Add a hook to CSSStyleSheet.prototype.insertRule
  3. Stop capturing
  4. Observe that hook added by step 2 is no longer in place

Expected/actual behaviors are two videos of a demo page (source: https://jsfiddle.net/pmd5L8v7/). Once hooked, adding a rule to change the color of the text snippet at the top should result in an output line, indicating that the hook worked. But in the result with rrweb, this behavior is absent, indicating that the hook was dropped.

Testcase Gist URL

No response

Additional Information

This was originally filed with sentry @ getsentry/sentry-javascript#11837 but was suggested to post the issue here.