@appsurify-testmap/rrweb-all 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-all.cjs +117 -107
- package/dist/rrweb-all.cjs.map +1 -1
- package/dist/rrweb-all.js +117 -107
- package/dist/rrweb-all.js.map +1 -1
- package/dist/rrweb-all.umd.cjs +119 -107
- package/dist/rrweb-all.umd.cjs.map +3 -3
- package/dist/rrweb-all.umd.min.cjs +24 -24
- package/dist/rrweb-all.umd.min.cjs.map +3 -3
- package/package.json +4 -4
package/dist/rrweb-all.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
|
|
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
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
const
|
|
596
|
-
|
|
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
|
-
|
|
600
|
+
function isRectVisible(rect, win) {
|
|
601
|
+
var _a2, _b2, _c, _d;
|
|
602
|
+
const height = (win == null ? void 0 : win.innerHeight) ?? ((_b2 = (_a2 = win == null ? void 0 : win.document) == null ? void 0 : _a2.documentElement) == null ? void 0 : _b2.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
|
|
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
|
|
707
|
-
|
|
702
|
+
function inspectInlineEventHandlers(doc) {
|
|
703
|
+
if (!doc || typeof doc.querySelectorAll !== "function") return;
|
|
704
|
+
const allElements = doc.querySelectorAll("*");
|
|
708
705
|
allElements.forEach((el) => {
|
|
709
|
-
inlineEventAttributes
|
|
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
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
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
|
|
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, _b2, _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
|
-
|
|
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
|
-
|
|
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) {
|
|
@@ -11294,6 +11285,7 @@ class MutationBuffer {
|
|
|
11294
11285
|
__publicField(this, "blockSelector");
|
|
11295
11286
|
__publicField(this, "maskTextClass");
|
|
11296
11287
|
__publicField(this, "maskTextSelector");
|
|
11288
|
+
__publicField(this, "ignoreAttribute");
|
|
11297
11289
|
__publicField(this, "inlineStylesheet");
|
|
11298
11290
|
__publicField(this, "maskInputOptions");
|
|
11299
11291
|
__publicField(this, "maskTextFn");
|
|
@@ -11357,6 +11349,7 @@ class MutationBuffer {
|
|
|
11357
11349
|
blockSelector: this.blockSelector,
|
|
11358
11350
|
maskTextClass: this.maskTextClass,
|
|
11359
11351
|
maskTextSelector: this.maskTextSelector,
|
|
11352
|
+
ignoreAttribute: this.ignoreAttribute || "",
|
|
11360
11353
|
skipChild: true,
|
|
11361
11354
|
newlyAddedElement: true,
|
|
11362
11355
|
inlineStylesheet: this.inlineStylesheet,
|
|
@@ -11585,7 +11578,7 @@ class MutationBuffer {
|
|
|
11585
11578
|
if (attributeName === "type" && target.tagName === "INPUT" && (m.oldValue || "").toLowerCase() === "password") {
|
|
11586
11579
|
target.setAttribute("data-rr-is-password", "true");
|
|
11587
11580
|
}
|
|
11588
|
-
if (!
|
|
11581
|
+
if (!isIgnoreAttribute(target.tagName, attributeName)) {
|
|
11589
11582
|
item.attributes[attributeName] = transformAttribute(
|
|
11590
11583
|
this.doc,
|
|
11591
11584
|
toLowerCase(target.tagName),
|
|
@@ -11704,6 +11697,7 @@ class MutationBuffer {
|
|
|
11704
11697
|
"blockSelector",
|
|
11705
11698
|
"maskTextClass",
|
|
11706
11699
|
"maskTextSelector",
|
|
11700
|
+
"ignoreAttribute",
|
|
11707
11701
|
"inlineStylesheet",
|
|
11708
11702
|
"maskInputOptions",
|
|
11709
11703
|
"maskTextFn",
|
|
@@ -13943,6 +13937,7 @@ try {
|
|
|
13943
13937
|
}
|
|
13944
13938
|
const mirror = createMirror$2();
|
|
13945
13939
|
function record(options = {}) {
|
|
13940
|
+
var _a2;
|
|
13946
13941
|
const {
|
|
13947
13942
|
emit,
|
|
13948
13943
|
checkoutEveryNms,
|
|
@@ -13952,6 +13947,7 @@ function record(options = {}) {
|
|
|
13952
13947
|
blockSelector = null,
|
|
13953
13948
|
ignoreClass = "rr-ignore",
|
|
13954
13949
|
ignoreSelector = null,
|
|
13950
|
+
ignoreAttribute = "rr-ignore-attribute",
|
|
13955
13951
|
maskTextClass = "rr-mask",
|
|
13956
13952
|
maskTextSelector = null,
|
|
13957
13953
|
inlineStylesheet = true,
|
|
@@ -13977,12 +13973,24 @@ function record(options = {}) {
|
|
|
13977
13973
|
ignoreCSSAttributes = /* @__PURE__ */ new Set([]),
|
|
13978
13974
|
errorHandler: errorHandler2
|
|
13979
13975
|
} = options;
|
|
13976
|
+
const win = options.customWindow || window;
|
|
13977
|
+
const doc = options.customDocument || document;
|
|
13978
|
+
try {
|
|
13979
|
+
if (Array.from([1], (x2) => x2 * 2)[0] !== 2) {
|
|
13980
|
+
const cleanFrame = doc.createElement("iframe");
|
|
13981
|
+
doc.body.appendChild(cleanFrame);
|
|
13982
|
+
Array.from = ((_a2 = cleanFrame.contentWindow) == null ? void 0 : _a2.Array.from) || Array.from;
|
|
13983
|
+
doc.body.removeChild(cleanFrame);
|
|
13984
|
+
}
|
|
13985
|
+
} catch (err) {
|
|
13986
|
+
console.debug("Unable to override Array.from", err);
|
|
13987
|
+
}
|
|
13980
13988
|
registerErrorHandler(errorHandler2);
|
|
13981
|
-
const inEmittingFrame = recordCrossOriginIframes ?
|
|
13989
|
+
const inEmittingFrame = recordCrossOriginIframes ? win.parent === win : true;
|
|
13982
13990
|
let passEmitsToParent = false;
|
|
13983
13991
|
if (!inEmittingFrame) {
|
|
13984
13992
|
try {
|
|
13985
|
-
if (
|
|
13993
|
+
if (win.parent.document) {
|
|
13986
13994
|
passEmitsToParent = false;
|
|
13987
13995
|
}
|
|
13988
13996
|
} catch (e2) {
|
|
@@ -14049,10 +14057,10 @@ function record(options = {}) {
|
|
|
14049
14057
|
return e2;
|
|
14050
14058
|
};
|
|
14051
14059
|
wrappedEmit = (r2, isCheckout) => {
|
|
14052
|
-
var
|
|
14060
|
+
var _a3;
|
|
14053
14061
|
const e2 = r2;
|
|
14054
14062
|
e2.timestamp = nowTimestamp();
|
|
14055
|
-
if (((
|
|
14063
|
+
if (((_a3 = mutationBuffers[0]) == null ? void 0 : _a3.isFrozen()) && e2.type !== EventType.FullSnapshot && !(e2.type === EventType.IncrementalSnapshot && e2.data.source === IncrementalSource.Mutation)) {
|
|
14056
14064
|
mutationBuffers.forEach((buf) => buf.unfreeze());
|
|
14057
14065
|
}
|
|
14058
14066
|
if (inEmittingFrame) {
|
|
@@ -14061,10 +14069,10 @@ function record(options = {}) {
|
|
|
14061
14069
|
const message = {
|
|
14062
14070
|
type: "rrweb",
|
|
14063
14071
|
event: eventProcessor(e2),
|
|
14064
|
-
origin:
|
|
14072
|
+
origin: win.location.origin,
|
|
14065
14073
|
isCheckout
|
|
14066
14074
|
};
|
|
14067
|
-
|
|
14075
|
+
win.parent.postMessage(message, "*");
|
|
14068
14076
|
}
|
|
14069
14077
|
if (e2.type === EventType.FullSnapshot) {
|
|
14070
14078
|
lastFullSnapshotEvent = e2;
|
|
@@ -14135,7 +14143,7 @@ function record(options = {}) {
|
|
|
14135
14143
|
canvasManager = new CanvasManager({
|
|
14136
14144
|
recordCanvas,
|
|
14137
14145
|
mutationCb: wrappedCanvasMutationEmit,
|
|
14138
|
-
win
|
|
14146
|
+
win,
|
|
14139
14147
|
blockClass,
|
|
14140
14148
|
blockSelector,
|
|
14141
14149
|
mirror,
|
|
@@ -14150,6 +14158,7 @@ function record(options = {}) {
|
|
|
14150
14158
|
blockSelector,
|
|
14151
14159
|
maskTextClass,
|
|
14152
14160
|
maskTextSelector,
|
|
14161
|
+
ignoreAttribute,
|
|
14153
14162
|
inlineStylesheet,
|
|
14154
14163
|
maskInputOptions,
|
|
14155
14164
|
dataURLOptions,
|
|
@@ -14175,9 +14184,9 @@ function record(options = {}) {
|
|
|
14175
14184
|
{
|
|
14176
14185
|
type: EventType.Meta,
|
|
14177
14186
|
data: {
|
|
14178
|
-
href:
|
|
14179
|
-
width: getWindowWidth(),
|
|
14180
|
-
height: getWindowHeight()
|
|
14187
|
+
href: win.location.href,
|
|
14188
|
+
width: getWindowWidth(win),
|
|
14189
|
+
height: getWindowHeight(win)
|
|
14181
14190
|
}
|
|
14182
14191
|
},
|
|
14183
14192
|
isCheckout
|
|
@@ -14185,7 +14194,7 @@ function record(options = {}) {
|
|
|
14185
14194
|
stylesheetManager.reset();
|
|
14186
14195
|
shadowDomManager.init();
|
|
14187
14196
|
mutationBuffers.forEach((buf) => buf.lock());
|
|
14188
|
-
const node2 = snapshot(
|
|
14197
|
+
const node2 = snapshot(doc, {
|
|
14189
14198
|
mirror,
|
|
14190
14199
|
blockClass,
|
|
14191
14200
|
blockSelector,
|
|
@@ -14207,7 +14216,7 @@ function record(options = {}) {
|
|
|
14207
14216
|
stylesheetManager.trackLinkElement(n2);
|
|
14208
14217
|
}
|
|
14209
14218
|
if (hasShadowRoot(n2)) {
|
|
14210
|
-
shadowDomManager.addShadowRoot(index.shadowRoot(n2),
|
|
14219
|
+
shadowDomManager.addShadowRoot(index.shadowRoot(n2), doc);
|
|
14211
14220
|
}
|
|
14212
14221
|
},
|
|
14213
14222
|
onIframeLoad: (iframe, childSn) => {
|
|
@@ -14227,22 +14236,22 @@ function record(options = {}) {
|
|
|
14227
14236
|
type: EventType.FullSnapshot,
|
|
14228
14237
|
data: {
|
|
14229
14238
|
node: node2,
|
|
14230
|
-
initialOffset: getWindowScroll(
|
|
14239
|
+
initialOffset: getWindowScroll(win)
|
|
14231
14240
|
}
|
|
14232
14241
|
},
|
|
14233
14242
|
isCheckout
|
|
14234
14243
|
);
|
|
14235
14244
|
mutationBuffers.forEach((buf) => buf.unlock());
|
|
14236
|
-
if (
|
|
14245
|
+
if (doc.adoptedStyleSheets && doc.adoptedStyleSheets.length > 0)
|
|
14237
14246
|
stylesheetManager.adoptStyleSheets(
|
|
14238
|
-
|
|
14239
|
-
mirror.getId(
|
|
14247
|
+
doc.adoptedStyleSheets,
|
|
14248
|
+
mirror.getId(doc)
|
|
14240
14249
|
);
|
|
14241
14250
|
};
|
|
14242
14251
|
try {
|
|
14243
14252
|
const handlers = [];
|
|
14244
|
-
const observe = (
|
|
14245
|
-
var
|
|
14253
|
+
const observe = (doc2) => {
|
|
14254
|
+
var _a3;
|
|
14246
14255
|
return callbackWrapper(initObservers)(
|
|
14247
14256
|
{
|
|
14248
14257
|
mutationCb: wrappedMutationEmit,
|
|
@@ -14336,6 +14345,7 @@ function record(options = {}) {
|
|
|
14336
14345
|
ignoreSelector,
|
|
14337
14346
|
maskTextClass,
|
|
14338
14347
|
maskTextSelector,
|
|
14348
|
+
ignoreAttribute,
|
|
14339
14349
|
maskInputOptions,
|
|
14340
14350
|
inlineStylesheet,
|
|
14341
14351
|
sampling,
|
|
@@ -14344,7 +14354,7 @@ function record(options = {}) {
|
|
|
14344
14354
|
inlineImages,
|
|
14345
14355
|
userTriggeredOnInput,
|
|
14346
14356
|
collectFonts,
|
|
14347
|
-
doc,
|
|
14357
|
+
doc: doc2,
|
|
14348
14358
|
maskInputFn,
|
|
14349
14359
|
maskTextFn,
|
|
14350
14360
|
keepIframeSrcFn,
|
|
@@ -14358,7 +14368,7 @@ function record(options = {}) {
|
|
|
14358
14368
|
processedNodeManager,
|
|
14359
14369
|
canvasManager,
|
|
14360
14370
|
ignoreCSSAttributes,
|
|
14361
|
-
plugins: ((
|
|
14371
|
+
plugins: ((_a3 = plugins == null ? void 0 : plugins.filter((p) => p.observer)) == null ? void 0 : _a3.map((p) => ({
|
|
14362
14372
|
observer: p.observer,
|
|
14363
14373
|
options: p.options,
|
|
14364
14374
|
callback: (payload) => wrappedEmit({
|
|
@@ -14382,10 +14392,10 @@ function record(options = {}) {
|
|
|
14382
14392
|
});
|
|
14383
14393
|
const init = () => {
|
|
14384
14394
|
takeFullSnapshot$1();
|
|
14385
|
-
handlers.push(observe(
|
|
14395
|
+
handlers.push(observe(doc));
|
|
14386
14396
|
recording = true;
|
|
14387
14397
|
};
|
|
14388
|
-
if (
|
|
14398
|
+
if (doc.readyState === "interactive" || doc.readyState === "complete") {
|
|
14389
14399
|
init();
|
|
14390
14400
|
} else {
|
|
14391
14401
|
handlers.push(
|
|
@@ -14407,7 +14417,7 @@ function record(options = {}) {
|
|
|
14407
14417
|
});
|
|
14408
14418
|
if (recordAfter === "load") init();
|
|
14409
14419
|
},
|
|
14410
|
-
|
|
14420
|
+
win
|
|
14411
14421
|
)
|
|
14412
14422
|
);
|
|
14413
14423
|
}
|