@appsurify-testmap/rrweb-record 2.0.0-alpha.41 → 2.1.0-alpha.2
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 +226 -155
- package/dist/rrweb-record.cjs.map +1 -1
- package/dist/rrweb-record.js +226 -155
- package/dist/rrweb-record.js.map +1 -1
- package/dist/rrweb-record.umd.cjs +226 -155
- 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",
|
|
@@ -654,27 +715,20 @@ const inlineEventAttributes = [
|
|
|
654
715
|
"ontouchcancel"
|
|
655
716
|
];
|
|
656
717
|
const interactiveElementsRegistry$1 = /* @__PURE__ */ new WeakSet();
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
interactiveElementsRegistry$1.add(this);
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
};
|
|
668
|
-
}
|
|
669
|
-
if (typeof Element !== "undefined" && typeof EventTarget !== "undefined") {
|
|
670
|
-
const originalRemoveEventListener = EventTarget.prototype.removeEventListener;
|
|
671
|
-
EventTarget.prototype.removeEventListener = function(type, listener, options) {
|
|
672
|
-
originalRemoveEventListener.call(this, type, listener, options);
|
|
673
|
-
if (this instanceof Element) {
|
|
674
|
-
type.toLowerCase();
|
|
718
|
+
const originalAddEventListener$1 = EventTarget.prototype.addEventListener;
|
|
719
|
+
EventTarget.prototype.addEventListener = function(type, listener, options) {
|
|
720
|
+
originalAddEventListener$1.call(this, type, listener, options);
|
|
721
|
+
if (this instanceof Element) {
|
|
722
|
+
const eventType = type.toLowerCase();
|
|
723
|
+
if (interactiveEvents$1.includes(eventType)) {
|
|
724
|
+
interactiveElementsRegistry$1.add(this);
|
|
675
725
|
}
|
|
676
|
-
}
|
|
677
|
-
}
|
|
726
|
+
}
|
|
727
|
+
};
|
|
728
|
+
const originalRemoveEventListener$1 = EventTarget.prototype.removeEventListener;
|
|
729
|
+
EventTarget.prototype.removeEventListener = function(type, listener, options) {
|
|
730
|
+
originalRemoveEventListener$1.call(this, type, listener, options);
|
|
731
|
+
};
|
|
678
732
|
function hasEventListeners(n2) {
|
|
679
733
|
return n2 instanceof Element && interactiveElementsRegistry$1.has(n2);
|
|
680
734
|
}
|
|
@@ -694,33 +748,20 @@ function isElementInteractive(n2) {
|
|
|
694
748
|
}
|
|
695
749
|
return false;
|
|
696
750
|
}
|
|
697
|
-
function inspectInlineEventHandlers(
|
|
698
|
-
|
|
699
|
-
const allElements = doc.querySelectorAll("*");
|
|
751
|
+
function inspectInlineEventHandlers$1() {
|
|
752
|
+
const allElements = document.querySelectorAll("*");
|
|
700
753
|
allElements.forEach((el) => {
|
|
701
|
-
inlineEventAttributes.forEach((attr) => {
|
|
754
|
+
inlineEventAttributes$1.forEach((attr) => {
|
|
702
755
|
if (el.hasAttribute(attr)) {
|
|
703
756
|
interactiveElementsRegistry$1.add(el);
|
|
704
757
|
}
|
|
705
758
|
});
|
|
706
759
|
});
|
|
707
760
|
}
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
try {
|
|
713
|
-
if (doc.readyState === "complete" || doc.readyState === "interactive") {
|
|
714
|
-
inspectInlineEventHandlers(doc);
|
|
715
|
-
} else {
|
|
716
|
-
doc.addEventListener("DOMContentLoaded", () => inspectInlineEventHandlers(doc), {
|
|
717
|
-
once: true,
|
|
718
|
-
capture: false
|
|
719
|
-
});
|
|
720
|
-
}
|
|
721
|
-
} catch (e2) {
|
|
722
|
-
console.warn("[inlineEventInspection] Failed to inspect document:", e2);
|
|
723
|
-
}
|
|
761
|
+
if (document.readyState === "complete" || document.readyState === "interactive") {
|
|
762
|
+
inspectInlineEventHandlers$1();
|
|
763
|
+
} else {
|
|
764
|
+
document.addEventListener("DOMContentLoaded", inspectInlineEventHandlers$1);
|
|
724
765
|
}
|
|
725
766
|
let _id = 1;
|
|
726
767
|
const tagNameRegex = new RegExp("[^a-z0-9-_:]");
|
|
@@ -1014,6 +1055,7 @@ function serializeNode(n2, options) {
|
|
|
1014
1055
|
childNodes: [],
|
|
1015
1056
|
xPath,
|
|
1016
1057
|
compatMode: n2.compatMode
|
|
1058
|
+
// probably "BackCompat"
|
|
1017
1059
|
};
|
|
1018
1060
|
} else {
|
|
1019
1061
|
return {
|
|
@@ -1308,7 +1350,7 @@ function slimDOMExcluded(sn, slimDOMOptions) {
|
|
|
1308
1350
|
} else if (sn.type === NodeType$3.Element) {
|
|
1309
1351
|
if (slimDOMOptions.script && // script tag
|
|
1310
1352
|
(sn.tagName === "script" || // (module)preload link
|
|
1311
|
-
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
|
|
1312
1354
|
sn.tagName === "link" && sn.attributes.rel === "prefetch" && typeof sn.attributes.href === "string" && extractFileExtension(sn.attributes.href) === "js")) {
|
|
1313
1355
|
return true;
|
|
1314
1356
|
} else if (slimDOMOptions.headFavicon && (sn.tagName === "link" && sn.attributes.rel === "shortcut icon" || sn.tagName === "meta" && (lowerIfExists(sn.attributes.name).match(
|
|
@@ -1570,7 +1612,7 @@ function snapshot(n2, options) {
|
|
|
1570
1612
|
blockSelector = null,
|
|
1571
1613
|
maskTextClass = "rr-mask",
|
|
1572
1614
|
maskTextSelector = null,
|
|
1573
|
-
ignoreAttribute = "rr-ignore
|
|
1615
|
+
ignoreAttribute = "rr-ignore",
|
|
1574
1616
|
inlineStylesheet = true,
|
|
1575
1617
|
inlineImages = false,
|
|
1576
1618
|
recordCanvas = false,
|
|
@@ -1587,7 +1629,6 @@ function snapshot(n2, options) {
|
|
|
1587
1629
|
stylesheetLoadTimeout,
|
|
1588
1630
|
keepIframeSrcFn = () => false
|
|
1589
1631
|
} = options || {};
|
|
1590
|
-
scheduleInlineEventInspection(n2);
|
|
1591
1632
|
const maskInputOptions = maskAllInputs === true ? {
|
|
1592
1633
|
color: true,
|
|
1593
1634
|
date: true,
|
|
@@ -5228,27 +5269,59 @@ const interactiveEvents = [
|
|
|
5228
5269
|
"touchend",
|
|
5229
5270
|
"touchcancel"
|
|
5230
5271
|
];
|
|
5272
|
+
const inlineEventAttributes = [
|
|
5273
|
+
"onclick",
|
|
5274
|
+
"ondblclick",
|
|
5275
|
+
"onmousedown",
|
|
5276
|
+
"onmouseup",
|
|
5277
|
+
"onmouseover",
|
|
5278
|
+
"onmouseout",
|
|
5279
|
+
"onmousemove",
|
|
5280
|
+
"onfocus",
|
|
5281
|
+
"onblur",
|
|
5282
|
+
"onkeydown",
|
|
5283
|
+
"onkeypress",
|
|
5284
|
+
"onkeyup",
|
|
5285
|
+
"onchange",
|
|
5286
|
+
"oninput",
|
|
5287
|
+
"onsubmit",
|
|
5288
|
+
"onreset",
|
|
5289
|
+
"onselect",
|
|
5290
|
+
"oncontextmenu",
|
|
5291
|
+
"ontouchstart",
|
|
5292
|
+
"ontouchmove",
|
|
5293
|
+
"ontouchend",
|
|
5294
|
+
"ontouchcancel"
|
|
5295
|
+
];
|
|
5231
5296
|
const interactiveElementsRegistry = /* @__PURE__ */ new WeakSet();
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
interactiveElementsRegistry.add(this);
|
|
5240
|
-
}
|
|
5297
|
+
const originalAddEventListener = EventTarget.prototype.addEventListener;
|
|
5298
|
+
EventTarget.prototype.addEventListener = function(type, listener, options) {
|
|
5299
|
+
originalAddEventListener.call(this, type, listener, options);
|
|
5300
|
+
if (this instanceof Element) {
|
|
5301
|
+
const eventType = type.toLowerCase();
|
|
5302
|
+
if (interactiveEvents.includes(eventType)) {
|
|
5303
|
+
interactiveElementsRegistry.add(this);
|
|
5241
5304
|
}
|
|
5242
|
-
}
|
|
5305
|
+
}
|
|
5306
|
+
};
|
|
5307
|
+
const originalRemoveEventListener = EventTarget.prototype.removeEventListener;
|
|
5308
|
+
EventTarget.prototype.removeEventListener = function(type, listener, options) {
|
|
5309
|
+
originalRemoveEventListener.call(this, type, listener, options);
|
|
5310
|
+
};
|
|
5311
|
+
function inspectInlineEventHandlers() {
|
|
5312
|
+
const allElements = document.querySelectorAll("*");
|
|
5313
|
+
allElements.forEach((el) => {
|
|
5314
|
+
inlineEventAttributes.forEach((attr) => {
|
|
5315
|
+
if (el.hasAttribute(attr)) {
|
|
5316
|
+
interactiveElementsRegistry.add(el);
|
|
5317
|
+
}
|
|
5318
|
+
});
|
|
5319
|
+
});
|
|
5243
5320
|
}
|
|
5244
|
-
if (
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
if (this instanceof Element) {
|
|
5249
|
-
type.toLowerCase();
|
|
5250
|
-
}
|
|
5251
|
-
};
|
|
5321
|
+
if (document.readyState === "complete" || document.readyState === "interactive") {
|
|
5322
|
+
inspectInlineEventHandlers();
|
|
5323
|
+
} else {
|
|
5324
|
+
document.addEventListener("DOMContentLoaded", inspectInlineEventHandlers);
|
|
5252
5325
|
}
|
|
5253
5326
|
function getDefaultExportFromCjs(x2) {
|
|
5254
5327
|
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
@@ -8984,6 +9057,32 @@ function querySelectorAll(n2, selectors) {
|
|
|
8984
9057
|
function mutationObserverCtor() {
|
|
8985
9058
|
return getUntaintedPrototype("MutationObserver").constructor;
|
|
8986
9059
|
}
|
|
9060
|
+
function patch(source, name, replacement) {
|
|
9061
|
+
try {
|
|
9062
|
+
if (!(name in source)) {
|
|
9063
|
+
return () => {
|
|
9064
|
+
};
|
|
9065
|
+
}
|
|
9066
|
+
const original = source[name];
|
|
9067
|
+
const wrapped = replacement(original);
|
|
9068
|
+
if (typeof wrapped === "function") {
|
|
9069
|
+
wrapped.prototype = wrapped.prototype || {};
|
|
9070
|
+
Object.defineProperties(wrapped, {
|
|
9071
|
+
__rrweb_original__: {
|
|
9072
|
+
enumerable: false,
|
|
9073
|
+
value: original
|
|
9074
|
+
}
|
|
9075
|
+
});
|
|
9076
|
+
}
|
|
9077
|
+
source[name] = wrapped;
|
|
9078
|
+
return () => {
|
|
9079
|
+
source[name] = original;
|
|
9080
|
+
};
|
|
9081
|
+
} catch {
|
|
9082
|
+
return () => {
|
|
9083
|
+
};
|
|
9084
|
+
}
|
|
9085
|
+
}
|
|
8987
9086
|
const index = {
|
|
8988
9087
|
childNodes,
|
|
8989
9088
|
parentNode,
|
|
@@ -8996,7 +9095,8 @@ const index = {
|
|
|
8996
9095
|
shadowRoot,
|
|
8997
9096
|
querySelector,
|
|
8998
9097
|
querySelectorAll,
|
|
8999
|
-
mutationObserver: mutationObserverCtor
|
|
9098
|
+
mutationObserver: mutationObserverCtor,
|
|
9099
|
+
patch
|
|
9000
9100
|
};
|
|
9001
9101
|
function on(type, fn, target = document) {
|
|
9002
9102
|
const options = { capture: true, passive: true };
|
|
@@ -9079,32 +9179,6 @@ function hookSetter(target, key, d, isRevoked, win = window) {
|
|
|
9079
9179
|
);
|
|
9080
9180
|
return () => hookSetter(target, key, original || {}, true);
|
|
9081
9181
|
}
|
|
9082
|
-
function patch(source, name, replacement) {
|
|
9083
|
-
try {
|
|
9084
|
-
if (!(name in source)) {
|
|
9085
|
-
return () => {
|
|
9086
|
-
};
|
|
9087
|
-
}
|
|
9088
|
-
const original = source[name];
|
|
9089
|
-
const wrapped = replacement(original);
|
|
9090
|
-
if (typeof wrapped === "function") {
|
|
9091
|
-
wrapped.prototype = wrapped.prototype || {};
|
|
9092
|
-
Object.defineProperties(wrapped, {
|
|
9093
|
-
__rrweb_original__: {
|
|
9094
|
-
enumerable: false,
|
|
9095
|
-
value: original
|
|
9096
|
-
}
|
|
9097
|
-
});
|
|
9098
|
-
}
|
|
9099
|
-
source[name] = wrapped;
|
|
9100
|
-
return () => {
|
|
9101
|
-
source[name] = original;
|
|
9102
|
-
};
|
|
9103
|
-
} catch {
|
|
9104
|
-
return () => {
|
|
9105
|
-
};
|
|
9106
|
-
}
|
|
9107
|
-
}
|
|
9108
9182
|
let nowTimestamp = Date.now;
|
|
9109
9183
|
if (!/* @__PURE__ */ /[1-9][0-9]{12}/.test(Date.now().toString())) {
|
|
9110
9184
|
nowTimestamp = () => (/* @__PURE__ */ new Date()).getTime();
|
|
@@ -9304,13 +9378,14 @@ var MouseInteractions = /* @__PURE__ */ ((MouseInteractions2) => {
|
|
|
9304
9378
|
MouseInteractions2[MouseInteractions2["MouseUp"] = 0] = "MouseUp";
|
|
9305
9379
|
MouseInteractions2[MouseInteractions2["MouseDown"] = 1] = "MouseDown";
|
|
9306
9380
|
MouseInteractions2[MouseInteractions2["Click"] = 2] = "Click";
|
|
9307
|
-
MouseInteractions2[MouseInteractions2["
|
|
9308
|
-
MouseInteractions2[MouseInteractions2["
|
|
9309
|
-
MouseInteractions2[MouseInteractions2["
|
|
9310
|
-
MouseInteractions2[MouseInteractions2["
|
|
9311
|
-
MouseInteractions2[MouseInteractions2["
|
|
9312
|
-
MouseInteractions2[MouseInteractions2["
|
|
9313
|
-
MouseInteractions2[MouseInteractions2["
|
|
9381
|
+
MouseInteractions2[MouseInteractions2["ContextMenu"] = 3] = "ContextMenu";
|
|
9382
|
+
MouseInteractions2[MouseInteractions2["DblClick"] = 4] = "DblClick";
|
|
9383
|
+
MouseInteractions2[MouseInteractions2["Focus"] = 5] = "Focus";
|
|
9384
|
+
MouseInteractions2[MouseInteractions2["Blur"] = 6] = "Blur";
|
|
9385
|
+
MouseInteractions2[MouseInteractions2["TouchStart"] = 7] = "TouchStart";
|
|
9386
|
+
MouseInteractions2[MouseInteractions2["TouchMove_Departed"] = 8] = "TouchMove_Departed";
|
|
9387
|
+
MouseInteractions2[MouseInteractions2["TouchEnd"] = 9] = "TouchEnd";
|
|
9388
|
+
MouseInteractions2[MouseInteractions2["TouchCancel"] = 10] = "TouchCancel";
|
|
9314
9389
|
return MouseInteractions2;
|
|
9315
9390
|
})(MouseInteractions || {});
|
|
9316
9391
|
var PointerTypes = /* @__PURE__ */ ((PointerTypes2) => {
|
|
@@ -9670,10 +9745,18 @@ class MutationBuffer {
|
|
|
9670
9745
|
this.attributes.push(item);
|
|
9671
9746
|
this.attributeMap.set(textarea, item);
|
|
9672
9747
|
}
|
|
9673
|
-
|
|
9748
|
+
const value = Array.from(
|
|
9674
9749
|
index.childNodes(textarea),
|
|
9675
9750
|
(cn) => index.textContent(cn) || ""
|
|
9676
9751
|
).join("");
|
|
9752
|
+
item.attributes.value = maskInputValue({
|
|
9753
|
+
element: textarea,
|
|
9754
|
+
maskInputOptions: this.maskInputOptions,
|
|
9755
|
+
tagName: textarea.tagName,
|
|
9756
|
+
type: getInputType(textarea),
|
|
9757
|
+
value,
|
|
9758
|
+
maskInputFn: this.maskInputFn
|
|
9759
|
+
});
|
|
9677
9760
|
});
|
|
9678
9761
|
__publicField(this, "processMutation", (m) => {
|
|
9679
9762
|
if (isIgnored(m.target, this.mirror, this.slimDOMOptions)) {
|
|
@@ -12074,7 +12157,6 @@ try {
|
|
|
12074
12157
|
}
|
|
12075
12158
|
const mirror = createMirror$2();
|
|
12076
12159
|
function record(options = {}) {
|
|
12077
|
-
var _a2;
|
|
12078
12160
|
const {
|
|
12079
12161
|
emit,
|
|
12080
12162
|
checkoutEveryNms,
|
|
@@ -12084,7 +12166,7 @@ function record(options = {}) {
|
|
|
12084
12166
|
blockSelector = null,
|
|
12085
12167
|
ignoreClass = "rr-ignore",
|
|
12086
12168
|
ignoreSelector = null,
|
|
12087
|
-
ignoreAttribute = "rr-ignore
|
|
12169
|
+
ignoreAttribute = "rr-ignore",
|
|
12088
12170
|
maskTextClass = "rr-mask",
|
|
12089
12171
|
maskTextSelector = null,
|
|
12090
12172
|
inlineStylesheet = true,
|
|
@@ -12110,24 +12192,12 @@ function record(options = {}) {
|
|
|
12110
12192
|
ignoreCSSAttributes = /* @__PURE__ */ new Set([]),
|
|
12111
12193
|
errorHandler: errorHandler2
|
|
12112
12194
|
} = options;
|
|
12113
|
-
const win = options.customWindow || window;
|
|
12114
|
-
const doc = options.customDocument || document;
|
|
12115
|
-
try {
|
|
12116
|
-
if (Array.from([1], (x2) => x2 * 2)[0] !== 2) {
|
|
12117
|
-
const cleanFrame = doc.createElement("iframe");
|
|
12118
|
-
doc.body.appendChild(cleanFrame);
|
|
12119
|
-
Array.from = ((_a2 = cleanFrame.contentWindow) == null ? void 0 : _a2.Array.from) || Array.from;
|
|
12120
|
-
doc.body.removeChild(cleanFrame);
|
|
12121
|
-
}
|
|
12122
|
-
} catch (err) {
|
|
12123
|
-
console.debug("Unable to override Array.from", err);
|
|
12124
|
-
}
|
|
12125
12195
|
registerErrorHandler(errorHandler2);
|
|
12126
|
-
const inEmittingFrame = recordCrossOriginIframes ?
|
|
12196
|
+
const inEmittingFrame = recordCrossOriginIframes ? window.parent === window : true;
|
|
12127
12197
|
let passEmitsToParent = false;
|
|
12128
12198
|
if (!inEmittingFrame) {
|
|
12129
12199
|
try {
|
|
12130
|
-
if (
|
|
12200
|
+
if (window.parent.document) {
|
|
12131
12201
|
passEmitsToParent = false;
|
|
12132
12202
|
}
|
|
12133
12203
|
} catch (e2) {
|
|
@@ -12194,10 +12264,10 @@ function record(options = {}) {
|
|
|
12194
12264
|
return e2;
|
|
12195
12265
|
};
|
|
12196
12266
|
wrappedEmit = (r2, isCheckout) => {
|
|
12197
|
-
var
|
|
12267
|
+
var _a2;
|
|
12198
12268
|
const e2 = r2;
|
|
12199
12269
|
e2.timestamp = nowTimestamp();
|
|
12200
|
-
if (((
|
|
12270
|
+
if (((_a2 = mutationBuffers[0]) == null ? void 0 : _a2.isFrozen()) && e2.type !== EventType.FullSnapshot && !(e2.type === EventType.IncrementalSnapshot && e2.data.source === IncrementalSource.Mutation)) {
|
|
12201
12271
|
mutationBuffers.forEach((buf) => buf.unfreeze());
|
|
12202
12272
|
}
|
|
12203
12273
|
if (inEmittingFrame) {
|
|
@@ -12206,10 +12276,10 @@ function record(options = {}) {
|
|
|
12206
12276
|
const message = {
|
|
12207
12277
|
type: "rrweb",
|
|
12208
12278
|
event: eventProcessor(e2),
|
|
12209
|
-
origin:
|
|
12279
|
+
origin: window.location.origin,
|
|
12210
12280
|
isCheckout
|
|
12211
12281
|
};
|
|
12212
|
-
|
|
12282
|
+
window.parent.postMessage(message, "*");
|
|
12213
12283
|
}
|
|
12214
12284
|
if (e2.type === EventType.FullSnapshot) {
|
|
12215
12285
|
lastFullSnapshotEvent = e2;
|
|
@@ -12280,7 +12350,7 @@ function record(options = {}) {
|
|
|
12280
12350
|
canvasManager = new CanvasManager({
|
|
12281
12351
|
recordCanvas,
|
|
12282
12352
|
mutationCb: wrappedCanvasMutationEmit,
|
|
12283
|
-
win,
|
|
12353
|
+
win: window,
|
|
12284
12354
|
blockClass,
|
|
12285
12355
|
blockSelector,
|
|
12286
12356
|
mirror,
|
|
@@ -12321,9 +12391,9 @@ function record(options = {}) {
|
|
|
12321
12391
|
{
|
|
12322
12392
|
type: EventType.Meta,
|
|
12323
12393
|
data: {
|
|
12324
|
-
href:
|
|
12325
|
-
width: getWindowWidth(
|
|
12326
|
-
height: getWindowHeight(
|
|
12394
|
+
href: window.location.href,
|
|
12395
|
+
width: getWindowWidth(),
|
|
12396
|
+
height: getWindowHeight()
|
|
12327
12397
|
}
|
|
12328
12398
|
},
|
|
12329
12399
|
isCheckout
|
|
@@ -12331,12 +12401,13 @@ function record(options = {}) {
|
|
|
12331
12401
|
stylesheetManager.reset();
|
|
12332
12402
|
shadowDomManager.init();
|
|
12333
12403
|
mutationBuffers.forEach((buf) => buf.lock());
|
|
12334
|
-
const node2 = snapshot(
|
|
12404
|
+
const node2 = snapshot(document, {
|
|
12335
12405
|
mirror,
|
|
12336
12406
|
blockClass,
|
|
12337
12407
|
blockSelector,
|
|
12338
12408
|
maskTextClass,
|
|
12339
12409
|
maskTextSelector,
|
|
12410
|
+
ignoreAttribute,
|
|
12340
12411
|
inlineStylesheet,
|
|
12341
12412
|
maskAllInputs: maskInputOptions,
|
|
12342
12413
|
maskTextFn,
|
|
@@ -12353,7 +12424,7 @@ function record(options = {}) {
|
|
|
12353
12424
|
stylesheetManager.trackLinkElement(n2);
|
|
12354
12425
|
}
|
|
12355
12426
|
if (hasShadowRoot(n2)) {
|
|
12356
|
-
shadowDomManager.addShadowRoot(index.shadowRoot(n2),
|
|
12427
|
+
shadowDomManager.addShadowRoot(index.shadowRoot(n2), document);
|
|
12357
12428
|
}
|
|
12358
12429
|
},
|
|
12359
12430
|
onIframeLoad: (iframe, childSn) => {
|
|
@@ -12373,22 +12444,22 @@ function record(options = {}) {
|
|
|
12373
12444
|
type: EventType.FullSnapshot,
|
|
12374
12445
|
data: {
|
|
12375
12446
|
node: node2,
|
|
12376
|
-
initialOffset: getWindowScroll(
|
|
12447
|
+
initialOffset: getWindowScroll(window)
|
|
12377
12448
|
}
|
|
12378
12449
|
},
|
|
12379
12450
|
isCheckout
|
|
12380
12451
|
);
|
|
12381
12452
|
mutationBuffers.forEach((buf) => buf.unlock());
|
|
12382
|
-
if (
|
|
12453
|
+
if (document.adoptedStyleSheets && document.adoptedStyleSheets.length > 0)
|
|
12383
12454
|
stylesheetManager.adoptStyleSheets(
|
|
12384
|
-
|
|
12385
|
-
mirror.getId(
|
|
12455
|
+
document.adoptedStyleSheets,
|
|
12456
|
+
mirror.getId(document)
|
|
12386
12457
|
);
|
|
12387
12458
|
};
|
|
12388
12459
|
try {
|
|
12389
12460
|
const handlers = [];
|
|
12390
|
-
const observe = (
|
|
12391
|
-
var
|
|
12461
|
+
const observe = (doc) => {
|
|
12462
|
+
var _a2;
|
|
12392
12463
|
return callbackWrapper(initObservers)(
|
|
12393
12464
|
{
|
|
12394
12465
|
mutationCb: wrappedMutationEmit,
|
|
@@ -12491,7 +12562,7 @@ function record(options = {}) {
|
|
|
12491
12562
|
inlineImages,
|
|
12492
12563
|
userTriggeredOnInput,
|
|
12493
12564
|
collectFonts,
|
|
12494
|
-
doc
|
|
12565
|
+
doc,
|
|
12495
12566
|
maskInputFn,
|
|
12496
12567
|
maskTextFn,
|
|
12497
12568
|
keepIframeSrcFn,
|
|
@@ -12505,7 +12576,7 @@ function record(options = {}) {
|
|
|
12505
12576
|
processedNodeManager,
|
|
12506
12577
|
canvasManager,
|
|
12507
12578
|
ignoreCSSAttributes,
|
|
12508
|
-
plugins: ((
|
|
12579
|
+
plugins: ((_a2 = plugins == null ? void 0 : plugins.filter((p) => p.observer)) == null ? void 0 : _a2.map((p) => ({
|
|
12509
12580
|
observer: p.observer,
|
|
12510
12581
|
options: p.options,
|
|
12511
12582
|
callback: (payload) => wrappedEmit({
|
|
@@ -12529,10 +12600,10 @@ function record(options = {}) {
|
|
|
12529
12600
|
});
|
|
12530
12601
|
const init = () => {
|
|
12531
12602
|
takeFullSnapshot$1();
|
|
12532
|
-
handlers.push(observe(
|
|
12603
|
+
handlers.push(observe(document));
|
|
12533
12604
|
recording = true;
|
|
12534
12605
|
};
|
|
12535
|
-
if (
|
|
12606
|
+
if (document.readyState === "interactive" || document.readyState === "complete") {
|
|
12536
12607
|
init();
|
|
12537
12608
|
} else {
|
|
12538
12609
|
handlers.push(
|
|
@@ -12554,7 +12625,7 @@ function record(options = {}) {
|
|
|
12554
12625
|
});
|
|
12555
12626
|
if (recordAfter === "load") init();
|
|
12556
12627
|
},
|
|
12557
|
-
|
|
12628
|
+
window
|
|
12558
12629
|
)
|
|
12559
12630
|
);
|
|
12560
12631
|
}
|