Removing global document references (#1482)

fix for options `recordCanvas: true`: 
* replace document.createElement with doc.createElement in rrweb-snapshot code
* Eoghan: add a regression test to prevent future accidental use of `document` instead of `doc`.  This test can be excised if a new feature can only be run in the browser and not in the jsdom environment
This commit is contained in:
Alfie Jones
2026-04-01 12:00:00 +08:00
committed by GitHub
parent bade29531a
commit 1a8dfcc8aa
4 changed files with 32 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
---
"rrweb-snapshot": patch
---
(when `recordCanvas: true`): ensure we use doc.createElement instead of document.createElement to allow use in non-browser e.g. jsdom environments