@appsurify-testmap/rrweb-record 2.0.0-alpha.40 → 2.1.0-alpha.1
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-record.cjs +204 -117
- package/dist/rrweb-record.cjs.map +1 -1
- package/dist/rrweb-record.js +204 -117
- package/dist/rrweb-record.js.map +1 -1
- package/dist/rrweb-record.umd.cjs +204 -117
- package/dist/rrweb-record.umd.cjs.map +2 -2
- package/dist/rrweb-record.umd.min.cjs +22 -22
- package/dist/rrweb-record.umd.min.cjs.map +3 -3
- package/package.json +10 -9
package/dist/rrweb-record.cjs
CHANGED
|
@@ -144,6 +144,32 @@ function querySelectorAll$1(n2, selectors) {
|
|
|
144
144
|
function mutationObserverCtor$1() {
|
|
145
145
|
return getUntaintedPrototype$1("MutationObserver").constructor;
|
|
146
146
|
}
|
|
147
|
+
function patch$1(source, name, replacement) {
|
|
148
|
+
try {
|
|
149
|
+
if (!(name in source)) {
|
|
150
|
+
return () => {
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
const original = source[name];
|
|
154
|
+
const wrapped = replacement(original);
|
|
155
|
+
if (typeof wrapped === "function") {
|
|
156
|
+
wrapped.prototype = wrapped.prototype || {};
|
|
157
|
+
Object.defineProperties(wrapped, {
|
|
158
|
+
__rrweb_original__: {
|
|
159
|
+
enumerable: false,
|
|
160
|
+
value: original
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
source[name] = wrapped;
|
|
165
|
+
return () => {
|
|
166
|
+
source[name] = original;
|
|
167
|
+
};
|
|
168
|
+
} catch {
|
|
169
|
+
return () => {
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
}
|
|
147
173
|
const index$1 = {
|
|
148
174
|
childNodes: childNodes$1,
|
|
149
175
|
parentNode: parentNode$1,
|
|
@@ -156,8 +182,12 @@ const index$1 = {
|
|
|
156
182
|
shadowRoot: shadowRoot$1,
|
|
157
183
|
querySelector: querySelector$1,
|
|
158
184
|
querySelectorAll: querySelectorAll$1,
|
|
159
|
-
mutationObserver: mutationObserverCtor$1
|
|
185
|
+
mutationObserver: mutationObserverCtor$1,
|
|
186
|
+
patch: patch$1
|
|
160
187
|
};
|
|
188
|
+
function isElement(n2) {
|
|
189
|
+
return n2.nodeType === n2.ELEMENT_NODE;
|
|
190
|
+
}
|
|
161
191
|
function isShadowRoot(n2) {
|
|
162
192
|
const hostEl = (
|
|
163
193
|
// anchor and textarea elements also have a `host` property
|
|
@@ -422,19 +452,27 @@ function absolutifyURLs(cssText, href) {
|
|
|
422
452
|
}
|
|
423
453
|
);
|
|
424
454
|
}
|
|
425
|
-
function normalizeCssString(cssText) {
|
|
426
|
-
|
|
455
|
+
function normalizeCssString(cssText, _testNoPxNorm = false) {
|
|
456
|
+
if (_testNoPxNorm) {
|
|
457
|
+
return cssText.replace(/(\/\*[^*]*\*\/)|[\s;]/g, "");
|
|
458
|
+
} else {
|
|
459
|
+
return cssText.replace(/(\/\*[^*]*\*\/)|[\s;]/g, "").replace(/0px/g, "0");
|
|
460
|
+
}
|
|
427
461
|
}
|
|
428
|
-
function splitCssText(cssText, style) {
|
|
462
|
+
function splitCssText(cssText, style, _testNoPxNorm = false) {
|
|
429
463
|
const childNodes2 = Array.from(style.childNodes);
|
|
430
464
|
const splits = [];
|
|
431
|
-
let
|
|
465
|
+
let iterCount = 0;
|
|
432
466
|
if (childNodes2.length > 1 && cssText && typeof cssText === "string") {
|
|
433
|
-
let cssTextNorm = normalizeCssString(cssText);
|
|
467
|
+
let cssTextNorm = normalizeCssString(cssText, _testNoPxNorm);
|
|
434
468
|
const normFactor = cssTextNorm.length / cssText.length;
|
|
435
469
|
for (let i2 = 1; i2 < childNodes2.length; i2++) {
|
|
436
470
|
if (childNodes2[i2].textContent && typeof childNodes2[i2].textContent === "string") {
|
|
437
|
-
const textContentNorm = normalizeCssString(
|
|
471
|
+
const textContentNorm = normalizeCssString(
|
|
472
|
+
childNodes2[i2].textContent,
|
|
473
|
+
_testNoPxNorm
|
|
474
|
+
);
|
|
475
|
+
const jLimit = 100;
|
|
438
476
|
let j = 3;
|
|
439
477
|
for (; j < textContentNorm.length; j++) {
|
|
440
478
|
if (
|
|
@@ -447,23 +485,49 @@ function splitCssText(cssText, style) {
|
|
|
447
485
|
break;
|
|
448
486
|
}
|
|
449
487
|
for (; j < textContentNorm.length; j++) {
|
|
450
|
-
|
|
451
|
-
|
|
488
|
+
let startSubstring = textContentNorm.substring(0, j);
|
|
489
|
+
let cssNormSplits = cssTextNorm.split(startSubstring);
|
|
452
490
|
let splitNorm = -1;
|
|
453
|
-
if (
|
|
454
|
-
splitNorm =
|
|
455
|
-
} else if (
|
|
456
|
-
splitNorm = cssTextNorm.indexOf(
|
|
491
|
+
if (cssNormSplits.length === 2) {
|
|
492
|
+
splitNorm = cssNormSplits[0].length;
|
|
493
|
+
} else if (cssNormSplits.length > 2 && cssNormSplits[0] === "" && childNodes2[i2 - 1].textContent !== "") {
|
|
494
|
+
splitNorm = cssTextNorm.indexOf(startSubstring, 1);
|
|
495
|
+
} else if (cssNormSplits.length === 1) {
|
|
496
|
+
startSubstring = startSubstring.substring(
|
|
497
|
+
0,
|
|
498
|
+
startSubstring.length - 1
|
|
499
|
+
);
|
|
500
|
+
cssNormSplits = cssTextNorm.split(startSubstring);
|
|
501
|
+
if (cssNormSplits.length <= 1) {
|
|
502
|
+
splits.push(cssText);
|
|
503
|
+
return splits;
|
|
504
|
+
}
|
|
505
|
+
j = jLimit + 1;
|
|
506
|
+
} else if (j === textContentNorm.length - 1) {
|
|
507
|
+
splitNorm = cssTextNorm.indexOf(startSubstring);
|
|
508
|
+
}
|
|
509
|
+
if (cssNormSplits.length >= 2 && j > jLimit) {
|
|
510
|
+
const prevTextContent = childNodes2[i2 - 1].textContent;
|
|
511
|
+
if (prevTextContent && typeof prevTextContent === "string") {
|
|
512
|
+
const prevMinLength = normalizeCssString(prevTextContent).length;
|
|
513
|
+
splitNorm = cssTextNorm.indexOf(startSubstring, prevMinLength);
|
|
514
|
+
}
|
|
515
|
+
if (splitNorm === -1) {
|
|
516
|
+
splitNorm = cssNormSplits[0].length;
|
|
517
|
+
}
|
|
457
518
|
}
|
|
458
519
|
if (splitNorm !== -1) {
|
|
459
520
|
let k = Math.floor(splitNorm / normFactor);
|
|
460
521
|
for (; k > 0 && k < cssText.length; ) {
|
|
461
|
-
|
|
462
|
-
if (
|
|
522
|
+
iterCount += 1;
|
|
523
|
+
if (iterCount > 50 * childNodes2.length) {
|
|
463
524
|
splits.push(cssText);
|
|
464
525
|
return splits;
|
|
465
526
|
}
|
|
466
|
-
const normPart = normalizeCssString(
|
|
527
|
+
const normPart = normalizeCssString(
|
|
528
|
+
cssText.substring(0, k),
|
|
529
|
+
_testNoPxNorm
|
|
530
|
+
);
|
|
467
531
|
if (normPart.length === splitNorm) {
|
|
468
532
|
splits.push(cssText.substring(0, k));
|
|
469
533
|
cssText = cssText.substring(k);
|
|
@@ -559,9 +623,6 @@ function getXPath(node2) {
|
|
|
559
623
|
}
|
|
560
624
|
return "";
|
|
561
625
|
}
|
|
562
|
-
function isElement(n2) {
|
|
563
|
-
return n2.nodeType === n2.ELEMENT_NODE;
|
|
564
|
-
}
|
|
565
626
|
function isTextVisible(n2) {
|
|
566
627
|
var _a2;
|
|
567
628
|
const parent = index$1.parentNode(n2);
|
|
@@ -582,10 +643,10 @@ function isElementVisible(n2) {
|
|
|
582
643
|
const style = win ? win.getComputedStyle(n2) : null;
|
|
583
644
|
const isStyleVisible = style != null && style.display !== "none" && style.visibility !== "hidden" && parseFloat(style.opacity) !== 0;
|
|
584
645
|
const rect = n2.getBoundingClientRect();
|
|
585
|
-
const result2 = isStyleVisible && isRectVisible(rect
|
|
646
|
+
const result2 = isStyleVisible && isRectVisible(rect);
|
|
586
647
|
return result2;
|
|
587
648
|
}
|
|
588
|
-
function isRectVisible(rect, win) {
|
|
649
|
+
function isRectVisible(rect, win = window) {
|
|
589
650
|
var _a2, _b, _c, _d;
|
|
590
651
|
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;
|
|
591
652
|
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;
|
|
@@ -629,7 +690,7 @@ const interactiveTags = [
|
|
|
629
690
|
"video",
|
|
630
691
|
"audio"
|
|
631
692
|
];
|
|
632
|
-
const inlineEventAttributes = [
|
|
693
|
+
const inlineEventAttributes$1 = [
|
|
633
694
|
"onclick",
|
|
634
695
|
"ondblclick",
|
|
635
696
|
"onmousedown",
|
|
@@ -687,33 +748,20 @@ function isElementInteractive(n2) {
|
|
|
687
748
|
}
|
|
688
749
|
return false;
|
|
689
750
|
}
|
|
690
|
-
function inspectInlineEventHandlers(
|
|
691
|
-
|
|
692
|
-
const allElements = doc.querySelectorAll("*");
|
|
751
|
+
function inspectInlineEventHandlers$1() {
|
|
752
|
+
const allElements = document.querySelectorAll("*");
|
|
693
753
|
allElements.forEach((el) => {
|
|
694
|
-
inlineEventAttributes.forEach((attr) => {
|
|
754
|
+
inlineEventAttributes$1.forEach((attr) => {
|
|
695
755
|
if (el.hasAttribute(attr)) {
|
|
696
756
|
interactiveElementsRegistry$1.add(el);
|
|
697
757
|
}
|
|
698
758
|
});
|
|
699
759
|
});
|
|
700
760
|
}
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
try {
|
|
706
|
-
if (doc.readyState === "complete" || doc.readyState === "interactive") {
|
|
707
|
-
inspectInlineEventHandlers(doc);
|
|
708
|
-
} else {
|
|
709
|
-
doc.addEventListener("DOMContentLoaded", () => inspectInlineEventHandlers(doc), {
|
|
710
|
-
once: true,
|
|
711
|
-
capture: false
|
|
712
|
-
});
|
|
713
|
-
}
|
|
714
|
-
} catch (e2) {
|
|
715
|
-
console.warn("[inlineEventInspection] Failed to inspect document:", e2);
|
|
716
|
-
}
|
|
761
|
+
if (document.readyState === "complete" || document.readyState === "interactive") {
|
|
762
|
+
inspectInlineEventHandlers$1();
|
|
763
|
+
} else {
|
|
764
|
+
document.addEventListener("DOMContentLoaded", inspectInlineEventHandlers$1);
|
|
717
765
|
}
|
|
718
766
|
let _id = 1;
|
|
719
767
|
const tagNameRegex = new RegExp("[^a-z0-9-_:]");
|
|
@@ -1007,6 +1055,7 @@ function serializeNode(n2, options) {
|
|
|
1007
1055
|
childNodes: [],
|
|
1008
1056
|
xPath,
|
|
1009
1057
|
compatMode: n2.compatMode
|
|
1058
|
+
// probably "BackCompat"
|
|
1010
1059
|
};
|
|
1011
1060
|
} else {
|
|
1012
1061
|
return {
|
|
@@ -1301,7 +1350,7 @@ function slimDOMExcluded(sn, slimDOMOptions) {
|
|
|
1301
1350
|
} else if (sn.type === NodeType$3.Element) {
|
|
1302
1351
|
if (slimDOMOptions.script && // script tag
|
|
1303
1352
|
(sn.tagName === "script" || // (module)preload link
|
|
1304
|
-
sn.tagName === "link" && (sn.attributes.rel === "preload"
|
|
1353
|
+
sn.tagName === "link" && (sn.attributes.rel === "preload" && sn.attributes.as === "script" || sn.attributes.rel === "modulepreload") || // prefetch link
|
|
1305
1354
|
sn.tagName === "link" && sn.attributes.rel === "prefetch" && typeof sn.attributes.href === "string" && extractFileExtension(sn.attributes.href) === "js")) {
|
|
1306
1355
|
return true;
|
|
1307
1356
|
} else if (slimDOMOptions.headFavicon && (sn.tagName === "link" && sn.attributes.rel === "shortcut icon" || sn.tagName === "meta" && (lowerIfExists(sn.attributes.name).match(
|
|
@@ -1563,7 +1612,7 @@ function snapshot(n2, options) {
|
|
|
1563
1612
|
blockSelector = null,
|
|
1564
1613
|
maskTextClass = "rr-mask",
|
|
1565
1614
|
maskTextSelector = null,
|
|
1566
|
-
ignoreAttribute = "rr-ignore
|
|
1615
|
+
ignoreAttribute = "rr-ignore",
|
|
1567
1616
|
inlineStylesheet = true,
|
|
1568
1617
|
inlineImages = false,
|
|
1569
1618
|
recordCanvas = false,
|
|
@@ -1580,7 +1629,7 @@ function snapshot(n2, options) {
|
|
|
1580
1629
|
stylesheetLoadTimeout,
|
|
1581
1630
|
keepIframeSrcFn = () => false
|
|
1582
1631
|
} = options || {};
|
|
1583
|
-
|
|
1632
|
+
console.debug(`${Date.now()} [rrweb-snapshot] snapshot:options:`, options);
|
|
1584
1633
|
const maskInputOptions = maskAllInputs === true ? {
|
|
1585
1634
|
color: true,
|
|
1586
1635
|
date: true,
|
|
@@ -5221,6 +5270,30 @@ const interactiveEvents = [
|
|
|
5221
5270
|
"touchend",
|
|
5222
5271
|
"touchcancel"
|
|
5223
5272
|
];
|
|
5273
|
+
const inlineEventAttributes = [
|
|
5274
|
+
"onclick",
|
|
5275
|
+
"ondblclick",
|
|
5276
|
+
"onmousedown",
|
|
5277
|
+
"onmouseup",
|
|
5278
|
+
"onmouseover",
|
|
5279
|
+
"onmouseout",
|
|
5280
|
+
"onmousemove",
|
|
5281
|
+
"onfocus",
|
|
5282
|
+
"onblur",
|
|
5283
|
+
"onkeydown",
|
|
5284
|
+
"onkeypress",
|
|
5285
|
+
"onkeyup",
|
|
5286
|
+
"onchange",
|
|
5287
|
+
"oninput",
|
|
5288
|
+
"onsubmit",
|
|
5289
|
+
"onreset",
|
|
5290
|
+
"onselect",
|
|
5291
|
+
"oncontextmenu",
|
|
5292
|
+
"ontouchstart",
|
|
5293
|
+
"ontouchmove",
|
|
5294
|
+
"ontouchend",
|
|
5295
|
+
"ontouchcancel"
|
|
5296
|
+
];
|
|
5224
5297
|
const interactiveElementsRegistry = /* @__PURE__ */ new WeakSet();
|
|
5225
5298
|
const originalAddEventListener = EventTarget.prototype.addEventListener;
|
|
5226
5299
|
EventTarget.prototype.addEventListener = function(type, listener, options) {
|
|
@@ -5236,6 +5309,21 @@ const originalRemoveEventListener = EventTarget.prototype.removeEventListener;
|
|
|
5236
5309
|
EventTarget.prototype.removeEventListener = function(type, listener, options) {
|
|
5237
5310
|
originalRemoveEventListener.call(this, type, listener, options);
|
|
5238
5311
|
};
|
|
5312
|
+
function inspectInlineEventHandlers() {
|
|
5313
|
+
const allElements = document.querySelectorAll("*");
|
|
5314
|
+
allElements.forEach((el) => {
|
|
5315
|
+
inlineEventAttributes.forEach((attr) => {
|
|
5316
|
+
if (el.hasAttribute(attr)) {
|
|
5317
|
+
interactiveElementsRegistry.add(el);
|
|
5318
|
+
}
|
|
5319
|
+
});
|
|
5320
|
+
});
|
|
5321
|
+
}
|
|
5322
|
+
if (document.readyState === "complete" || document.readyState === "interactive") {
|
|
5323
|
+
inspectInlineEventHandlers();
|
|
5324
|
+
} else {
|
|
5325
|
+
document.addEventListener("DOMContentLoaded", inspectInlineEventHandlers);
|
|
5326
|
+
}
|
|
5239
5327
|
function getDefaultExportFromCjs(x2) {
|
|
5240
5328
|
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
5241
5329
|
}
|
|
@@ -8970,6 +9058,32 @@ function querySelectorAll(n2, selectors) {
|
|
|
8970
9058
|
function mutationObserverCtor() {
|
|
8971
9059
|
return getUntaintedPrototype("MutationObserver").constructor;
|
|
8972
9060
|
}
|
|
9061
|
+
function patch(source, name, replacement) {
|
|
9062
|
+
try {
|
|
9063
|
+
if (!(name in source)) {
|
|
9064
|
+
return () => {
|
|
9065
|
+
};
|
|
9066
|
+
}
|
|
9067
|
+
const original = source[name];
|
|
9068
|
+
const wrapped = replacement(original);
|
|
9069
|
+
if (typeof wrapped === "function") {
|
|
9070
|
+
wrapped.prototype = wrapped.prototype || {};
|
|
9071
|
+
Object.defineProperties(wrapped, {
|
|
9072
|
+
__rrweb_original__: {
|
|
9073
|
+
enumerable: false,
|
|
9074
|
+
value: original
|
|
9075
|
+
}
|
|
9076
|
+
});
|
|
9077
|
+
}
|
|
9078
|
+
source[name] = wrapped;
|
|
9079
|
+
return () => {
|
|
9080
|
+
source[name] = original;
|
|
9081
|
+
};
|
|
9082
|
+
} catch {
|
|
9083
|
+
return () => {
|
|
9084
|
+
};
|
|
9085
|
+
}
|
|
9086
|
+
}
|
|
8973
9087
|
const index = {
|
|
8974
9088
|
childNodes,
|
|
8975
9089
|
parentNode,
|
|
@@ -8982,7 +9096,8 @@ const index = {
|
|
|
8982
9096
|
shadowRoot,
|
|
8983
9097
|
querySelector,
|
|
8984
9098
|
querySelectorAll,
|
|
8985
|
-
mutationObserver: mutationObserverCtor
|
|
9099
|
+
mutationObserver: mutationObserverCtor,
|
|
9100
|
+
patch
|
|
8986
9101
|
};
|
|
8987
9102
|
function on(type, fn, target = document) {
|
|
8988
9103
|
const options = { capture: true, passive: true };
|
|
@@ -9065,32 +9180,6 @@ function hookSetter(target, key, d, isRevoked, win = window) {
|
|
|
9065
9180
|
);
|
|
9066
9181
|
return () => hookSetter(target, key, original || {}, true);
|
|
9067
9182
|
}
|
|
9068
|
-
function patch(source, name, replacement) {
|
|
9069
|
-
try {
|
|
9070
|
-
if (!(name in source)) {
|
|
9071
|
-
return () => {
|
|
9072
|
-
};
|
|
9073
|
-
}
|
|
9074
|
-
const original = source[name];
|
|
9075
|
-
const wrapped = replacement(original);
|
|
9076
|
-
if (typeof wrapped === "function") {
|
|
9077
|
-
wrapped.prototype = wrapped.prototype || {};
|
|
9078
|
-
Object.defineProperties(wrapped, {
|
|
9079
|
-
__rrweb_original__: {
|
|
9080
|
-
enumerable: false,
|
|
9081
|
-
value: original
|
|
9082
|
-
}
|
|
9083
|
-
});
|
|
9084
|
-
}
|
|
9085
|
-
source[name] = wrapped;
|
|
9086
|
-
return () => {
|
|
9087
|
-
source[name] = original;
|
|
9088
|
-
};
|
|
9089
|
-
} catch {
|
|
9090
|
-
return () => {
|
|
9091
|
-
};
|
|
9092
|
-
}
|
|
9093
|
-
}
|
|
9094
9183
|
let nowTimestamp = Date.now;
|
|
9095
9184
|
if (!/* @__PURE__ */ /[1-9][0-9]{12}/.test(Date.now().toString())) {
|
|
9096
9185
|
nowTimestamp = () => (/* @__PURE__ */ new Date()).getTime();
|
|
@@ -9290,13 +9379,14 @@ var MouseInteractions = /* @__PURE__ */ ((MouseInteractions2) => {
|
|
|
9290
9379
|
MouseInteractions2[MouseInteractions2["MouseUp"] = 0] = "MouseUp";
|
|
9291
9380
|
MouseInteractions2[MouseInteractions2["MouseDown"] = 1] = "MouseDown";
|
|
9292
9381
|
MouseInteractions2[MouseInteractions2["Click"] = 2] = "Click";
|
|
9293
|
-
MouseInteractions2[MouseInteractions2["
|
|
9294
|
-
MouseInteractions2[MouseInteractions2["
|
|
9295
|
-
MouseInteractions2[MouseInteractions2["
|
|
9296
|
-
MouseInteractions2[MouseInteractions2["
|
|
9297
|
-
MouseInteractions2[MouseInteractions2["
|
|
9298
|
-
MouseInteractions2[MouseInteractions2["
|
|
9299
|
-
MouseInteractions2[MouseInteractions2["
|
|
9382
|
+
MouseInteractions2[MouseInteractions2["ContextMenu"] = 3] = "ContextMenu";
|
|
9383
|
+
MouseInteractions2[MouseInteractions2["DblClick"] = 4] = "DblClick";
|
|
9384
|
+
MouseInteractions2[MouseInteractions2["Focus"] = 5] = "Focus";
|
|
9385
|
+
MouseInteractions2[MouseInteractions2["Blur"] = 6] = "Blur";
|
|
9386
|
+
MouseInteractions2[MouseInteractions2["TouchStart"] = 7] = "TouchStart";
|
|
9387
|
+
MouseInteractions2[MouseInteractions2["TouchMove_Departed"] = 8] = "TouchMove_Departed";
|
|
9388
|
+
MouseInteractions2[MouseInteractions2["TouchEnd"] = 9] = "TouchEnd";
|
|
9389
|
+
MouseInteractions2[MouseInteractions2["TouchCancel"] = 10] = "TouchCancel";
|
|
9300
9390
|
return MouseInteractions2;
|
|
9301
9391
|
})(MouseInteractions || {});
|
|
9302
9392
|
var PointerTypes = /* @__PURE__ */ ((PointerTypes2) => {
|
|
@@ -9656,10 +9746,18 @@ class MutationBuffer {
|
|
|
9656
9746
|
this.attributes.push(item);
|
|
9657
9747
|
this.attributeMap.set(textarea, item);
|
|
9658
9748
|
}
|
|
9659
|
-
|
|
9749
|
+
const value = Array.from(
|
|
9660
9750
|
index.childNodes(textarea),
|
|
9661
9751
|
(cn) => index.textContent(cn) || ""
|
|
9662
9752
|
).join("");
|
|
9753
|
+
item.attributes.value = maskInputValue({
|
|
9754
|
+
element: textarea,
|
|
9755
|
+
maskInputOptions: this.maskInputOptions,
|
|
9756
|
+
tagName: textarea.tagName,
|
|
9757
|
+
type: getInputType(textarea),
|
|
9758
|
+
value,
|
|
9759
|
+
maskInputFn: this.maskInputFn
|
|
9760
|
+
});
|
|
9663
9761
|
});
|
|
9664
9762
|
__publicField(this, "processMutation", (m) => {
|
|
9665
9763
|
if (isIgnored(m.target, this.mirror, this.slimDOMOptions)) {
|
|
@@ -12060,7 +12158,6 @@ try {
|
|
|
12060
12158
|
}
|
|
12061
12159
|
const mirror = createMirror$2();
|
|
12062
12160
|
function record(options = {}) {
|
|
12063
|
-
var _a2;
|
|
12064
12161
|
const {
|
|
12065
12162
|
emit,
|
|
12066
12163
|
checkoutEveryNms,
|
|
@@ -12070,7 +12167,7 @@ function record(options = {}) {
|
|
|
12070
12167
|
blockSelector = null,
|
|
12071
12168
|
ignoreClass = "rr-ignore",
|
|
12072
12169
|
ignoreSelector = null,
|
|
12073
|
-
ignoreAttribute = "rr-ignore
|
|
12170
|
+
ignoreAttribute = "rr-ignore",
|
|
12074
12171
|
maskTextClass = "rr-mask",
|
|
12075
12172
|
maskTextSelector = null,
|
|
12076
12173
|
inlineStylesheet = true,
|
|
@@ -12096,24 +12193,13 @@ function record(options = {}) {
|
|
|
12096
12193
|
ignoreCSSAttributes = /* @__PURE__ */ new Set([]),
|
|
12097
12194
|
errorHandler: errorHandler2
|
|
12098
12195
|
} = options;
|
|
12099
|
-
|
|
12100
|
-
const doc = options.customDocument || document;
|
|
12101
|
-
try {
|
|
12102
|
-
if (Array.from([1], (x2) => x2 * 2)[0] !== 2) {
|
|
12103
|
-
const cleanFrame = doc.createElement("iframe");
|
|
12104
|
-
doc.body.appendChild(cleanFrame);
|
|
12105
|
-
Array.from = ((_a2 = cleanFrame.contentWindow) == null ? void 0 : _a2.Array.from) || Array.from;
|
|
12106
|
-
doc.body.removeChild(cleanFrame);
|
|
12107
|
-
}
|
|
12108
|
-
} catch (err) {
|
|
12109
|
-
console.debug("Unable to override Array.from", err);
|
|
12110
|
-
}
|
|
12196
|
+
console.debug(`${Date.now()} [rrweb] record:options:`, options);
|
|
12111
12197
|
registerErrorHandler(errorHandler2);
|
|
12112
|
-
const inEmittingFrame = recordCrossOriginIframes ?
|
|
12198
|
+
const inEmittingFrame = recordCrossOriginIframes ? window.parent === window : true;
|
|
12113
12199
|
let passEmitsToParent = false;
|
|
12114
12200
|
if (!inEmittingFrame) {
|
|
12115
12201
|
try {
|
|
12116
|
-
if (
|
|
12202
|
+
if (window.parent.document) {
|
|
12117
12203
|
passEmitsToParent = false;
|
|
12118
12204
|
}
|
|
12119
12205
|
} catch (e2) {
|
|
@@ -12180,10 +12266,10 @@ function record(options = {}) {
|
|
|
12180
12266
|
return e2;
|
|
12181
12267
|
};
|
|
12182
12268
|
wrappedEmit = (r2, isCheckout) => {
|
|
12183
|
-
var
|
|
12269
|
+
var _a2;
|
|
12184
12270
|
const e2 = r2;
|
|
12185
12271
|
e2.timestamp = nowTimestamp();
|
|
12186
|
-
if (((
|
|
12272
|
+
if (((_a2 = mutationBuffers[0]) == null ? void 0 : _a2.isFrozen()) && e2.type !== EventType.FullSnapshot && !(e2.type === EventType.IncrementalSnapshot && e2.data.source === IncrementalSource.Mutation)) {
|
|
12187
12273
|
mutationBuffers.forEach((buf) => buf.unfreeze());
|
|
12188
12274
|
}
|
|
12189
12275
|
if (inEmittingFrame) {
|
|
@@ -12192,10 +12278,10 @@ function record(options = {}) {
|
|
|
12192
12278
|
const message = {
|
|
12193
12279
|
type: "rrweb",
|
|
12194
12280
|
event: eventProcessor(e2),
|
|
12195
|
-
origin:
|
|
12281
|
+
origin: window.location.origin,
|
|
12196
12282
|
isCheckout
|
|
12197
12283
|
};
|
|
12198
|
-
|
|
12284
|
+
window.parent.postMessage(message, "*");
|
|
12199
12285
|
}
|
|
12200
12286
|
if (e2.type === EventType.FullSnapshot) {
|
|
12201
12287
|
lastFullSnapshotEvent = e2;
|
|
@@ -12266,7 +12352,7 @@ function record(options = {}) {
|
|
|
12266
12352
|
canvasManager = new CanvasManager({
|
|
12267
12353
|
recordCanvas,
|
|
12268
12354
|
mutationCb: wrappedCanvasMutationEmit,
|
|
12269
|
-
win,
|
|
12355
|
+
win: window,
|
|
12270
12356
|
blockClass,
|
|
12271
12357
|
blockSelector,
|
|
12272
12358
|
mirror,
|
|
@@ -12307,9 +12393,9 @@ function record(options = {}) {
|
|
|
12307
12393
|
{
|
|
12308
12394
|
type: EventType.Meta,
|
|
12309
12395
|
data: {
|
|
12310
|
-
href:
|
|
12311
|
-
width: getWindowWidth(
|
|
12312
|
-
height: getWindowHeight(
|
|
12396
|
+
href: window.location.href,
|
|
12397
|
+
width: getWindowWidth(),
|
|
12398
|
+
height: getWindowHeight()
|
|
12313
12399
|
}
|
|
12314
12400
|
},
|
|
12315
12401
|
isCheckout
|
|
@@ -12317,12 +12403,13 @@ function record(options = {}) {
|
|
|
12317
12403
|
stylesheetManager.reset();
|
|
12318
12404
|
shadowDomManager.init();
|
|
12319
12405
|
mutationBuffers.forEach((buf) => buf.lock());
|
|
12320
|
-
const node2 = snapshot(
|
|
12406
|
+
const node2 = snapshot(document, {
|
|
12321
12407
|
mirror,
|
|
12322
12408
|
blockClass,
|
|
12323
12409
|
blockSelector,
|
|
12324
12410
|
maskTextClass,
|
|
12325
12411
|
maskTextSelector,
|
|
12412
|
+
ignoreAttribute,
|
|
12326
12413
|
inlineStylesheet,
|
|
12327
12414
|
maskAllInputs: maskInputOptions,
|
|
12328
12415
|
maskTextFn,
|
|
@@ -12339,7 +12426,7 @@ function record(options = {}) {
|
|
|
12339
12426
|
stylesheetManager.trackLinkElement(n2);
|
|
12340
12427
|
}
|
|
12341
12428
|
if (hasShadowRoot(n2)) {
|
|
12342
|
-
shadowDomManager.addShadowRoot(index.shadowRoot(n2),
|
|
12429
|
+
shadowDomManager.addShadowRoot(index.shadowRoot(n2), document);
|
|
12343
12430
|
}
|
|
12344
12431
|
},
|
|
12345
12432
|
onIframeLoad: (iframe, childSn) => {
|
|
@@ -12359,22 +12446,22 @@ function record(options = {}) {
|
|
|
12359
12446
|
type: EventType.FullSnapshot,
|
|
12360
12447
|
data: {
|
|
12361
12448
|
node: node2,
|
|
12362
|
-
initialOffset: getWindowScroll(
|
|
12449
|
+
initialOffset: getWindowScroll(window)
|
|
12363
12450
|
}
|
|
12364
12451
|
},
|
|
12365
12452
|
isCheckout
|
|
12366
12453
|
);
|
|
12367
12454
|
mutationBuffers.forEach((buf) => buf.unlock());
|
|
12368
|
-
if (
|
|
12455
|
+
if (document.adoptedStyleSheets && document.adoptedStyleSheets.length > 0)
|
|
12369
12456
|
stylesheetManager.adoptStyleSheets(
|
|
12370
|
-
|
|
12371
|
-
mirror.getId(
|
|
12457
|
+
document.adoptedStyleSheets,
|
|
12458
|
+
mirror.getId(document)
|
|
12372
12459
|
);
|
|
12373
12460
|
};
|
|
12374
12461
|
try {
|
|
12375
12462
|
const handlers = [];
|
|
12376
|
-
const observe = (
|
|
12377
|
-
var
|
|
12463
|
+
const observe = (doc) => {
|
|
12464
|
+
var _a2;
|
|
12378
12465
|
return callbackWrapper(initObservers)(
|
|
12379
12466
|
{
|
|
12380
12467
|
mutationCb: wrappedMutationEmit,
|
|
@@ -12477,7 +12564,7 @@ function record(options = {}) {
|
|
|
12477
12564
|
inlineImages,
|
|
12478
12565
|
userTriggeredOnInput,
|
|
12479
12566
|
collectFonts,
|
|
12480
|
-
doc
|
|
12567
|
+
doc,
|
|
12481
12568
|
maskInputFn,
|
|
12482
12569
|
maskTextFn,
|
|
12483
12570
|
keepIframeSrcFn,
|
|
@@ -12491,7 +12578,7 @@ function record(options = {}) {
|
|
|
12491
12578
|
processedNodeManager,
|
|
12492
12579
|
canvasManager,
|
|
12493
12580
|
ignoreCSSAttributes,
|
|
12494
|
-
plugins: ((
|
|
12581
|
+
plugins: ((_a2 = plugins == null ? void 0 : plugins.filter((p) => p.observer)) == null ? void 0 : _a2.map((p) => ({
|
|
12495
12582
|
observer: p.observer,
|
|
12496
12583
|
options: p.options,
|
|
12497
12584
|
callback: (payload) => wrappedEmit({
|
|
@@ -12515,10 +12602,10 @@ function record(options = {}) {
|
|
|
12515
12602
|
});
|
|
12516
12603
|
const init = () => {
|
|
12517
12604
|
takeFullSnapshot$1();
|
|
12518
|
-
handlers.push(observe(
|
|
12605
|
+
handlers.push(observe(document));
|
|
12519
12606
|
recording = true;
|
|
12520
12607
|
};
|
|
12521
|
-
if (
|
|
12608
|
+
if (document.readyState === "interactive" || document.readyState === "complete") {
|
|
12522
12609
|
init();
|
|
12523
12610
|
} else {
|
|
12524
12611
|
handlers.push(
|
|
@@ -12540,7 +12627,7 @@ function record(options = {}) {
|
|
|
12540
12627
|
});
|
|
12541
12628
|
if (recordAfter === "load") init();
|
|
12542
12629
|
},
|
|
12543
|
-
|
|
12630
|
+
window
|
|
12544
12631
|
)
|
|
12545
12632
|
);
|
|
12546
12633
|
}
|