@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.umd.cjs
CHANGED
|
@@ -572,7 +572,7 @@ function getXPath(node2) {
|
|
|
572
572
|
return "/html/body";
|
|
573
573
|
}
|
|
574
574
|
const parentNode2 = element.parentNode;
|
|
575
|
-
if (!parentNode2
|
|
575
|
+
if (!parentNode2) {
|
|
576
576
|
return "";
|
|
577
577
|
}
|
|
578
578
|
const siblings = Array.from(parentNode2.children).filter(
|
|
@@ -634,14 +634,21 @@ function isTextVisible(n2) {
|
|
|
634
634
|
return textContent2 !== "";
|
|
635
635
|
}
|
|
636
636
|
function isElementVisible(n2) {
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
const style =
|
|
641
|
-
|
|
637
|
+
var _a3;
|
|
638
|
+
var _a2;
|
|
639
|
+
const win = (_a3 = (_a2 = n2.ownerDocument) == null ? void 0 : _a2.defaultView) != null ? _a3 : null;
|
|
640
|
+
const style = win ? win.getComputedStyle(n2) : null;
|
|
641
|
+
const isStyleVisible = style != null && style.display !== "none" && style.visibility !== "hidden" && parseFloat(style.opacity) !== 0;
|
|
642
|
+
const rect = n2.getBoundingClientRect();
|
|
643
|
+
const result2 = isStyleVisible && isRectVisible(rect, win);
|
|
644
|
+
return result2;
|
|
642
645
|
}
|
|
643
|
-
function isRectVisible(rect) {
|
|
644
|
-
|
|
646
|
+
function isRectVisible(rect, win) {
|
|
647
|
+
var _a3, _b3, _c2, _d2;
|
|
648
|
+
var _a2, _b2, _c, _d;
|
|
649
|
+
const height = (_b3 = (_a3 = win == null ? void 0 : win.innerHeight) != null ? _a3 : (_b2 = (_a2 = win == null ? void 0 : win.document) == null ? void 0 : _a2.documentElement) == null ? void 0 : _b2.clientHeight) != null ? _b3 : 0;
|
|
650
|
+
const width = (_d2 = (_c2 = win == null ? void 0 : win.innerWidth) != null ? _c2 : (_d = (_c = win == null ? void 0 : win.document) == null ? void 0 : _c.documentElement) == null ? void 0 : _d.clientWidth) != null ? _d2 : 0;
|
|
651
|
+
return rect.width > 0 && rect.height > 0 && rect.top >= 0 && rect.left >= 0 && rect.bottom <= height && rect.right <= width;
|
|
645
652
|
}
|
|
646
653
|
const interactiveEvents$1 = [
|
|
647
654
|
"change",
|
|
@@ -681,7 +688,7 @@ const interactiveTags = [
|
|
|
681
688
|
"video",
|
|
682
689
|
"audio"
|
|
683
690
|
];
|
|
684
|
-
const inlineEventAttributes
|
|
691
|
+
const inlineEventAttributes = [
|
|
685
692
|
"onclick",
|
|
686
693
|
"ondblclick",
|
|
687
694
|
"onmousedown",
|
|
@@ -724,7 +731,6 @@ function hasEventListeners(n2) {
|
|
|
724
731
|
return n2 instanceof Element && interactiveElementsRegistry$1.has(n2);
|
|
725
732
|
}
|
|
726
733
|
function isElementInteractive(n2) {
|
|
727
|
-
var _a2;
|
|
728
734
|
if (n2.nodeType === Node.ELEMENT_NODE) {
|
|
729
735
|
const element = n2;
|
|
730
736
|
const tagName = element.tagName.toLowerCase();
|
|
@@ -738,30 +744,35 @@ function isElementInteractive(n2) {
|
|
|
738
744
|
const result2 = hasEventListeners(element) || hasTabIndex || hasRoleInteractive || element instanceof HTMLAnchorElement && element.hasAttribute("href") || element instanceof HTMLButtonElement && !element.disabled;
|
|
739
745
|
return result2;
|
|
740
746
|
}
|
|
741
|
-
if (n2.nodeType === Node.TEXT_NODE) {
|
|
742
|
-
const textNode = n2;
|
|
743
|
-
const parentElement2 = textNode.parentElement;
|
|
744
|
-
if (parentElement2 !== null && interactiveTags.includes(parentElement2.tagName.toLowerCase())) {
|
|
745
|
-
return true;
|
|
746
|
-
}
|
|
747
|
-
return parentElement2 !== null && isElementVisible(parentElement2) && ((_a2 = textNode.textContent) == null ? void 0 : _a2.trim().length) !== 0 && isElementInteractive(parentElement2);
|
|
748
|
-
}
|
|
749
747
|
return false;
|
|
750
748
|
}
|
|
751
|
-
function inspectInlineEventHandlers
|
|
752
|
-
|
|
749
|
+
function inspectInlineEventHandlers(doc) {
|
|
750
|
+
if (!doc || typeof doc.querySelectorAll !== "function") return;
|
|
751
|
+
const allElements = doc.querySelectorAll("*");
|
|
753
752
|
allElements.forEach((el) => {
|
|
754
|
-
inlineEventAttributes
|
|
753
|
+
inlineEventAttributes.forEach((attr) => {
|
|
755
754
|
if (el.hasAttribute(attr)) {
|
|
756
755
|
interactiveElementsRegistry$1.add(el);
|
|
757
756
|
}
|
|
758
757
|
});
|
|
759
758
|
});
|
|
760
759
|
}
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
760
|
+
function scheduleInlineEventInspection(doc) {
|
|
761
|
+
if (!doc || typeof doc.addEventListener !== "function" || typeof doc.querySelectorAll !== "function") {
|
|
762
|
+
return;
|
|
763
|
+
}
|
|
764
|
+
try {
|
|
765
|
+
if (doc.readyState === "complete" || doc.readyState === "interactive") {
|
|
766
|
+
inspectInlineEventHandlers(doc);
|
|
767
|
+
} else {
|
|
768
|
+
doc.addEventListener("DOMContentLoaded", () => inspectInlineEventHandlers(doc), {
|
|
769
|
+
once: true,
|
|
770
|
+
capture: false
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
} catch (e2) {
|
|
774
|
+
console.warn("[inlineEventInspection] Failed to inspect document:", e2);
|
|
775
|
+
}
|
|
765
776
|
}
|
|
766
777
|
let _id = 1;
|
|
767
778
|
const tagNameRegex = new RegExp("[^a-z0-9-_:]");
|
|
@@ -880,9 +891,29 @@ function transformAttribute(doc, tagName, name, value) {
|
|
|
880
891
|
}
|
|
881
892
|
return value;
|
|
882
893
|
}
|
|
883
|
-
function
|
|
894
|
+
function isIgnoreAttribute(tagName, name, _value) {
|
|
884
895
|
return (tagName === "video" || tagName === "audio") && name === "autoplay";
|
|
885
896
|
}
|
|
897
|
+
function cleanAttributes(doc, element, ignoreAttribute) {
|
|
898
|
+
const tagName = getValidTagName$1(element);
|
|
899
|
+
const attributes = {};
|
|
900
|
+
const len = element.attributes.length;
|
|
901
|
+
for (let i2 = 0; i2 < len; i2++) {
|
|
902
|
+
const attr = element.attributes[i2];
|
|
903
|
+
const name = attr.name;
|
|
904
|
+
const value = attr.value;
|
|
905
|
+
const shouldIgnoreByName = typeof ignoreAttribute === "string" ? name === ignoreAttribute : ignoreAttribute.test(name);
|
|
906
|
+
if (!shouldIgnoreByName && !isIgnoreAttribute(tagName, name)) {
|
|
907
|
+
attributes[name] = transformAttribute(
|
|
908
|
+
doc,
|
|
909
|
+
tagName,
|
|
910
|
+
toLowerCase(name),
|
|
911
|
+
value
|
|
912
|
+
);
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
return attributes;
|
|
916
|
+
}
|
|
886
917
|
function _isBlockedElement(element, blockClass, blockSelector) {
|
|
887
918
|
try {
|
|
888
919
|
if (typeof blockClass === "string") {
|
|
@@ -1012,6 +1043,7 @@ function serializeNode(n2, options) {
|
|
|
1012
1043
|
mirror: mirror2,
|
|
1013
1044
|
blockClass,
|
|
1014
1045
|
blockSelector,
|
|
1046
|
+
ignoreAttribute,
|
|
1015
1047
|
needsMask,
|
|
1016
1048
|
inlineStylesheet,
|
|
1017
1049
|
maskInputOptions = {},
|
|
@@ -1056,6 +1088,7 @@ function serializeNode(n2, options) {
|
|
|
1056
1088
|
doc,
|
|
1057
1089
|
blockClass,
|
|
1058
1090
|
blockSelector,
|
|
1091
|
+
ignoreAttribute,
|
|
1059
1092
|
inlineStylesheet,
|
|
1060
1093
|
maskInputOptions,
|
|
1061
1094
|
maskInputFn,
|
|
@@ -1133,6 +1166,7 @@ function serializeElementNode(n2, options) {
|
|
|
1133
1166
|
doc,
|
|
1134
1167
|
blockClass,
|
|
1135
1168
|
blockSelector,
|
|
1169
|
+
ignoreAttribute,
|
|
1136
1170
|
inlineStylesheet,
|
|
1137
1171
|
maskInputOptions = {},
|
|
1138
1172
|
maskInputFn,
|
|
@@ -1146,19 +1180,7 @@ function serializeElementNode(n2, options) {
|
|
|
1146
1180
|
} = options;
|
|
1147
1181
|
const needBlock = _isBlockedElement(n2, blockClass, blockSelector);
|
|
1148
1182
|
const tagName = getValidTagName$1(n2);
|
|
1149
|
-
let attributes =
|
|
1150
|
-
const len = n2.attributes.length;
|
|
1151
|
-
for (let i2 = 0; i2 < len; i2++) {
|
|
1152
|
-
const attr = n2.attributes[i2];
|
|
1153
|
-
if (!ignoreAttribute(tagName, attr.name, attr.value)) {
|
|
1154
|
-
attributes[attr.name] = transformAttribute(
|
|
1155
|
-
doc,
|
|
1156
|
-
tagName,
|
|
1157
|
-
toLowerCase(attr.name),
|
|
1158
|
-
attr.value
|
|
1159
|
-
);
|
|
1160
|
-
}
|
|
1161
|
-
}
|
|
1183
|
+
let attributes = cleanAttributes(doc, n2, ignoreAttribute);
|
|
1162
1184
|
if (tagName === "link" && inlineStylesheet) {
|
|
1163
1185
|
const stylesheet = Array.from(doc.styleSheets).find((s2) => {
|
|
1164
1186
|
return s2.href === n2.href;
|
|
@@ -1372,6 +1394,7 @@ function serializeNodeWithId(n2, options) {
|
|
|
1372
1394
|
blockSelector,
|
|
1373
1395
|
maskTextClass,
|
|
1374
1396
|
maskTextSelector,
|
|
1397
|
+
ignoreAttribute,
|
|
1375
1398
|
skipChild = false,
|
|
1376
1399
|
inlineStylesheet = true,
|
|
1377
1400
|
maskInputOptions = {},
|
|
@@ -1406,6 +1429,7 @@ function serializeNodeWithId(n2, options) {
|
|
|
1406
1429
|
mirror: mirror2,
|
|
1407
1430
|
blockClass,
|
|
1408
1431
|
blockSelector,
|
|
1432
|
+
ignoreAttribute,
|
|
1409
1433
|
needsMask,
|
|
1410
1434
|
inlineStylesheet,
|
|
1411
1435
|
maskInputOptions,
|
|
@@ -1458,6 +1482,7 @@ function serializeNodeWithId(n2, options) {
|
|
|
1458
1482
|
needsMask,
|
|
1459
1483
|
maskTextClass,
|
|
1460
1484
|
maskTextSelector,
|
|
1485
|
+
ignoreAttribute,
|
|
1461
1486
|
skipChild,
|
|
1462
1487
|
inlineStylesheet,
|
|
1463
1488
|
maskInputOptions,
|
|
@@ -1517,6 +1542,7 @@ function serializeNodeWithId(n2, options) {
|
|
|
1517
1542
|
needsMask,
|
|
1518
1543
|
maskTextClass,
|
|
1519
1544
|
maskTextSelector,
|
|
1545
|
+
ignoreAttribute,
|
|
1520
1546
|
skipChild: false,
|
|
1521
1547
|
inlineStylesheet,
|
|
1522
1548
|
maskInputOptions,
|
|
@@ -1558,6 +1584,7 @@ function serializeNodeWithId(n2, options) {
|
|
|
1558
1584
|
needsMask,
|
|
1559
1585
|
maskTextClass,
|
|
1560
1586
|
maskTextSelector,
|
|
1587
|
+
ignoreAttribute,
|
|
1561
1588
|
skipChild: false,
|
|
1562
1589
|
inlineStylesheet,
|
|
1563
1590
|
maskInputOptions,
|
|
@@ -1595,6 +1622,7 @@ function snapshot(n2, options) {
|
|
|
1595
1622
|
blockSelector = null,
|
|
1596
1623
|
maskTextClass = "rr-mask",
|
|
1597
1624
|
maskTextSelector = null,
|
|
1625
|
+
ignoreAttribute = "rr-ignore-attr",
|
|
1598
1626
|
inlineStylesheet = true,
|
|
1599
1627
|
inlineImages = false,
|
|
1600
1628
|
recordCanvas = false,
|
|
@@ -1611,6 +1639,7 @@ function snapshot(n2, options) {
|
|
|
1611
1639
|
stylesheetLoadTimeout,
|
|
1612
1640
|
keepIframeSrcFn = () => false
|
|
1613
1641
|
} = options || {};
|
|
1642
|
+
scheduleInlineEventInspection(n2);
|
|
1614
1643
|
const maskInputOptions = maskAllInputs === true ? {
|
|
1615
1644
|
color: true,
|
|
1616
1645
|
date: true,
|
|
@@ -1654,6 +1683,7 @@ function snapshot(n2, options) {
|
|
|
1654
1683
|
blockSelector,
|
|
1655
1684
|
maskTextClass,
|
|
1656
1685
|
maskTextSelector,
|
|
1686
|
+
ignoreAttribute,
|
|
1657
1687
|
skipChild: false,
|
|
1658
1688
|
inlineStylesheet,
|
|
1659
1689
|
maskInputOptions,
|
|
@@ -5733,30 +5763,6 @@ const interactiveEvents = [
|
|
|
5733
5763
|
"touchend",
|
|
5734
5764
|
"touchcancel"
|
|
5735
5765
|
];
|
|
5736
|
-
const inlineEventAttributes = [
|
|
5737
|
-
"onclick",
|
|
5738
|
-
"ondblclick",
|
|
5739
|
-
"onmousedown",
|
|
5740
|
-
"onmouseup",
|
|
5741
|
-
"onmouseover",
|
|
5742
|
-
"onmouseout",
|
|
5743
|
-
"onmousemove",
|
|
5744
|
-
"onfocus",
|
|
5745
|
-
"onblur",
|
|
5746
|
-
"onkeydown",
|
|
5747
|
-
"onkeypress",
|
|
5748
|
-
"onkeyup",
|
|
5749
|
-
"onchange",
|
|
5750
|
-
"oninput",
|
|
5751
|
-
"onsubmit",
|
|
5752
|
-
"onreset",
|
|
5753
|
-
"onselect",
|
|
5754
|
-
"oncontextmenu",
|
|
5755
|
-
"ontouchstart",
|
|
5756
|
-
"ontouchmove",
|
|
5757
|
-
"ontouchend",
|
|
5758
|
-
"ontouchcancel"
|
|
5759
|
-
];
|
|
5760
5766
|
const interactiveElementsRegistry = /* @__PURE__ */ new WeakSet();
|
|
5761
5767
|
const originalAddEventListener = EventTarget.prototype.addEventListener;
|
|
5762
5768
|
EventTarget.prototype.addEventListener = function(type, listener, options) {
|
|
@@ -5772,21 +5778,6 @@ const originalRemoveEventListener = EventTarget.prototype.removeEventListener;
|
|
|
5772
5778
|
EventTarget.prototype.removeEventListener = function(type, listener, options) {
|
|
5773
5779
|
originalRemoveEventListener.call(this, type, listener, options);
|
|
5774
5780
|
};
|
|
5775
|
-
function inspectInlineEventHandlers() {
|
|
5776
|
-
const allElements = document.querySelectorAll("*");
|
|
5777
|
-
allElements.forEach((el) => {
|
|
5778
|
-
inlineEventAttributes.forEach((attr) => {
|
|
5779
|
-
if (el.hasAttribute(attr)) {
|
|
5780
|
-
interactiveElementsRegistry.add(el);
|
|
5781
|
-
}
|
|
5782
|
-
});
|
|
5783
|
-
});
|
|
5784
|
-
}
|
|
5785
|
-
if (document.readyState === "complete" || document.readyState === "interactive") {
|
|
5786
|
-
inspectInlineEventHandlers();
|
|
5787
|
-
} else {
|
|
5788
|
-
document.addEventListener("DOMContentLoaded", inspectInlineEventHandlers);
|
|
5789
|
-
}
|
|
5790
5781
|
function getDefaultExportFromCjs(x2) {
|
|
5791
5782
|
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
5792
5783
|
}
|
|
@@ -10866,7 +10857,7 @@ let nowTimestamp = Date.now;
|
|
|
10866
10857
|
if (!/* @__PURE__ */ /[1-9][0-9]{12}/.test(Date.now().toString())) {
|
|
10867
10858
|
nowTimestamp = () => (/* @__PURE__ */ new Date()).getTime();
|
|
10868
10859
|
}
|
|
10869
|
-
function getWindowScroll(win) {
|
|
10860
|
+
function getWindowScroll(win = window) {
|
|
10870
10861
|
var _a2, _b2, _c, _d;
|
|
10871
10862
|
const doc = win.document;
|
|
10872
10863
|
return {
|
|
@@ -10874,11 +10865,13 @@ function getWindowScroll(win) {
|
|
|
10874
10865
|
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
|
|
10875
10866
|
};
|
|
10876
10867
|
}
|
|
10877
|
-
function getWindowHeight() {
|
|
10878
|
-
|
|
10868
|
+
function getWindowHeight(win = window) {
|
|
10869
|
+
const doc = win.document;
|
|
10870
|
+
return win.innerHeight || doc.documentElement && doc.documentElement.clientHeight || doc.body && doc.body.clientHeight || 0;
|
|
10879
10871
|
}
|
|
10880
|
-
function getWindowWidth() {
|
|
10881
|
-
|
|
10872
|
+
function getWindowWidth(win = window) {
|
|
10873
|
+
const doc = win.document;
|
|
10874
|
+
return win.innerWidth || doc.documentElement && doc.documentElement.clientWidth || doc.body && doc.body.clientWidth || 0;
|
|
10882
10875
|
}
|
|
10883
10876
|
function closestElementOfNode(node2) {
|
|
10884
10877
|
if (!node2) {
|
|
@@ -11348,6 +11341,7 @@ class MutationBuffer {
|
|
|
11348
11341
|
__publicField(this, "blockSelector");
|
|
11349
11342
|
__publicField(this, "maskTextClass");
|
|
11350
11343
|
__publicField(this, "maskTextSelector");
|
|
11344
|
+
__publicField(this, "ignoreAttribute");
|
|
11351
11345
|
__publicField(this, "inlineStylesheet");
|
|
11352
11346
|
__publicField(this, "maskInputOptions");
|
|
11353
11347
|
__publicField(this, "maskTextFn");
|
|
@@ -11411,6 +11405,7 @@ class MutationBuffer {
|
|
|
11411
11405
|
blockSelector: this.blockSelector,
|
|
11412
11406
|
maskTextClass: this.maskTextClass,
|
|
11413
11407
|
maskTextSelector: this.maskTextSelector,
|
|
11408
|
+
ignoreAttribute: this.ignoreAttribute || "",
|
|
11414
11409
|
skipChild: true,
|
|
11415
11410
|
newlyAddedElement: true,
|
|
11416
11411
|
inlineStylesheet: this.inlineStylesheet,
|
|
@@ -11639,7 +11634,7 @@ class MutationBuffer {
|
|
|
11639
11634
|
if (attributeName === "type" && target.tagName === "INPUT" && (m.oldValue || "").toLowerCase() === "password") {
|
|
11640
11635
|
target.setAttribute("data-rr-is-password", "true");
|
|
11641
11636
|
}
|
|
11642
|
-
if (!
|
|
11637
|
+
if (!isIgnoreAttribute(target.tagName, attributeName)) {
|
|
11643
11638
|
item.attributes[attributeName] = transformAttribute(
|
|
11644
11639
|
this.doc,
|
|
11645
11640
|
toLowerCase(target.tagName),
|
|
@@ -11758,6 +11753,7 @@ class MutationBuffer {
|
|
|
11758
11753
|
"blockSelector",
|
|
11759
11754
|
"maskTextClass",
|
|
11760
11755
|
"maskTextSelector",
|
|
11756
|
+
"ignoreAttribute",
|
|
11761
11757
|
"inlineStylesheet",
|
|
11762
11758
|
"maskInputOptions",
|
|
11763
11759
|
"maskTextFn",
|
|
@@ -13993,6 +13989,7 @@ try {
|
|
|
13993
13989
|
}
|
|
13994
13990
|
const mirror = createMirror$2();
|
|
13995
13991
|
function record(options = {}) {
|
|
13992
|
+
var _a2;
|
|
13996
13993
|
const {
|
|
13997
13994
|
emit,
|
|
13998
13995
|
checkoutEveryNms,
|
|
@@ -14002,6 +13999,7 @@ function record(options = {}) {
|
|
|
14002
13999
|
blockSelector = null,
|
|
14003
14000
|
ignoreClass = "rr-ignore",
|
|
14004
14001
|
ignoreSelector = null,
|
|
14002
|
+
ignoreAttribute = "rr-ignore-attribute",
|
|
14005
14003
|
maskTextClass = "rr-mask",
|
|
14006
14004
|
maskTextSelector = null,
|
|
14007
14005
|
inlineStylesheet = true,
|
|
@@ -14027,12 +14025,24 @@ function record(options = {}) {
|
|
|
14027
14025
|
ignoreCSSAttributes = /* @__PURE__ */ new Set([]),
|
|
14028
14026
|
errorHandler: errorHandler2
|
|
14029
14027
|
} = options;
|
|
14028
|
+
const win = options.customWindow || window;
|
|
14029
|
+
const doc = options.customDocument || document;
|
|
14030
|
+
try {
|
|
14031
|
+
if (Array.from([1], (x2) => x2 * 2)[0] !== 2) {
|
|
14032
|
+
const cleanFrame = doc.createElement("iframe");
|
|
14033
|
+
doc.body.appendChild(cleanFrame);
|
|
14034
|
+
Array.from = ((_a2 = cleanFrame.contentWindow) == null ? void 0 : _a2.Array.from) || Array.from;
|
|
14035
|
+
doc.body.removeChild(cleanFrame);
|
|
14036
|
+
}
|
|
14037
|
+
} catch (err) {
|
|
14038
|
+
console.debug("Unable to override Array.from", err);
|
|
14039
|
+
}
|
|
14030
14040
|
registerErrorHandler(errorHandler2);
|
|
14031
|
-
const inEmittingFrame = recordCrossOriginIframes ?
|
|
14041
|
+
const inEmittingFrame = recordCrossOriginIframes ? win.parent === win : true;
|
|
14032
14042
|
let passEmitsToParent = false;
|
|
14033
14043
|
if (!inEmittingFrame) {
|
|
14034
14044
|
try {
|
|
14035
|
-
if (
|
|
14045
|
+
if (win.parent.document) {
|
|
14036
14046
|
passEmitsToParent = false;
|
|
14037
14047
|
}
|
|
14038
14048
|
} catch (e2) {
|
|
@@ -14099,10 +14109,10 @@ function record(options = {}) {
|
|
|
14099
14109
|
return e2;
|
|
14100
14110
|
};
|
|
14101
14111
|
wrappedEmit = (r2, isCheckout) => {
|
|
14102
|
-
var
|
|
14112
|
+
var _a3;
|
|
14103
14113
|
const e2 = r2;
|
|
14104
14114
|
e2.timestamp = nowTimestamp();
|
|
14105
|
-
if (((
|
|
14115
|
+
if (((_a3 = mutationBuffers[0]) == null ? void 0 : _a3.isFrozen()) && e2.type !== EventType.FullSnapshot && !(e2.type === EventType.IncrementalSnapshot && e2.data.source === IncrementalSource.Mutation)) {
|
|
14106
14116
|
mutationBuffers.forEach((buf) => buf.unfreeze());
|
|
14107
14117
|
}
|
|
14108
14118
|
if (inEmittingFrame) {
|
|
@@ -14111,10 +14121,10 @@ function record(options = {}) {
|
|
|
14111
14121
|
const message = {
|
|
14112
14122
|
type: "rrweb",
|
|
14113
14123
|
event: eventProcessor(e2),
|
|
14114
|
-
origin:
|
|
14124
|
+
origin: win.location.origin,
|
|
14115
14125
|
isCheckout
|
|
14116
14126
|
};
|
|
14117
|
-
|
|
14127
|
+
win.parent.postMessage(message, "*");
|
|
14118
14128
|
}
|
|
14119
14129
|
if (e2.type === EventType.FullSnapshot) {
|
|
14120
14130
|
lastFullSnapshotEvent = e2;
|
|
@@ -14181,7 +14191,7 @@ function record(options = {}) {
|
|
|
14181
14191
|
canvasManager = new CanvasManager({
|
|
14182
14192
|
recordCanvas,
|
|
14183
14193
|
mutationCb: wrappedCanvasMutationEmit,
|
|
14184
|
-
win
|
|
14194
|
+
win,
|
|
14185
14195
|
blockClass,
|
|
14186
14196
|
blockSelector,
|
|
14187
14197
|
mirror,
|
|
@@ -14196,6 +14206,7 @@ function record(options = {}) {
|
|
|
14196
14206
|
blockSelector,
|
|
14197
14207
|
maskTextClass,
|
|
14198
14208
|
maskTextSelector,
|
|
14209
|
+
ignoreAttribute,
|
|
14199
14210
|
inlineStylesheet,
|
|
14200
14211
|
maskInputOptions,
|
|
14201
14212
|
dataURLOptions,
|
|
@@ -14221,9 +14232,9 @@ function record(options = {}) {
|
|
|
14221
14232
|
{
|
|
14222
14233
|
type: EventType.Meta,
|
|
14223
14234
|
data: {
|
|
14224
|
-
href:
|
|
14225
|
-
width: getWindowWidth(),
|
|
14226
|
-
height: getWindowHeight()
|
|
14235
|
+
href: win.location.href,
|
|
14236
|
+
width: getWindowWidth(win),
|
|
14237
|
+
height: getWindowHeight(win)
|
|
14227
14238
|
}
|
|
14228
14239
|
},
|
|
14229
14240
|
isCheckout
|
|
@@ -14231,7 +14242,7 @@ function record(options = {}) {
|
|
|
14231
14242
|
stylesheetManager.reset();
|
|
14232
14243
|
shadowDomManager.init();
|
|
14233
14244
|
mutationBuffers.forEach((buf) => buf.lock());
|
|
14234
|
-
const node2 = snapshot(
|
|
14245
|
+
const node2 = snapshot(doc, {
|
|
14235
14246
|
mirror,
|
|
14236
14247
|
blockClass,
|
|
14237
14248
|
blockSelector,
|
|
@@ -14253,7 +14264,7 @@ function record(options = {}) {
|
|
|
14253
14264
|
stylesheetManager.trackLinkElement(n2);
|
|
14254
14265
|
}
|
|
14255
14266
|
if (hasShadowRoot(n2)) {
|
|
14256
|
-
shadowDomManager.addShadowRoot(index.shadowRoot(n2),
|
|
14267
|
+
shadowDomManager.addShadowRoot(index.shadowRoot(n2), doc);
|
|
14257
14268
|
}
|
|
14258
14269
|
},
|
|
14259
14270
|
onIframeLoad: (iframe, childSn) => {
|
|
@@ -14273,22 +14284,22 @@ function record(options = {}) {
|
|
|
14273
14284
|
type: EventType.FullSnapshot,
|
|
14274
14285
|
data: {
|
|
14275
14286
|
node: node2,
|
|
14276
|
-
initialOffset: getWindowScroll(
|
|
14287
|
+
initialOffset: getWindowScroll(win)
|
|
14277
14288
|
}
|
|
14278
14289
|
},
|
|
14279
14290
|
isCheckout
|
|
14280
14291
|
);
|
|
14281
14292
|
mutationBuffers.forEach((buf) => buf.unlock());
|
|
14282
|
-
if (
|
|
14293
|
+
if (doc.adoptedStyleSheets && doc.adoptedStyleSheets.length > 0)
|
|
14283
14294
|
stylesheetManager.adoptStyleSheets(
|
|
14284
|
-
|
|
14285
|
-
mirror.getId(
|
|
14295
|
+
doc.adoptedStyleSheets,
|
|
14296
|
+
mirror.getId(doc)
|
|
14286
14297
|
);
|
|
14287
14298
|
};
|
|
14288
14299
|
try {
|
|
14289
14300
|
const handlers = [];
|
|
14290
|
-
const observe = (
|
|
14291
|
-
var
|
|
14301
|
+
const observe = (doc2) => {
|
|
14302
|
+
var _a3;
|
|
14292
14303
|
return callbackWrapper(initObservers)(
|
|
14293
14304
|
{
|
|
14294
14305
|
mutationCb: wrappedMutationEmit,
|
|
@@ -14372,6 +14383,7 @@ function record(options = {}) {
|
|
|
14372
14383
|
ignoreSelector,
|
|
14373
14384
|
maskTextClass,
|
|
14374
14385
|
maskTextSelector,
|
|
14386
|
+
ignoreAttribute,
|
|
14375
14387
|
maskInputOptions,
|
|
14376
14388
|
inlineStylesheet,
|
|
14377
14389
|
sampling,
|
|
@@ -14380,7 +14392,7 @@ function record(options = {}) {
|
|
|
14380
14392
|
inlineImages,
|
|
14381
14393
|
userTriggeredOnInput,
|
|
14382
14394
|
collectFonts,
|
|
14383
|
-
doc,
|
|
14395
|
+
doc: doc2,
|
|
14384
14396
|
maskInputFn,
|
|
14385
14397
|
maskTextFn,
|
|
14386
14398
|
keepIframeSrcFn,
|
|
@@ -14394,7 +14406,7 @@ function record(options = {}) {
|
|
|
14394
14406
|
processedNodeManager,
|
|
14395
14407
|
canvasManager,
|
|
14396
14408
|
ignoreCSSAttributes,
|
|
14397
|
-
plugins: ((
|
|
14409
|
+
plugins: ((_a3 = plugins == null ? void 0 : plugins.filter((p) => p.observer)) == null ? void 0 : _a3.map((p) => ({
|
|
14398
14410
|
observer: p.observer,
|
|
14399
14411
|
options: p.options,
|
|
14400
14412
|
callback: (payload) => wrappedEmit({
|
|
@@ -14418,10 +14430,10 @@ function record(options = {}) {
|
|
|
14418
14430
|
});
|
|
14419
14431
|
const init = () => {
|
|
14420
14432
|
takeFullSnapshot$1();
|
|
14421
|
-
handlers.push(observe(
|
|
14433
|
+
handlers.push(observe(doc));
|
|
14422
14434
|
recording = true;
|
|
14423
14435
|
};
|
|
14424
|
-
if (
|
|
14436
|
+
if (doc.readyState === "interactive" || doc.readyState === "complete") {
|
|
14425
14437
|
init();
|
|
14426
14438
|
} else {
|
|
14427
14439
|
handlers.push(
|
|
@@ -14443,7 +14455,7 @@ function record(options = {}) {
|
|
|
14443
14455
|
});
|
|
14444
14456
|
if (recordAfter === "load") init();
|
|
14445
14457
|
},
|
|
14446
|
-
|
|
14458
|
+
win
|
|
14447
14459
|
)
|
|
14448
14460
|
);
|
|
14449
14461
|
}
|