@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 +117 -107
- package/dist/rrweb.cjs.map +1 -1
- package/dist/rrweb.d.cts +6 -3
- package/dist/rrweb.d.ts +6 -3
- package/dist/rrweb.js +117 -107
- package/dist/rrweb.js.map +1 -1
- package/dist/rrweb.umd.cjs +119 -107
- package/dist/rrweb.umd.cjs.map +3 -3
- package/dist/rrweb.umd.min.cjs +26 -26
- package/dist/rrweb.umd.min.cjs.map +3 -3
- package/package.json +5 -5
package/dist/rrweb.d.cts
CHANGED
|
@@ -79,14 +79,14 @@ declare function getRootShadowHost(n: Node): Node;
|
|
|
79
79
|
|
|
80
80
|
declare function getShadowHost(n: Node): Element | null;
|
|
81
81
|
|
|
82
|
-
declare function getWindowHeight(): number;
|
|
82
|
+
declare function getWindowHeight(win?: Window): number;
|
|
83
83
|
|
|
84
|
-
declare function getWindowScroll(win
|
|
84
|
+
declare function getWindowScroll(win?: Window): {
|
|
85
85
|
left: number;
|
|
86
86
|
top: number;
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
-
declare function getWindowWidth(): number;
|
|
89
|
+
declare function getWindowWidth(win?: Window): number;
|
|
90
90
|
|
|
91
91
|
declare function hasShadowRoot<T extends Node | RRNode>(n: T): n is T & {
|
|
92
92
|
shadowRoot: ShadowRoot;
|
|
@@ -233,6 +233,7 @@ export declare type recordOptions<T> = {
|
|
|
233
233
|
ignoreSelector?: string;
|
|
234
234
|
maskTextClass?: maskTextClass;
|
|
235
235
|
maskTextSelector?: string;
|
|
236
|
+
ignoreAttribute?: string;
|
|
236
237
|
maskAllInputs?: boolean;
|
|
237
238
|
maskInputOptions?: MaskInputOptions;
|
|
238
239
|
maskInputFn?: MaskInputFn;
|
|
@@ -255,6 +256,8 @@ export declare type recordOptions<T> = {
|
|
|
255
256
|
mousemoveWait?: number;
|
|
256
257
|
keepIframeSrcFn?: KeepIframeSrcFn;
|
|
257
258
|
errorHandler?: ErrorHandler;
|
|
259
|
+
customWindow?: Window;
|
|
260
|
+
customDocument?: Document;
|
|
258
261
|
};
|
|
259
262
|
|
|
260
263
|
export declare class Replayer {
|
package/dist/rrweb.d.ts
CHANGED
|
@@ -79,14 +79,14 @@ declare function getRootShadowHost(n: Node): Node;
|
|
|
79
79
|
|
|
80
80
|
declare function getShadowHost(n: Node): Element | null;
|
|
81
81
|
|
|
82
|
-
declare function getWindowHeight(): number;
|
|
82
|
+
declare function getWindowHeight(win?: Window): number;
|
|
83
83
|
|
|
84
|
-
declare function getWindowScroll(win
|
|
84
|
+
declare function getWindowScroll(win?: Window): {
|
|
85
85
|
left: number;
|
|
86
86
|
top: number;
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
-
declare function getWindowWidth(): number;
|
|
89
|
+
declare function getWindowWidth(win?: Window): number;
|
|
90
90
|
|
|
91
91
|
declare function hasShadowRoot<T extends Node | RRNode>(n: T): n is T & {
|
|
92
92
|
shadowRoot: ShadowRoot;
|
|
@@ -233,6 +233,7 @@ export declare type recordOptions<T> = {
|
|
|
233
233
|
ignoreSelector?: string;
|
|
234
234
|
maskTextClass?: maskTextClass;
|
|
235
235
|
maskTextSelector?: string;
|
|
236
|
+
ignoreAttribute?: string;
|
|
236
237
|
maskAllInputs?: boolean;
|
|
237
238
|
maskInputOptions?: MaskInputOptions;
|
|
238
239
|
maskInputFn?: MaskInputFn;
|
|
@@ -255,6 +256,8 @@ export declare type recordOptions<T> = {
|
|
|
255
256
|
mousemoveWait?: number;
|
|
256
257
|
keepIframeSrcFn?: KeepIframeSrcFn;
|
|
257
258
|
errorHandler?: ErrorHandler;
|
|
259
|
+
customWindow?: Window;
|
|
260
|
+
customDocument?: Document;
|
|
258
261
|
};
|
|
259
262
|
|
|
260
263
|
export declare class Replayer {
|
package/dist/rrweb.js
CHANGED
|
@@ -525,7 +525,7 @@ function getXPath(node2) {
|
|
|
525
525
|
return "/html/body";
|
|
526
526
|
}
|
|
527
527
|
const parentNode2 = element.parentNode;
|
|
528
|
-
if (!parentNode2
|
|
528
|
+
if (!parentNode2) {
|
|
529
529
|
return "";
|
|
530
530
|
}
|
|
531
531
|
const siblings = Array.from(parentNode2.children).filter(
|
|
@@ -587,14 +587,19 @@ function isTextVisible(n2) {
|
|
|
587
587
|
return textContent2 !== "";
|
|
588
588
|
}
|
|
589
589
|
function isElementVisible(n2) {
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
const
|
|
594
|
-
|
|
590
|
+
var _a2;
|
|
591
|
+
const win = ((_a2 = n2.ownerDocument) == null ? void 0 : _a2.defaultView) ?? null;
|
|
592
|
+
const style = win ? win.getComputedStyle(n2) : null;
|
|
593
|
+
const isStyleVisible = style != null && style.display !== "none" && style.visibility !== "hidden" && parseFloat(style.opacity) !== 0;
|
|
594
|
+
const rect = n2.getBoundingClientRect();
|
|
595
|
+
const result2 = isStyleVisible && isRectVisible(rect, win);
|
|
596
|
+
return result2;
|
|
595
597
|
}
|
|
596
|
-
function isRectVisible(rect) {
|
|
597
|
-
|
|
598
|
+
function isRectVisible(rect, win) {
|
|
599
|
+
var _a2, _b, _c, _d;
|
|
600
|
+
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;
|
|
601
|
+
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;
|
|
602
|
+
return rect.width > 0 && rect.height > 0 && rect.top >= 0 && rect.left >= 0 && rect.bottom <= height && rect.right <= width;
|
|
598
603
|
}
|
|
599
604
|
const interactiveEvents$1 = [
|
|
600
605
|
"change",
|
|
@@ -634,7 +639,7 @@ const interactiveTags = [
|
|
|
634
639
|
"video",
|
|
635
640
|
"audio"
|
|
636
641
|
];
|
|
637
|
-
const inlineEventAttributes
|
|
642
|
+
const inlineEventAttributes = [
|
|
638
643
|
"onclick",
|
|
639
644
|
"ondblclick",
|
|
640
645
|
"onmousedown",
|
|
@@ -677,7 +682,6 @@ function hasEventListeners(n2) {
|
|
|
677
682
|
return n2 instanceof Element && interactiveElementsRegistry$1.has(n2);
|
|
678
683
|
}
|
|
679
684
|
function isElementInteractive(n2) {
|
|
680
|
-
var _a2;
|
|
681
685
|
if (n2.nodeType === Node.ELEMENT_NODE) {
|
|
682
686
|
const element = n2;
|
|
683
687
|
const tagName = element.tagName.toLowerCase();
|
|
@@ -691,30 +695,35 @@ function isElementInteractive(n2) {
|
|
|
691
695
|
const result2 = hasEventListeners(element) || hasTabIndex || hasRoleInteractive || element instanceof HTMLAnchorElement && element.hasAttribute("href") || element instanceof HTMLButtonElement && !element.disabled;
|
|
692
696
|
return result2;
|
|
693
697
|
}
|
|
694
|
-
if (n2.nodeType === Node.TEXT_NODE) {
|
|
695
|
-
const textNode = n2;
|
|
696
|
-
const parentElement2 = textNode.parentElement;
|
|
697
|
-
if (parentElement2 !== null && interactiveTags.includes(parentElement2.tagName.toLowerCase())) {
|
|
698
|
-
return true;
|
|
699
|
-
}
|
|
700
|
-
return parentElement2 !== null && isElementVisible(parentElement2) && ((_a2 = textNode.textContent) == null ? void 0 : _a2.trim().length) !== 0 && isElementInteractive(parentElement2);
|
|
701
|
-
}
|
|
702
698
|
return false;
|
|
703
699
|
}
|
|
704
|
-
function inspectInlineEventHandlers
|
|
705
|
-
|
|
700
|
+
function inspectInlineEventHandlers(doc) {
|
|
701
|
+
if (!doc || typeof doc.querySelectorAll !== "function") return;
|
|
702
|
+
const allElements = doc.querySelectorAll("*");
|
|
706
703
|
allElements.forEach((el) => {
|
|
707
|
-
inlineEventAttributes
|
|
704
|
+
inlineEventAttributes.forEach((attr) => {
|
|
708
705
|
if (el.hasAttribute(attr)) {
|
|
709
706
|
interactiveElementsRegistry$1.add(el);
|
|
710
707
|
}
|
|
711
708
|
});
|
|
712
709
|
});
|
|
713
710
|
}
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
711
|
+
function scheduleInlineEventInspection(doc) {
|
|
712
|
+
if (!doc || typeof doc.addEventListener !== "function" || typeof doc.querySelectorAll !== "function") {
|
|
713
|
+
return;
|
|
714
|
+
}
|
|
715
|
+
try {
|
|
716
|
+
if (doc.readyState === "complete" || doc.readyState === "interactive") {
|
|
717
|
+
inspectInlineEventHandlers(doc);
|
|
718
|
+
} else {
|
|
719
|
+
doc.addEventListener("DOMContentLoaded", () => inspectInlineEventHandlers(doc), {
|
|
720
|
+
once: true,
|
|
721
|
+
capture: false
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
} catch (e2) {
|
|
725
|
+
console.warn("[inlineEventInspection] Failed to inspect document:", e2);
|
|
726
|
+
}
|
|
718
727
|
}
|
|
719
728
|
let _id = 1;
|
|
720
729
|
const tagNameRegex = new RegExp("[^a-z0-9-_:]");
|
|
@@ -833,9 +842,29 @@ function transformAttribute(doc, tagName, name, value) {
|
|
|
833
842
|
}
|
|
834
843
|
return value;
|
|
835
844
|
}
|
|
836
|
-
function
|
|
845
|
+
function isIgnoreAttribute(tagName, name, _value) {
|
|
837
846
|
return (tagName === "video" || tagName === "audio") && name === "autoplay";
|
|
838
847
|
}
|
|
848
|
+
function cleanAttributes(doc, element, ignoreAttribute) {
|
|
849
|
+
const tagName = getValidTagName$1(element);
|
|
850
|
+
const attributes = {};
|
|
851
|
+
const len = element.attributes.length;
|
|
852
|
+
for (let i2 = 0; i2 < len; i2++) {
|
|
853
|
+
const attr = element.attributes[i2];
|
|
854
|
+
const name = attr.name;
|
|
855
|
+
const value = attr.value;
|
|
856
|
+
const shouldIgnoreByName = typeof ignoreAttribute === "string" ? name === ignoreAttribute : ignoreAttribute.test(name);
|
|
857
|
+
if (!shouldIgnoreByName && !isIgnoreAttribute(tagName, name)) {
|
|
858
|
+
attributes[name] = transformAttribute(
|
|
859
|
+
doc,
|
|
860
|
+
tagName,
|
|
861
|
+
toLowerCase(name),
|
|
862
|
+
value
|
|
863
|
+
);
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
return attributes;
|
|
867
|
+
}
|
|
839
868
|
function _isBlockedElement(element, blockClass, blockSelector) {
|
|
840
869
|
try {
|
|
841
870
|
if (typeof blockClass === "string") {
|
|
@@ -965,6 +994,7 @@ function serializeNode(n2, options) {
|
|
|
965
994
|
mirror: mirror2,
|
|
966
995
|
blockClass,
|
|
967
996
|
blockSelector,
|
|
997
|
+
ignoreAttribute,
|
|
968
998
|
needsMask,
|
|
969
999
|
inlineStylesheet,
|
|
970
1000
|
maskInputOptions = {},
|
|
@@ -1009,6 +1039,7 @@ function serializeNode(n2, options) {
|
|
|
1009
1039
|
doc,
|
|
1010
1040
|
blockClass,
|
|
1011
1041
|
blockSelector,
|
|
1042
|
+
ignoreAttribute,
|
|
1012
1043
|
inlineStylesheet,
|
|
1013
1044
|
maskInputOptions,
|
|
1014
1045
|
maskInputFn,
|
|
@@ -1086,6 +1117,7 @@ function serializeElementNode(n2, options) {
|
|
|
1086
1117
|
doc,
|
|
1087
1118
|
blockClass,
|
|
1088
1119
|
blockSelector,
|
|
1120
|
+
ignoreAttribute,
|
|
1089
1121
|
inlineStylesheet,
|
|
1090
1122
|
maskInputOptions = {},
|
|
1091
1123
|
maskInputFn,
|
|
@@ -1099,19 +1131,7 @@ function serializeElementNode(n2, options) {
|
|
|
1099
1131
|
} = options;
|
|
1100
1132
|
const needBlock = _isBlockedElement(n2, blockClass, blockSelector);
|
|
1101
1133
|
const tagName = getValidTagName$1(n2);
|
|
1102
|
-
let attributes =
|
|
1103
|
-
const len = n2.attributes.length;
|
|
1104
|
-
for (let i2 = 0; i2 < len; i2++) {
|
|
1105
|
-
const attr = n2.attributes[i2];
|
|
1106
|
-
if (!ignoreAttribute(tagName, attr.name, attr.value)) {
|
|
1107
|
-
attributes[attr.name] = transformAttribute(
|
|
1108
|
-
doc,
|
|
1109
|
-
tagName,
|
|
1110
|
-
toLowerCase(attr.name),
|
|
1111
|
-
attr.value
|
|
1112
|
-
);
|
|
1113
|
-
}
|
|
1114
|
-
}
|
|
1134
|
+
let attributes = cleanAttributes(doc, n2, ignoreAttribute);
|
|
1115
1135
|
if (tagName === "link" && inlineStylesheet) {
|
|
1116
1136
|
const stylesheet = Array.from(doc.styleSheets).find((s2) => {
|
|
1117
1137
|
return s2.href === n2.href;
|
|
@@ -1325,6 +1345,7 @@ function serializeNodeWithId(n2, options) {
|
|
|
1325
1345
|
blockSelector,
|
|
1326
1346
|
maskTextClass,
|
|
1327
1347
|
maskTextSelector,
|
|
1348
|
+
ignoreAttribute,
|
|
1328
1349
|
skipChild = false,
|
|
1329
1350
|
inlineStylesheet = true,
|
|
1330
1351
|
maskInputOptions = {},
|
|
@@ -1359,6 +1380,7 @@ function serializeNodeWithId(n2, options) {
|
|
|
1359
1380
|
mirror: mirror2,
|
|
1360
1381
|
blockClass,
|
|
1361
1382
|
blockSelector,
|
|
1383
|
+
ignoreAttribute,
|
|
1362
1384
|
needsMask,
|
|
1363
1385
|
inlineStylesheet,
|
|
1364
1386
|
maskInputOptions,
|
|
@@ -1411,6 +1433,7 @@ function serializeNodeWithId(n2, options) {
|
|
|
1411
1433
|
needsMask,
|
|
1412
1434
|
maskTextClass,
|
|
1413
1435
|
maskTextSelector,
|
|
1436
|
+
ignoreAttribute,
|
|
1414
1437
|
skipChild,
|
|
1415
1438
|
inlineStylesheet,
|
|
1416
1439
|
maskInputOptions,
|
|
@@ -1470,6 +1493,7 @@ function serializeNodeWithId(n2, options) {
|
|
|
1470
1493
|
needsMask,
|
|
1471
1494
|
maskTextClass,
|
|
1472
1495
|
maskTextSelector,
|
|
1496
|
+
ignoreAttribute,
|
|
1473
1497
|
skipChild: false,
|
|
1474
1498
|
inlineStylesheet,
|
|
1475
1499
|
maskInputOptions,
|
|
@@ -1511,6 +1535,7 @@ function serializeNodeWithId(n2, options) {
|
|
|
1511
1535
|
needsMask,
|
|
1512
1536
|
maskTextClass,
|
|
1513
1537
|
maskTextSelector,
|
|
1538
|
+
ignoreAttribute,
|
|
1514
1539
|
skipChild: false,
|
|
1515
1540
|
inlineStylesheet,
|
|
1516
1541
|
maskInputOptions,
|
|
@@ -1548,6 +1573,7 @@ function snapshot(n2, options) {
|
|
|
1548
1573
|
blockSelector = null,
|
|
1549
1574
|
maskTextClass = "rr-mask",
|
|
1550
1575
|
maskTextSelector = null,
|
|
1576
|
+
ignoreAttribute = "rr-ignore-attr",
|
|
1551
1577
|
inlineStylesheet = true,
|
|
1552
1578
|
inlineImages = false,
|
|
1553
1579
|
recordCanvas = false,
|
|
@@ -1564,6 +1590,7 @@ function snapshot(n2, options) {
|
|
|
1564
1590
|
stylesheetLoadTimeout,
|
|
1565
1591
|
keepIframeSrcFn = () => false
|
|
1566
1592
|
} = options || {};
|
|
1593
|
+
scheduleInlineEventInspection(n2);
|
|
1567
1594
|
const maskInputOptions = maskAllInputs === true ? {
|
|
1568
1595
|
color: true,
|
|
1569
1596
|
date: true,
|
|
@@ -1607,6 +1634,7 @@ function snapshot(n2, options) {
|
|
|
1607
1634
|
blockSelector,
|
|
1608
1635
|
maskTextClass,
|
|
1609
1636
|
maskTextSelector,
|
|
1637
|
+
ignoreAttribute,
|
|
1610
1638
|
skipChild: false,
|
|
1611
1639
|
inlineStylesheet,
|
|
1612
1640
|
maskInputOptions,
|
|
@@ -5682,30 +5710,6 @@ const interactiveEvents = [
|
|
|
5682
5710
|
"touchend",
|
|
5683
5711
|
"touchcancel"
|
|
5684
5712
|
];
|
|
5685
|
-
const inlineEventAttributes = [
|
|
5686
|
-
"onclick",
|
|
5687
|
-
"ondblclick",
|
|
5688
|
-
"onmousedown",
|
|
5689
|
-
"onmouseup",
|
|
5690
|
-
"onmouseover",
|
|
5691
|
-
"onmouseout",
|
|
5692
|
-
"onmousemove",
|
|
5693
|
-
"onfocus",
|
|
5694
|
-
"onblur",
|
|
5695
|
-
"onkeydown",
|
|
5696
|
-
"onkeypress",
|
|
5697
|
-
"onkeyup",
|
|
5698
|
-
"onchange",
|
|
5699
|
-
"oninput",
|
|
5700
|
-
"onsubmit",
|
|
5701
|
-
"onreset",
|
|
5702
|
-
"onselect",
|
|
5703
|
-
"oncontextmenu",
|
|
5704
|
-
"ontouchstart",
|
|
5705
|
-
"ontouchmove",
|
|
5706
|
-
"ontouchend",
|
|
5707
|
-
"ontouchcancel"
|
|
5708
|
-
];
|
|
5709
5713
|
const interactiveElementsRegistry = /* @__PURE__ */ new WeakSet();
|
|
5710
5714
|
const originalAddEventListener = EventTarget.prototype.addEventListener;
|
|
5711
5715
|
EventTarget.prototype.addEventListener = function(type, listener, options) {
|
|
@@ -5721,21 +5725,6 @@ const originalRemoveEventListener = EventTarget.prototype.removeEventListener;
|
|
|
5721
5725
|
EventTarget.prototype.removeEventListener = function(type, listener, options) {
|
|
5722
5726
|
originalRemoveEventListener.call(this, type, listener, options);
|
|
5723
5727
|
};
|
|
5724
|
-
function inspectInlineEventHandlers() {
|
|
5725
|
-
const allElements = document.querySelectorAll("*");
|
|
5726
|
-
allElements.forEach((el) => {
|
|
5727
|
-
inlineEventAttributes.forEach((attr) => {
|
|
5728
|
-
if (el.hasAttribute(attr)) {
|
|
5729
|
-
interactiveElementsRegistry.add(el);
|
|
5730
|
-
}
|
|
5731
|
-
});
|
|
5732
|
-
});
|
|
5733
|
-
}
|
|
5734
|
-
if (document.readyState === "complete" || document.readyState === "interactive") {
|
|
5735
|
-
inspectInlineEventHandlers();
|
|
5736
|
-
} else {
|
|
5737
|
-
document.addEventListener("DOMContentLoaded", inspectInlineEventHandlers);
|
|
5738
|
-
}
|
|
5739
5728
|
function getDefaultExportFromCjs(x2) {
|
|
5740
5729
|
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
5741
5730
|
}
|
|
@@ -10811,7 +10800,7 @@ let nowTimestamp = Date.now;
|
|
|
10811
10800
|
if (!/* @__PURE__ */ /[1-9][0-9]{12}/.test(Date.now().toString())) {
|
|
10812
10801
|
nowTimestamp = () => (/* @__PURE__ */ new Date()).getTime();
|
|
10813
10802
|
}
|
|
10814
|
-
function getWindowScroll(win) {
|
|
10803
|
+
function getWindowScroll(win = window) {
|
|
10815
10804
|
var _a2, _b, _c, _d;
|
|
10816
10805
|
const doc = win.document;
|
|
10817
10806
|
return {
|
|
@@ -10819,11 +10808,13 @@ function getWindowScroll(win) {
|
|
|
10819
10808
|
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
|
|
10820
10809
|
};
|
|
10821
10810
|
}
|
|
10822
|
-
function getWindowHeight() {
|
|
10823
|
-
|
|
10811
|
+
function getWindowHeight(win = window) {
|
|
10812
|
+
const doc = win.document;
|
|
10813
|
+
return win.innerHeight || doc.documentElement && doc.documentElement.clientHeight || doc.body && doc.body.clientHeight || 0;
|
|
10824
10814
|
}
|
|
10825
|
-
function getWindowWidth() {
|
|
10826
|
-
|
|
10815
|
+
function getWindowWidth(win = window) {
|
|
10816
|
+
const doc = win.document;
|
|
10817
|
+
return win.innerWidth || doc.documentElement && doc.documentElement.clientWidth || doc.body && doc.body.clientWidth || 0;
|
|
10827
10818
|
}
|
|
10828
10819
|
function closestElementOfNode(node2) {
|
|
10829
10820
|
if (!node2) {
|
|
@@ -11309,6 +11300,7 @@ class MutationBuffer {
|
|
|
11309
11300
|
__publicField(this, "blockSelector");
|
|
11310
11301
|
__publicField(this, "maskTextClass");
|
|
11311
11302
|
__publicField(this, "maskTextSelector");
|
|
11303
|
+
__publicField(this, "ignoreAttribute");
|
|
11312
11304
|
__publicField(this, "inlineStylesheet");
|
|
11313
11305
|
__publicField(this, "maskInputOptions");
|
|
11314
11306
|
__publicField(this, "maskTextFn");
|
|
@@ -11372,6 +11364,7 @@ class MutationBuffer {
|
|
|
11372
11364
|
blockSelector: this.blockSelector,
|
|
11373
11365
|
maskTextClass: this.maskTextClass,
|
|
11374
11366
|
maskTextSelector: this.maskTextSelector,
|
|
11367
|
+
ignoreAttribute: this.ignoreAttribute || "",
|
|
11375
11368
|
skipChild: true,
|
|
11376
11369
|
newlyAddedElement: true,
|
|
11377
11370
|
inlineStylesheet: this.inlineStylesheet,
|
|
@@ -11600,7 +11593,7 @@ class MutationBuffer {
|
|
|
11600
11593
|
if (attributeName === "type" && target.tagName === "INPUT" && (m.oldValue || "").toLowerCase() === "password") {
|
|
11601
11594
|
target.setAttribute("data-rr-is-password", "true");
|
|
11602
11595
|
}
|
|
11603
|
-
if (!
|
|
11596
|
+
if (!isIgnoreAttribute(target.tagName, attributeName)) {
|
|
11604
11597
|
item.attributes[attributeName] = transformAttribute(
|
|
11605
11598
|
this.doc,
|
|
11606
11599
|
toLowerCase(target.tagName),
|
|
@@ -11722,6 +11715,7 @@ class MutationBuffer {
|
|
|
11722
11715
|
"blockSelector",
|
|
11723
11716
|
"maskTextClass",
|
|
11724
11717
|
"maskTextSelector",
|
|
11718
|
+
"ignoreAttribute",
|
|
11725
11719
|
"inlineStylesheet",
|
|
11726
11720
|
"maskInputOptions",
|
|
11727
11721
|
"maskTextFn",
|
|
@@ -13961,6 +13955,7 @@ try {
|
|
|
13961
13955
|
}
|
|
13962
13956
|
const mirror = createMirror$2();
|
|
13963
13957
|
function record(options = {}) {
|
|
13958
|
+
var _a2;
|
|
13964
13959
|
const {
|
|
13965
13960
|
emit,
|
|
13966
13961
|
checkoutEveryNms,
|
|
@@ -13970,6 +13965,7 @@ function record(options = {}) {
|
|
|
13970
13965
|
blockSelector = null,
|
|
13971
13966
|
ignoreClass = "rr-ignore",
|
|
13972
13967
|
ignoreSelector = null,
|
|
13968
|
+
ignoreAttribute = "rr-ignore-attribute",
|
|
13973
13969
|
maskTextClass = "rr-mask",
|
|
13974
13970
|
maskTextSelector = null,
|
|
13975
13971
|
inlineStylesheet = true,
|
|
@@ -13995,12 +13991,24 @@ function record(options = {}) {
|
|
|
13995
13991
|
ignoreCSSAttributes = /* @__PURE__ */ new Set([]),
|
|
13996
13992
|
errorHandler: errorHandler2
|
|
13997
13993
|
} = options;
|
|
13994
|
+
const win = options.customWindow || window;
|
|
13995
|
+
const doc = options.customDocument || document;
|
|
13996
|
+
try {
|
|
13997
|
+
if (Array.from([1], (x2) => x2 * 2)[0] !== 2) {
|
|
13998
|
+
const cleanFrame = doc.createElement("iframe");
|
|
13999
|
+
doc.body.appendChild(cleanFrame);
|
|
14000
|
+
Array.from = ((_a2 = cleanFrame.contentWindow) == null ? void 0 : _a2.Array.from) || Array.from;
|
|
14001
|
+
doc.body.removeChild(cleanFrame);
|
|
14002
|
+
}
|
|
14003
|
+
} catch (err) {
|
|
14004
|
+
console.debug("Unable to override Array.from", err);
|
|
14005
|
+
}
|
|
13998
14006
|
registerErrorHandler(errorHandler2);
|
|
13999
|
-
const inEmittingFrame = recordCrossOriginIframes ?
|
|
14007
|
+
const inEmittingFrame = recordCrossOriginIframes ? win.parent === win : true;
|
|
14000
14008
|
let passEmitsToParent = false;
|
|
14001
14009
|
if (!inEmittingFrame) {
|
|
14002
14010
|
try {
|
|
14003
|
-
if (
|
|
14011
|
+
if (win.parent.document) {
|
|
14004
14012
|
passEmitsToParent = false;
|
|
14005
14013
|
}
|
|
14006
14014
|
} catch (e2) {
|
|
@@ -14067,10 +14075,10 @@ function record(options = {}) {
|
|
|
14067
14075
|
return e2;
|
|
14068
14076
|
};
|
|
14069
14077
|
wrappedEmit = (r2, isCheckout) => {
|
|
14070
|
-
var
|
|
14078
|
+
var _a3;
|
|
14071
14079
|
const e2 = r2;
|
|
14072
14080
|
e2.timestamp = nowTimestamp();
|
|
14073
|
-
if (((
|
|
14081
|
+
if (((_a3 = mutationBuffers[0]) == null ? void 0 : _a3.isFrozen()) && e2.type !== EventType.FullSnapshot && !(e2.type === EventType.IncrementalSnapshot && e2.data.source === IncrementalSource.Mutation)) {
|
|
14074
14082
|
mutationBuffers.forEach((buf) => buf.unfreeze());
|
|
14075
14083
|
}
|
|
14076
14084
|
if (inEmittingFrame) {
|
|
@@ -14079,10 +14087,10 @@ function record(options = {}) {
|
|
|
14079
14087
|
const message = {
|
|
14080
14088
|
type: "rrweb",
|
|
14081
14089
|
event: eventProcessor(e2),
|
|
14082
|
-
origin:
|
|
14090
|
+
origin: win.location.origin,
|
|
14083
14091
|
isCheckout
|
|
14084
14092
|
};
|
|
14085
|
-
|
|
14093
|
+
win.parent.postMessage(message, "*");
|
|
14086
14094
|
}
|
|
14087
14095
|
if (e2.type === EventType.FullSnapshot) {
|
|
14088
14096
|
lastFullSnapshotEvent = e2;
|
|
@@ -14153,7 +14161,7 @@ function record(options = {}) {
|
|
|
14153
14161
|
canvasManager = new CanvasManager({
|
|
14154
14162
|
recordCanvas,
|
|
14155
14163
|
mutationCb: wrappedCanvasMutationEmit,
|
|
14156
|
-
win
|
|
14164
|
+
win,
|
|
14157
14165
|
blockClass,
|
|
14158
14166
|
blockSelector,
|
|
14159
14167
|
mirror,
|
|
@@ -14168,6 +14176,7 @@ function record(options = {}) {
|
|
|
14168
14176
|
blockSelector,
|
|
14169
14177
|
maskTextClass,
|
|
14170
14178
|
maskTextSelector,
|
|
14179
|
+
ignoreAttribute,
|
|
14171
14180
|
inlineStylesheet,
|
|
14172
14181
|
maskInputOptions,
|
|
14173
14182
|
dataURLOptions,
|
|
@@ -14193,9 +14202,9 @@ function record(options = {}) {
|
|
|
14193
14202
|
{
|
|
14194
14203
|
type: EventType.Meta,
|
|
14195
14204
|
data: {
|
|
14196
|
-
href:
|
|
14197
|
-
width: getWindowWidth(),
|
|
14198
|
-
height: getWindowHeight()
|
|
14205
|
+
href: win.location.href,
|
|
14206
|
+
width: getWindowWidth(win),
|
|
14207
|
+
height: getWindowHeight(win)
|
|
14199
14208
|
}
|
|
14200
14209
|
},
|
|
14201
14210
|
isCheckout
|
|
@@ -14203,7 +14212,7 @@ function record(options = {}) {
|
|
|
14203
14212
|
stylesheetManager.reset();
|
|
14204
14213
|
shadowDomManager.init();
|
|
14205
14214
|
mutationBuffers.forEach((buf) => buf.lock());
|
|
14206
|
-
const node2 = snapshot(
|
|
14215
|
+
const node2 = snapshot(doc, {
|
|
14207
14216
|
mirror,
|
|
14208
14217
|
blockClass,
|
|
14209
14218
|
blockSelector,
|
|
@@ -14225,7 +14234,7 @@ function record(options = {}) {
|
|
|
14225
14234
|
stylesheetManager.trackLinkElement(n2);
|
|
14226
14235
|
}
|
|
14227
14236
|
if (hasShadowRoot(n2)) {
|
|
14228
|
-
shadowDomManager.addShadowRoot(index.shadowRoot(n2),
|
|
14237
|
+
shadowDomManager.addShadowRoot(index.shadowRoot(n2), doc);
|
|
14229
14238
|
}
|
|
14230
14239
|
},
|
|
14231
14240
|
onIframeLoad: (iframe, childSn) => {
|
|
@@ -14245,22 +14254,22 @@ function record(options = {}) {
|
|
|
14245
14254
|
type: EventType.FullSnapshot,
|
|
14246
14255
|
data: {
|
|
14247
14256
|
node: node2,
|
|
14248
|
-
initialOffset: getWindowScroll(
|
|
14257
|
+
initialOffset: getWindowScroll(win)
|
|
14249
14258
|
}
|
|
14250
14259
|
},
|
|
14251
14260
|
isCheckout
|
|
14252
14261
|
);
|
|
14253
14262
|
mutationBuffers.forEach((buf) => buf.unlock());
|
|
14254
|
-
if (
|
|
14263
|
+
if (doc.adoptedStyleSheets && doc.adoptedStyleSheets.length > 0)
|
|
14255
14264
|
stylesheetManager.adoptStyleSheets(
|
|
14256
|
-
|
|
14257
|
-
mirror.getId(
|
|
14265
|
+
doc.adoptedStyleSheets,
|
|
14266
|
+
mirror.getId(doc)
|
|
14258
14267
|
);
|
|
14259
14268
|
};
|
|
14260
14269
|
try {
|
|
14261
14270
|
const handlers = [];
|
|
14262
|
-
const observe = (
|
|
14263
|
-
var
|
|
14271
|
+
const observe = (doc2) => {
|
|
14272
|
+
var _a3;
|
|
14264
14273
|
return callbackWrapper(initObservers)(
|
|
14265
14274
|
{
|
|
14266
14275
|
mutationCb: wrappedMutationEmit,
|
|
@@ -14354,6 +14363,7 @@ function record(options = {}) {
|
|
|
14354
14363
|
ignoreSelector,
|
|
14355
14364
|
maskTextClass,
|
|
14356
14365
|
maskTextSelector,
|
|
14366
|
+
ignoreAttribute,
|
|
14357
14367
|
maskInputOptions,
|
|
14358
14368
|
inlineStylesheet,
|
|
14359
14369
|
sampling,
|
|
@@ -14362,7 +14372,7 @@ function record(options = {}) {
|
|
|
14362
14372
|
inlineImages,
|
|
14363
14373
|
userTriggeredOnInput,
|
|
14364
14374
|
collectFonts,
|
|
14365
|
-
doc,
|
|
14375
|
+
doc: doc2,
|
|
14366
14376
|
maskInputFn,
|
|
14367
14377
|
maskTextFn,
|
|
14368
14378
|
keepIframeSrcFn,
|
|
@@ -14376,7 +14386,7 @@ function record(options = {}) {
|
|
|
14376
14386
|
processedNodeManager,
|
|
14377
14387
|
canvasManager,
|
|
14378
14388
|
ignoreCSSAttributes,
|
|
14379
|
-
plugins: ((
|
|
14389
|
+
plugins: ((_a3 = plugins == null ? void 0 : plugins.filter((p) => p.observer)) == null ? void 0 : _a3.map((p) => ({
|
|
14380
14390
|
observer: p.observer,
|
|
14381
14391
|
options: p.options,
|
|
14382
14392
|
callback: (payload) => wrappedEmit({
|
|
@@ -14400,10 +14410,10 @@ function record(options = {}) {
|
|
|
14400
14410
|
});
|
|
14401
14411
|
const init = () => {
|
|
14402
14412
|
takeFullSnapshot$1();
|
|
14403
|
-
handlers.push(observe(
|
|
14413
|
+
handlers.push(observe(doc));
|
|
14404
14414
|
recording = true;
|
|
14405
14415
|
};
|
|
14406
|
-
if (
|
|
14416
|
+
if (doc.readyState === "interactive" || doc.readyState === "complete") {
|
|
14407
14417
|
init();
|
|
14408
14418
|
} else {
|
|
14409
14419
|
handlers.push(
|
|
@@ -14425,7 +14435,7 @@ function record(options = {}) {
|
|
|
14425
14435
|
});
|
|
14426
14436
|
if (recordAfter === "load") init();
|
|
14427
14437
|
},
|
|
14428
|
-
|
|
14438
|
+
win
|
|
14429
14439
|
)
|
|
14430
14440
|
);
|
|
14431
14441
|
}
|