We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
document.implementation.createHTMLDocument
1 parent cc5e987 commit 1de271eCopy full SHA for 1de271e
packages/rrweb/src/record/mutation.ts
@@ -462,7 +462,14 @@ export default class MutationBuffer {
462
if (isIgnored(m.target, this.mirror)) {
463
return;
464
}
465
- const unattachedDoc = document.implementation.createHTMLDocument(); // avoid upsetting original document from a Content Security point of view
+ let unattachedDoc;
466
+ try {
467
+ // avoid upsetting original document from a Content Security point of view
468
+ unattachedDoc = document.implementation.createHTMLDocument();
469
+ } catch (e) {
470
+ // fallback to more direct method
471
+ unattachedDoc = this.doc;
472
+ }
473
switch (m.type) {
474
case 'characterData': {
475
const value = m.target.textContent;
0 commit comments