@appsurify-testmap/rrweb 2.0.0-alpha.32 → 2.0.0-alpha.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/rrweb.cjs CHANGED
@@ -527,7 +527,7 @@ function getXPath(node2) {
527
527
  return "/html/body";
528
528
  }
529
529
  const parentNode2 = element.parentNode;
530
- if (!parentNode2 || !(parentNode2 instanceof Element)) {
530
+ if (!parentNode2) {
531
531
  return "";
532
532
  }
533
533
  const siblings = Array.from(parentNode2.children).filter(
@@ -589,14 +589,19 @@ function isTextVisible(n2) {
589
589
  return textContent2 !== "";
590
590
  }
591
591
  function isElementVisible(n2) {
592
- return isStyleVisible(n2) && isRectVisible(n2.getBoundingClientRect());
593
- }
594
- function isStyleVisible(n2) {
595
- const style = window.getComputedStyle(n2);
596
- return style.display !== "none" && style.visibility !== "hidden" && parseFloat(style.opacity) !== 0;
592
+ var _a2;
593
+ const win = ((_a2 = n2.ownerDocument) == null ? void 0 : _a2.defaultView) ?? null;
594
+ const style = win ? win.getComputedStyle(n2) : null;
595
+ const isStyleVisible = style != null && style.display !== "none" && style.visibility !== "hidden" && parseFloat(style.opacity) !== 0;
596
+ const rect = n2.getBoundingClientRect();
597
+ const result2 = isStyleVisible && isRectVisible(rect, win);
598
+ return result2;
597
599
  }
598
- function isRectVisible(rect) {
599
- return rect.width > 0 && rect.height > 0 && rect.top >= 0 && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && rect.right <= (window.innerWidth || document.documentElement.clientWidth);
600
+ function isRectVisible(rect, win) {
601
+ var _a2, _b, _c, _d;
602
+ const height = (win == null ? void 0 : win.innerHeight) ?? ((_b = (_a2 = win == null ? void 0 : win.document) == null ? void 0 : _a2.documentElement) == null ? void 0 : _b.clientHeight) ?? 0;
603
+ const width = (win == null ? void 0 : win.innerWidth) ?? ((_d = (_c = win == null ? void 0 : win.document) == null ? void 0 : _c.documentElement) == null ? void 0 : _d.clientWidth) ?? 0;
604
+ return rect.width > 0 && rect.height > 0 && rect.top >= 0 && rect.left >= 0 && rect.bottom <= height && rect.right <= width;
600
605
  }
601
606
  const interactiveEvents$1 = [
602
607
  "change",
@@ -636,7 +641,7 @@ const interactiveTags = [
636
641
  "video",
637
642
  "audio"
638
643
  ];
639
- const inlineEventAttributes$1 = [
644
+ const inlineEventAttributes = [
640
645
  "onclick",
641
646
  "ondblclick",
642
647
  "onmousedown",
@@ -679,7 +684,6 @@ function hasEventListeners(n2) {
679
684
  return n2 instanceof Element && interactiveElementsRegistry$1.has(n2);
680
685
  }
681
686
  function isElementInteractive(n2) {
682
- var _a2;
683
687
  if (n2.nodeType === Node.ELEMENT_NODE) {
684
688
  const element = n2;
685
689
  const tagName = element.tagName.toLowerCase();
@@ -693,30 +697,35 @@ function isElementInteractive(n2) {
693
697
  const result2 = hasEventListeners(element) || hasTabIndex || hasRoleInteractive || element instanceof HTMLAnchorElement && element.hasAttribute("href") || element instanceof HTMLButtonElement && !element.disabled;
694
698
  return result2;
695
699
  }
696
- if (n2.nodeType === Node.TEXT_NODE) {
697
- const textNode = n2;
698
- const parentElement2 = textNode.parentElement;
699
- if (parentElement2 !== null && interactiveTags.includes(parentElement2.tagName.toLowerCase())) {
700
- return true;
701
- }
702
- return parentElement2 !== null && isElementVisible(parentElement2) && ((_a2 = textNode.textContent) == null ? void 0 : _a2.trim().length) !== 0 && isElementInteractive(parentElement2);
703
- }
704
700
  return false;
705
701
  }
706
- function inspectInlineEventHandlers$1() {
707
- const allElements = document.querySelectorAll("*");
702
+ function inspectInlineEventHandlers(doc) {
703
+ if (!doc || typeof doc.querySelectorAll !== "function") return;
704
+ const allElements = doc.querySelectorAll("*");
708
705
  allElements.forEach((el) => {
709
- inlineEventAttributes$1.forEach((attr) => {
706
+ inlineEventAttributes.forEach((attr) => {
710
707
  if (el.hasAttribute(attr)) {
711
708
  interactiveElementsRegistry$1.add(el);
712
709
  }
713
710
  });
714
711
  });
715
712
  }
716
- if (document.readyState === "complete" || document.readyState === "interactive") {
717
- inspectInlineEventHandlers$1();
718
- } else {
719
- document.addEventListener("DOMContentLoaded", inspectInlineEventHandlers$1);
713
+ function scheduleInlineEventInspection(doc) {
714
+ if (!doc || typeof doc.addEventListener !== "function" || typeof doc.querySelectorAll !== "function") {
715
+ return;
716
+ }
717
+ try {
718
+ if (doc.readyState === "complete" || doc.readyState === "interactive") {
719
+ inspectInlineEventHandlers(doc);
720
+ } else {
721
+ doc.addEventListener("DOMContentLoaded", () => inspectInlineEventHandlers(doc), {
722
+ once: true,
723
+ capture: false
724
+ });
725
+ }
726
+ } catch (e2) {
727
+ console.warn("[inlineEventInspection] Failed to inspect document:", e2);
728
+ }
720
729
  }
721
730
  let _id = 1;
722
731
  const tagNameRegex = new RegExp("[^a-z0-9-_:]");
@@ -835,9 +844,29 @@ function transformAttribute(doc, tagName, name, value) {
835
844
  }
836
845
  return value;
837
846
  }
838
- function ignoreAttribute(tagName, name, _value) {
847
+ function isIgnoreAttribute(tagName, name, _value) {
839
848
  return (tagName === "video" || tagName === "audio") && name === "autoplay";
840
849
  }
850
+ function cleanAttributes(doc, element, ignoreAttribute) {
851
+ const tagName = getValidTagName$1(element);
852
+ const attributes = {};
853
+ const len = element.attributes.length;
854
+ for (let i2 = 0; i2 < len; i2++) {
855
+ const attr = element.attributes[i2];
856
+ const name = attr.name;
857
+ const value = attr.value;
858
+ const shouldIgnoreByName = typeof ignoreAttribute === "string" ? name === ignoreAttribute : ignoreAttribute.test(name);
859
+ if (!shouldIgnoreByName && !isIgnoreAttribute(tagName, name)) {
860
+ attributes[name] = transformAttribute(
861
+ doc,
862
+ tagName,
863
+ toLowerCase(name),
864
+ value
865
+ );
866
+ }
867
+ }
868
+ return attributes;
869
+ }
841
870
  function _isBlockedElement(element, blockClass, blockSelector) {
842
871
  try {
843
872
  if (typeof blockClass === "string") {
@@ -967,6 +996,7 @@ function serializeNode(n2, options) {
967
996
  mirror: mirror2,
968
997
  blockClass,
969
998
  blockSelector,
999
+ ignoreAttribute,
970
1000
  needsMask,
971
1001
  inlineStylesheet,
972
1002
  maskInputOptions = {},
@@ -1011,6 +1041,7 @@ function serializeNode(n2, options) {
1011
1041
  doc,
1012
1042
  blockClass,
1013
1043
  blockSelector,
1044
+ ignoreAttribute,
1014
1045
  inlineStylesheet,
1015
1046
  maskInputOptions,
1016
1047
  maskInputFn,
@@ -1088,6 +1119,7 @@ function serializeElementNode(n2, options) {
1088
1119
  doc,
1089
1120
  blockClass,
1090
1121
  blockSelector,
1122
+ ignoreAttribute,
1091
1123
  inlineStylesheet,
1092
1124
  maskInputOptions = {},
1093
1125
  maskInputFn,
@@ -1101,19 +1133,7 @@ function serializeElementNode(n2, options) {
1101
1133
  } = options;
1102
1134
  const needBlock = _isBlockedElement(n2, blockClass, blockSelector);
1103
1135
  const tagName = getValidTagName$1(n2);
1104
- let attributes = {};
1105
- const len = n2.attributes.length;
1106
- for (let i2 = 0; i2 < len; i2++) {
1107
- const attr = n2.attributes[i2];
1108
- if (!ignoreAttribute(tagName, attr.name, attr.value)) {
1109
- attributes[attr.name] = transformAttribute(
1110
- doc,
1111
- tagName,
1112
- toLowerCase(attr.name),
1113
- attr.value
1114
- );
1115
- }
1116
- }
1136
+ let attributes = cleanAttributes(doc, n2, ignoreAttribute);
1117
1137
  if (tagName === "link" && inlineStylesheet) {
1118
1138
  const stylesheet = Array.from(doc.styleSheets).find((s2) => {
1119
1139
  return s2.href === n2.href;
@@ -1327,6 +1347,7 @@ function serializeNodeWithId(n2, options) {
1327
1347
  blockSelector,
1328
1348
  maskTextClass,
1329
1349
  maskTextSelector,
1350
+ ignoreAttribute,
1330
1351
  skipChild = false,
1331
1352
  inlineStylesheet = true,
1332
1353
  maskInputOptions = {},
@@ -1361,6 +1382,7 @@ function serializeNodeWithId(n2, options) {
1361
1382
  mirror: mirror2,
1362
1383
  blockClass,
1363
1384
  blockSelector,
1385
+ ignoreAttribute,
1364
1386
  needsMask,
1365
1387
  inlineStylesheet,
1366
1388
  maskInputOptions,
@@ -1413,6 +1435,7 @@ function serializeNodeWithId(n2, options) {
1413
1435
  needsMask,
1414
1436
  maskTextClass,
1415
1437
  maskTextSelector,
1438
+ ignoreAttribute,
1416
1439
  skipChild,
1417
1440
  inlineStylesheet,
1418
1441
  maskInputOptions,
@@ -1472,6 +1495,7 @@ function serializeNodeWithId(n2, options) {
1472
1495
  needsMask,
1473
1496
  maskTextClass,
1474
1497
  maskTextSelector,
1498
+ ignoreAttribute,
1475
1499
  skipChild: false,
1476
1500
  inlineStylesheet,
1477
1501
  maskInputOptions,
@@ -1513,6 +1537,7 @@ function serializeNodeWithId(n2, options) {
1513
1537
  needsMask,
1514
1538
  maskTextClass,
1515
1539
  maskTextSelector,
1540
+ ignoreAttribute,
1516
1541
  skipChild: false,
1517
1542
  inlineStylesheet,
1518
1543
  maskInputOptions,
@@ -1550,6 +1575,7 @@ function snapshot(n2, options) {
1550
1575
  blockSelector = null,
1551
1576
  maskTextClass = "rr-mask",
1552
1577
  maskTextSelector = null,
1578
+ ignoreAttribute = "rr-ignore-attr",
1553
1579
  inlineStylesheet = true,
1554
1580
  inlineImages = false,
1555
1581
  recordCanvas = false,
@@ -1566,6 +1592,7 @@ function snapshot(n2, options) {
1566
1592
  stylesheetLoadTimeout,
1567
1593
  keepIframeSrcFn = () => false
1568
1594
  } = options || {};
1595
+ scheduleInlineEventInspection(n2);
1569
1596
  const maskInputOptions = maskAllInputs === true ? {
1570
1597
  color: true,
1571
1598
  date: true,
@@ -1609,6 +1636,7 @@ function snapshot(n2, options) {
1609
1636
  blockSelector,
1610
1637
  maskTextClass,
1611
1638
  maskTextSelector,
1639
+ ignoreAttribute,
1612
1640
  skipChild: false,
1613
1641
  inlineStylesheet,
1614
1642
  maskInputOptions,
@@ -5684,30 +5712,6 @@ const interactiveEvents = [
5684
5712
  "touchend",
5685
5713
  "touchcancel"
5686
5714
  ];
5687
- const inlineEventAttributes = [
5688
- "onclick",
5689
- "ondblclick",
5690
- "onmousedown",
5691
- "onmouseup",
5692
- "onmouseover",
5693
- "onmouseout",
5694
- "onmousemove",
5695
- "onfocus",
5696
- "onblur",
5697
- "onkeydown",
5698
- "onkeypress",
5699
- "onkeyup",
5700
- "onchange",
5701
- "oninput",
5702
- "onsubmit",
5703
- "onreset",
5704
- "onselect",
5705
- "oncontextmenu",
5706
- "ontouchstart",
5707
- "ontouchmove",
5708
- "ontouchend",
5709
- "ontouchcancel"
5710
- ];
5711
5715
  const interactiveElementsRegistry = /* @__PURE__ */ new WeakSet();
5712
5716
  const originalAddEventListener = EventTarget.prototype.addEventListener;
5713
5717
  EventTarget.prototype.addEventListener = function(type, listener, options) {
@@ -5723,21 +5727,6 @@ const originalRemoveEventListener = EventTarget.prototype.removeEventListener;
5723
5727
  EventTarget.prototype.removeEventListener = function(type, listener, options) {
5724
5728
  originalRemoveEventListener.call(this, type, listener, options);
5725
5729
  };
5726
- function inspectInlineEventHandlers() {
5727
- const allElements = document.querySelectorAll("*");
5728
- allElements.forEach((el) => {
5729
- inlineEventAttributes.forEach((attr) => {
5730
- if (el.hasAttribute(attr)) {
5731
- interactiveElementsRegistry.add(el);
5732
- }
5733
- });
5734
- });
5735
- }
5736
- if (document.readyState === "complete" || document.readyState === "interactive") {
5737
- inspectInlineEventHandlers();
5738
- } else {
5739
- document.addEventListener("DOMContentLoaded", inspectInlineEventHandlers);
5740
- }
5741
5730
  function getDefaultExportFromCjs(x2) {
5742
5731
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
5743
5732
  }
@@ -10813,7 +10802,7 @@ let nowTimestamp = Date.now;
10813
10802
  if (!/* @__PURE__ */ /[1-9][0-9]{12}/.test(Date.now().toString())) {
10814
10803
  nowTimestamp = () => (/* @__PURE__ */ new Date()).getTime();
10815
10804
  }
10816
- function getWindowScroll(win) {
10805
+ function getWindowScroll(win = window) {
10817
10806
  var _a2, _b, _c, _d;
10818
10807
  const doc = win.document;
10819
10808
  return {
@@ -10821,11 +10810,13 @@ function getWindowScroll(win) {
10821
10810
  top: doc.scrollingElement ? doc.scrollingElement.scrollTop : win.pageYOffset !== void 0 ? win.pageYOffset : (doc == null ? void 0 : doc.documentElement.scrollTop) || (doc == null ? void 0 : doc.body) && ((_c = index.parentElement(doc.body)) == null ? void 0 : _c.scrollTop) || ((_d = doc == null ? void 0 : doc.body) == null ? void 0 : _d.scrollTop) || 0
10822
10811
  };
10823
10812
  }
10824
- function getWindowHeight() {
10825
- return window.innerHeight || document.documentElement && document.documentElement.clientHeight || document.body && document.body.clientHeight;
10813
+ function getWindowHeight(win = window) {
10814
+ const doc = win.document;
10815
+ return win.innerHeight || doc.documentElement && doc.documentElement.clientHeight || doc.body && doc.body.clientHeight || 0;
10826
10816
  }
10827
- function getWindowWidth() {
10828
- return window.innerWidth || document.documentElement && document.documentElement.clientWidth || document.body && document.body.clientWidth;
10817
+ function getWindowWidth(win = window) {
10818
+ const doc = win.document;
10819
+ return win.innerWidth || doc.documentElement && doc.documentElement.clientWidth || doc.body && doc.body.clientWidth || 0;
10829
10820
  }
10830
10821
  function closestElementOfNode(node2) {
10831
10822
  if (!node2) {
@@ -11311,6 +11302,7 @@ class MutationBuffer {
11311
11302
  __publicField(this, "blockSelector");
11312
11303
  __publicField(this, "maskTextClass");
11313
11304
  __publicField(this, "maskTextSelector");
11305
+ __publicField(this, "ignoreAttribute");
11314
11306
  __publicField(this, "inlineStylesheet");
11315
11307
  __publicField(this, "maskInputOptions");
11316
11308
  __publicField(this, "maskTextFn");
@@ -11374,6 +11366,7 @@ class MutationBuffer {
11374
11366
  blockSelector: this.blockSelector,
11375
11367
  maskTextClass: this.maskTextClass,
11376
11368
  maskTextSelector: this.maskTextSelector,
11369
+ ignoreAttribute: this.ignoreAttribute || "",
11377
11370
  skipChild: true,
11378
11371
  newlyAddedElement: true,
11379
11372
  inlineStylesheet: this.inlineStylesheet,
@@ -11602,7 +11595,7 @@ class MutationBuffer {
11602
11595
  if (attributeName === "type" && target.tagName === "INPUT" && (m.oldValue || "").toLowerCase() === "password") {
11603
11596
  target.setAttribute("data-rr-is-password", "true");
11604
11597
  }
11605
- if (!ignoreAttribute(target.tagName, attributeName)) {
11598
+ if (!isIgnoreAttribute(target.tagName, attributeName)) {
11606
11599
  item.attributes[attributeName] = transformAttribute(
11607
11600
  this.doc,
11608
11601
  toLowerCase(target.tagName),
@@ -11724,6 +11717,7 @@ class MutationBuffer {
11724
11717
  "blockSelector",
11725
11718
  "maskTextClass",
11726
11719
  "maskTextSelector",
11720
+ "ignoreAttribute",
11727
11721
  "inlineStylesheet",
11728
11722
  "maskInputOptions",
11729
11723
  "maskTextFn",
@@ -13963,6 +13957,7 @@ try {
13963
13957
  }
13964
13958
  const mirror = createMirror$2();
13965
13959
  function record(options = {}) {
13960
+ var _a2;
13966
13961
  const {
13967
13962
  emit,
13968
13963
  checkoutEveryNms,
@@ -13972,6 +13967,7 @@ function record(options = {}) {
13972
13967
  blockSelector = null,
13973
13968
  ignoreClass = "rr-ignore",
13974
13969
  ignoreSelector = null,
13970
+ ignoreAttribute = "rr-ignore-attribute",
13975
13971
  maskTextClass = "rr-mask",
13976
13972
  maskTextSelector = null,
13977
13973
  inlineStylesheet = true,
@@ -13997,12 +13993,24 @@ function record(options = {}) {
13997
13993
  ignoreCSSAttributes = /* @__PURE__ */ new Set([]),
13998
13994
  errorHandler: errorHandler2
13999
13995
  } = options;
13996
+ const win = options.customWindow || window;
13997
+ const doc = options.customDocument || document;
13998
+ try {
13999
+ if (Array.from([1], (x2) => x2 * 2)[0] !== 2) {
14000
+ const cleanFrame = doc.createElement("iframe");
14001
+ doc.body.appendChild(cleanFrame);
14002
+ Array.from = ((_a2 = cleanFrame.contentWindow) == null ? void 0 : _a2.Array.from) || Array.from;
14003
+ doc.body.removeChild(cleanFrame);
14004
+ }
14005
+ } catch (err) {
14006
+ console.debug("Unable to override Array.from", err);
14007
+ }
14000
14008
  registerErrorHandler(errorHandler2);
14001
- const inEmittingFrame = recordCrossOriginIframes ? window.parent === window : true;
14009
+ const inEmittingFrame = recordCrossOriginIframes ? win.parent === win : true;
14002
14010
  let passEmitsToParent = false;
14003
14011
  if (!inEmittingFrame) {
14004
14012
  try {
14005
- if (window.parent.document) {
14013
+ if (win.parent.document) {
14006
14014
  passEmitsToParent = false;
14007
14015
  }
14008
14016
  } catch (e2) {
@@ -14069,10 +14077,10 @@ function record(options = {}) {
14069
14077
  return e2;
14070
14078
  };
14071
14079
  wrappedEmit = (r2, isCheckout) => {
14072
- var _a2;
14080
+ var _a3;
14073
14081
  const e2 = r2;
14074
14082
  e2.timestamp = nowTimestamp();
14075
- if (((_a2 = mutationBuffers[0]) == null ? void 0 : _a2.isFrozen()) && e2.type !== EventType.FullSnapshot && !(e2.type === EventType.IncrementalSnapshot && e2.data.source === IncrementalSource.Mutation)) {
14083
+ if (((_a3 = mutationBuffers[0]) == null ? void 0 : _a3.isFrozen()) && e2.type !== EventType.FullSnapshot && !(e2.type === EventType.IncrementalSnapshot && e2.data.source === IncrementalSource.Mutation)) {
14076
14084
  mutationBuffers.forEach((buf) => buf.unfreeze());
14077
14085
  }
14078
14086
  if (inEmittingFrame) {
@@ -14081,10 +14089,10 @@ function record(options = {}) {
14081
14089
  const message = {
14082
14090
  type: "rrweb",
14083
14091
  event: eventProcessor(e2),
14084
- origin: window.location.origin,
14092
+ origin: win.location.origin,
14085
14093
  isCheckout
14086
14094
  };
14087
- window.parent.postMessage(message, "*");
14095
+ win.parent.postMessage(message, "*");
14088
14096
  }
14089
14097
  if (e2.type === EventType.FullSnapshot) {
14090
14098
  lastFullSnapshotEvent = e2;
@@ -14155,7 +14163,7 @@ function record(options = {}) {
14155
14163
  canvasManager = new CanvasManager({
14156
14164
  recordCanvas,
14157
14165
  mutationCb: wrappedCanvasMutationEmit,
14158
- win: window,
14166
+ win,
14159
14167
  blockClass,
14160
14168
  blockSelector,
14161
14169
  mirror,
@@ -14170,6 +14178,7 @@ function record(options = {}) {
14170
14178
  blockSelector,
14171
14179
  maskTextClass,
14172
14180
  maskTextSelector,
14181
+ ignoreAttribute,
14173
14182
  inlineStylesheet,
14174
14183
  maskInputOptions,
14175
14184
  dataURLOptions,
@@ -14195,9 +14204,9 @@ function record(options = {}) {
14195
14204
  {
14196
14205
  type: EventType.Meta,
14197
14206
  data: {
14198
- href: window.location.href,
14199
- width: getWindowWidth(),
14200
- height: getWindowHeight()
14207
+ href: win.location.href,
14208
+ width: getWindowWidth(win),
14209
+ height: getWindowHeight(win)
14201
14210
  }
14202
14211
  },
14203
14212
  isCheckout
@@ -14205,7 +14214,7 @@ function record(options = {}) {
14205
14214
  stylesheetManager.reset();
14206
14215
  shadowDomManager.init();
14207
14216
  mutationBuffers.forEach((buf) => buf.lock());
14208
- const node2 = snapshot(document, {
14217
+ const node2 = snapshot(doc, {
14209
14218
  mirror,
14210
14219
  blockClass,
14211
14220
  blockSelector,
@@ -14227,7 +14236,7 @@ function record(options = {}) {
14227
14236
  stylesheetManager.trackLinkElement(n2);
14228
14237
  }
14229
14238
  if (hasShadowRoot(n2)) {
14230
- shadowDomManager.addShadowRoot(index.shadowRoot(n2), document);
14239
+ shadowDomManager.addShadowRoot(index.shadowRoot(n2), doc);
14231
14240
  }
14232
14241
  },
14233
14242
  onIframeLoad: (iframe, childSn) => {
@@ -14247,22 +14256,22 @@ function record(options = {}) {
14247
14256
  type: EventType.FullSnapshot,
14248
14257
  data: {
14249
14258
  node: node2,
14250
- initialOffset: getWindowScroll(window)
14259
+ initialOffset: getWindowScroll(win)
14251
14260
  }
14252
14261
  },
14253
14262
  isCheckout
14254
14263
  );
14255
14264
  mutationBuffers.forEach((buf) => buf.unlock());
14256
- if (document.adoptedStyleSheets && document.adoptedStyleSheets.length > 0)
14265
+ if (doc.adoptedStyleSheets && doc.adoptedStyleSheets.length > 0)
14257
14266
  stylesheetManager.adoptStyleSheets(
14258
- document.adoptedStyleSheets,
14259
- mirror.getId(document)
14267
+ doc.adoptedStyleSheets,
14268
+ mirror.getId(doc)
14260
14269
  );
14261
14270
  };
14262
14271
  try {
14263
14272
  const handlers = [];
14264
- const observe = (doc) => {
14265
- var _a2;
14273
+ const observe = (doc2) => {
14274
+ var _a3;
14266
14275
  return callbackWrapper(initObservers)(
14267
14276
  {
14268
14277
  mutationCb: wrappedMutationEmit,
@@ -14356,6 +14365,7 @@ function record(options = {}) {
14356
14365
  ignoreSelector,
14357
14366
  maskTextClass,
14358
14367
  maskTextSelector,
14368
+ ignoreAttribute,
14359
14369
  maskInputOptions,
14360
14370
  inlineStylesheet,
14361
14371
  sampling,
@@ -14364,7 +14374,7 @@ function record(options = {}) {
14364
14374
  inlineImages,
14365
14375
  userTriggeredOnInput,
14366
14376
  collectFonts,
14367
- doc,
14377
+ doc: doc2,
14368
14378
  maskInputFn,
14369
14379
  maskTextFn,
14370
14380
  keepIframeSrcFn,
@@ -14378,7 +14388,7 @@ function record(options = {}) {
14378
14388
  processedNodeManager,
14379
14389
  canvasManager,
14380
14390
  ignoreCSSAttributes,
14381
- plugins: ((_a2 = plugins == null ? void 0 : plugins.filter((p) => p.observer)) == null ? void 0 : _a2.map((p) => ({
14391
+ plugins: ((_a3 = plugins == null ? void 0 : plugins.filter((p) => p.observer)) == null ? void 0 : _a3.map((p) => ({
14382
14392
  observer: p.observer,
14383
14393
  options: p.options,
14384
14394
  callback: (payload) => wrappedEmit({
@@ -14402,10 +14412,10 @@ function record(options = {}) {
14402
14412
  });
14403
14413
  const init = () => {
14404
14414
  takeFullSnapshot$1();
14405
- handlers.push(observe(document));
14415
+ handlers.push(observe(doc));
14406
14416
  recording = true;
14407
14417
  };
14408
- if (document.readyState === "interactive" || document.readyState === "complete") {
14418
+ if (doc.readyState === "interactive" || doc.readyState === "complete") {
14409
14419
  init();
14410
14420
  } else {
14411
14421
  handlers.push(
@@ -14427,7 +14437,7 @@ function record(options = {}) {
14427
14437
  });
14428
14438
  if (recordAfter === "load") init();
14429
14439
  },
14430
- window
14440
+ win
14431
14441
  )
14432
14442
  );
14433
14443
  }