@appsurify-testmap/rrweb-all 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-all.cjs +269 -166
- package/dist/rrweb-all.cjs.map +1 -1
- package/dist/rrweb-all.js +269 -166
- package/dist/rrweb-all.js.map +1 -1
- package/dist/rrweb-all.umd.cjs +269 -166
- package/dist/rrweb-all.umd.cjs.map +3 -3
- package/dist/rrweb-all.umd.min.cjs +26 -26
- package/dist/rrweb-all.umd.min.cjs.map +3 -3
- package/package.json +5 -6
package/dist/rrweb-all.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
|
|
@@ -434,19 +464,27 @@ function absolutifyURLs(cssText, href) {
|
|
|
434
464
|
}
|
|
435
465
|
);
|
|
436
466
|
}
|
|
437
|
-
function normalizeCssString(cssText) {
|
|
438
|
-
|
|
467
|
+
function normalizeCssString(cssText, _testNoPxNorm = false) {
|
|
468
|
+
if (_testNoPxNorm) {
|
|
469
|
+
return cssText.replace(/(\/\*[^*]*\*\/)|[\s;]/g, "");
|
|
470
|
+
} else {
|
|
471
|
+
return cssText.replace(/(\/\*[^*]*\*\/)|[\s;]/g, "").replace(/0px/g, "0");
|
|
472
|
+
}
|
|
439
473
|
}
|
|
440
|
-
function splitCssText(cssText, style) {
|
|
474
|
+
function splitCssText(cssText, style, _testNoPxNorm = false) {
|
|
441
475
|
const childNodes2 = Array.from(style.childNodes);
|
|
442
476
|
const splits = [];
|
|
443
|
-
let
|
|
477
|
+
let iterCount = 0;
|
|
444
478
|
if (childNodes2.length > 1 && cssText && typeof cssText === "string") {
|
|
445
|
-
let cssTextNorm = normalizeCssString(cssText);
|
|
479
|
+
let cssTextNorm = normalizeCssString(cssText, _testNoPxNorm);
|
|
446
480
|
const normFactor = cssTextNorm.length / cssText.length;
|
|
447
481
|
for (let i2 = 1; i2 < childNodes2.length; i2++) {
|
|
448
482
|
if (childNodes2[i2].textContent && typeof childNodes2[i2].textContent === "string") {
|
|
449
|
-
const textContentNorm = normalizeCssString(
|
|
483
|
+
const textContentNorm = normalizeCssString(
|
|
484
|
+
childNodes2[i2].textContent,
|
|
485
|
+
_testNoPxNorm
|
|
486
|
+
);
|
|
487
|
+
const jLimit = 100;
|
|
450
488
|
let j = 3;
|
|
451
489
|
for (; j < textContentNorm.length; j++) {
|
|
452
490
|
if (
|
|
@@ -459,23 +497,49 @@ function splitCssText(cssText, style) {
|
|
|
459
497
|
break;
|
|
460
498
|
}
|
|
461
499
|
for (; j < textContentNorm.length; j++) {
|
|
462
|
-
|
|
463
|
-
|
|
500
|
+
let startSubstring = textContentNorm.substring(0, j);
|
|
501
|
+
let cssNormSplits = cssTextNorm.split(startSubstring);
|
|
464
502
|
let splitNorm = -1;
|
|
465
|
-
if (
|
|
466
|
-
splitNorm =
|
|
467
|
-
} else if (
|
|
468
|
-
splitNorm = cssTextNorm.indexOf(
|
|
503
|
+
if (cssNormSplits.length === 2) {
|
|
504
|
+
splitNorm = cssNormSplits[0].length;
|
|
505
|
+
} else if (cssNormSplits.length > 2 && cssNormSplits[0] === "" && childNodes2[i2 - 1].textContent !== "") {
|
|
506
|
+
splitNorm = cssTextNorm.indexOf(startSubstring, 1);
|
|
507
|
+
} else if (cssNormSplits.length === 1) {
|
|
508
|
+
startSubstring = startSubstring.substring(
|
|
509
|
+
0,
|
|
510
|
+
startSubstring.length - 1
|
|
511
|
+
);
|
|
512
|
+
cssNormSplits = cssTextNorm.split(startSubstring);
|
|
513
|
+
if (cssNormSplits.length <= 1) {
|
|
514
|
+
splits.push(cssText);
|
|
515
|
+
return splits;
|
|
516
|
+
}
|
|
517
|
+
j = jLimit + 1;
|
|
518
|
+
} else if (j === textContentNorm.length - 1) {
|
|
519
|
+
splitNorm = cssTextNorm.indexOf(startSubstring);
|
|
520
|
+
}
|
|
521
|
+
if (cssNormSplits.length >= 2 && j > jLimit) {
|
|
522
|
+
const prevTextContent = childNodes2[i2 - 1].textContent;
|
|
523
|
+
if (prevTextContent && typeof prevTextContent === "string") {
|
|
524
|
+
const prevMinLength = normalizeCssString(prevTextContent).length;
|
|
525
|
+
splitNorm = cssTextNorm.indexOf(startSubstring, prevMinLength);
|
|
526
|
+
}
|
|
527
|
+
if (splitNorm === -1) {
|
|
528
|
+
splitNorm = cssNormSplits[0].length;
|
|
529
|
+
}
|
|
469
530
|
}
|
|
470
531
|
if (splitNorm !== -1) {
|
|
471
532
|
let k = Math.floor(splitNorm / normFactor);
|
|
472
533
|
for (; k > 0 && k < cssText.length; ) {
|
|
473
|
-
|
|
474
|
-
if (
|
|
534
|
+
iterCount += 1;
|
|
535
|
+
if (iterCount > 50 * childNodes2.length) {
|
|
475
536
|
splits.push(cssText);
|
|
476
537
|
return splits;
|
|
477
538
|
}
|
|
478
|
-
const normPart = normalizeCssString(
|
|
539
|
+
const normPart = normalizeCssString(
|
|
540
|
+
cssText.substring(0, k),
|
|
541
|
+
_testNoPxNorm
|
|
542
|
+
);
|
|
479
543
|
if (normPart.length === splitNorm) {
|
|
480
544
|
splits.push(cssText.substring(0, k));
|
|
481
545
|
cssText = cssText.substring(k);
|
|
@@ -571,9 +635,6 @@ function getXPath(node2) {
|
|
|
571
635
|
}
|
|
572
636
|
return "";
|
|
573
637
|
}
|
|
574
|
-
function isElement(n2) {
|
|
575
|
-
return n2.nodeType === n2.ELEMENT_NODE;
|
|
576
|
-
}
|
|
577
638
|
function isTextVisible(n2) {
|
|
578
639
|
var _a2;
|
|
579
640
|
const parent = index$1.parentNode(n2);
|
|
@@ -594,10 +655,10 @@ function isElementVisible(n2) {
|
|
|
594
655
|
const style = win ? win.getComputedStyle(n2) : null;
|
|
595
656
|
const isStyleVisible = style != null && style.display !== "none" && style.visibility !== "hidden" && parseFloat(style.opacity) !== 0;
|
|
596
657
|
const rect = n2.getBoundingClientRect();
|
|
597
|
-
const result2 = isStyleVisible && isRectVisible(rect
|
|
658
|
+
const result2 = isStyleVisible && isRectVisible(rect);
|
|
598
659
|
return result2;
|
|
599
660
|
}
|
|
600
|
-
function isRectVisible(rect, win) {
|
|
661
|
+
function isRectVisible(rect, win = window) {
|
|
601
662
|
var _a2, _b2, _c, _d;
|
|
602
663
|
const height = (win == null ? void 0 : win.innerHeight) ?? ((_b2 = (_a2 = win == null ? void 0 : win.document) == null ? void 0 : _a2.documentElement) == null ? void 0 : _b2.clientHeight) ?? 0;
|
|
603
664
|
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;
|
|
@@ -641,7 +702,7 @@ const interactiveTags = [
|
|
|
641
702
|
"video",
|
|
642
703
|
"audio"
|
|
643
704
|
];
|
|
644
|
-
const inlineEventAttributes = [
|
|
705
|
+
const inlineEventAttributes$1 = [
|
|
645
706
|
"onclick",
|
|
646
707
|
"ondblclick",
|
|
647
708
|
"onmousedown",
|
|
@@ -666,27 +727,20 @@ const inlineEventAttributes = [
|
|
|
666
727
|
"ontouchcancel"
|
|
667
728
|
];
|
|
668
729
|
const interactiveElementsRegistry$1 = /* @__PURE__ */ new WeakSet();
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
interactiveElementsRegistry$1.add(this);
|
|
677
|
-
}
|
|
730
|
+
const originalAddEventListener$1 = EventTarget.prototype.addEventListener;
|
|
731
|
+
EventTarget.prototype.addEventListener = function(type, listener, options) {
|
|
732
|
+
originalAddEventListener$1.call(this, type, listener, options);
|
|
733
|
+
if (this instanceof Element) {
|
|
734
|
+
const eventType = type.toLowerCase();
|
|
735
|
+
if (interactiveEvents$1.includes(eventType)) {
|
|
736
|
+
interactiveElementsRegistry$1.add(this);
|
|
678
737
|
}
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
if (this instanceof Element) {
|
|
686
|
-
type.toLowerCase();
|
|
687
|
-
}
|
|
688
|
-
};
|
|
689
|
-
}
|
|
738
|
+
}
|
|
739
|
+
};
|
|
740
|
+
const originalRemoveEventListener$1 = EventTarget.prototype.removeEventListener;
|
|
741
|
+
EventTarget.prototype.removeEventListener = function(type, listener, options) {
|
|
742
|
+
originalRemoveEventListener$1.call(this, type, listener, options);
|
|
743
|
+
};
|
|
690
744
|
function hasEventListeners(n2) {
|
|
691
745
|
return n2 instanceof Element && interactiveElementsRegistry$1.has(n2);
|
|
692
746
|
}
|
|
@@ -706,33 +760,20 @@ function isElementInteractive(n2) {
|
|
|
706
760
|
}
|
|
707
761
|
return false;
|
|
708
762
|
}
|
|
709
|
-
function inspectInlineEventHandlers(
|
|
710
|
-
|
|
711
|
-
const allElements = doc.querySelectorAll("*");
|
|
763
|
+
function inspectInlineEventHandlers$1() {
|
|
764
|
+
const allElements = document.querySelectorAll("*");
|
|
712
765
|
allElements.forEach((el) => {
|
|
713
|
-
inlineEventAttributes.forEach((attr) => {
|
|
766
|
+
inlineEventAttributes$1.forEach((attr) => {
|
|
714
767
|
if (el.hasAttribute(attr)) {
|
|
715
768
|
interactiveElementsRegistry$1.add(el);
|
|
716
769
|
}
|
|
717
770
|
});
|
|
718
771
|
});
|
|
719
772
|
}
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
try {
|
|
725
|
-
if (doc.readyState === "complete" || doc.readyState === "interactive") {
|
|
726
|
-
inspectInlineEventHandlers(doc);
|
|
727
|
-
} else {
|
|
728
|
-
doc.addEventListener("DOMContentLoaded", () => inspectInlineEventHandlers(doc), {
|
|
729
|
-
once: true,
|
|
730
|
-
capture: false
|
|
731
|
-
});
|
|
732
|
-
}
|
|
733
|
-
} catch (e2) {
|
|
734
|
-
console.warn("[inlineEventInspection] Failed to inspect document:", e2);
|
|
735
|
-
}
|
|
773
|
+
if (document.readyState === "complete" || document.readyState === "interactive") {
|
|
774
|
+
inspectInlineEventHandlers$1();
|
|
775
|
+
} else {
|
|
776
|
+
document.addEventListener("DOMContentLoaded", inspectInlineEventHandlers$1);
|
|
736
777
|
}
|
|
737
778
|
let _id = 1;
|
|
738
779
|
const tagNameRegex = new RegExp("[^a-z0-9-_:]");
|
|
@@ -1026,6 +1067,7 @@ function serializeNode(n2, options) {
|
|
|
1026
1067
|
childNodes: [],
|
|
1027
1068
|
xPath,
|
|
1028
1069
|
compatMode: n2.compatMode
|
|
1070
|
+
// probably "BackCompat"
|
|
1029
1071
|
};
|
|
1030
1072
|
} else {
|
|
1031
1073
|
return {
|
|
@@ -1320,7 +1362,7 @@ function slimDOMExcluded(sn, slimDOMOptions) {
|
|
|
1320
1362
|
} else if (sn.type === NodeType$3.Element) {
|
|
1321
1363
|
if (slimDOMOptions.script && // script tag
|
|
1322
1364
|
(sn.tagName === "script" || // (module)preload link
|
|
1323
|
-
sn.tagName === "link" && (sn.attributes.rel === "preload"
|
|
1365
|
+
sn.tagName === "link" && (sn.attributes.rel === "preload" && sn.attributes.as === "script" || sn.attributes.rel === "modulepreload") || // prefetch link
|
|
1324
1366
|
sn.tagName === "link" && sn.attributes.rel === "prefetch" && typeof sn.attributes.href === "string" && extractFileExtension(sn.attributes.href) === "js")) {
|
|
1325
1367
|
return true;
|
|
1326
1368
|
} else if (slimDOMOptions.headFavicon && (sn.tagName === "link" && sn.attributes.rel === "shortcut icon" || sn.tagName === "meta" && (lowerIfExists(sn.attributes.name).match(
|
|
@@ -1582,7 +1624,7 @@ function snapshot(n2, options) {
|
|
|
1582
1624
|
blockSelector = null,
|
|
1583
1625
|
maskTextClass = "rr-mask",
|
|
1584
1626
|
maskTextSelector = null,
|
|
1585
|
-
ignoreAttribute = "rr-ignore
|
|
1627
|
+
ignoreAttribute = "rr-ignore",
|
|
1586
1628
|
inlineStylesheet = true,
|
|
1587
1629
|
inlineImages = false,
|
|
1588
1630
|
recordCanvas = false,
|
|
@@ -1599,7 +1641,6 @@ function snapshot(n2, options) {
|
|
|
1599
1641
|
stylesheetLoadTimeout,
|
|
1600
1642
|
keepIframeSrcFn = () => false
|
|
1601
1643
|
} = options || {};
|
|
1602
|
-
scheduleInlineEventInspection(n2);
|
|
1603
1644
|
const maskInputOptions = maskAllInputs === true ? {
|
|
1604
1645
|
color: true,
|
|
1605
1646
|
date: true,
|
|
@@ -5296,11 +5337,16 @@ function getTagName(n2) {
|
|
|
5296
5337
|
function adaptCssForReplay(cssText, cache) {
|
|
5297
5338
|
const cachedStyle = cache == null ? void 0 : cache.stylesWithHoverClass.get(cssText);
|
|
5298
5339
|
if (cachedStyle) return cachedStyle;
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5340
|
+
let result2 = cssText;
|
|
5341
|
+
try {
|
|
5342
|
+
const ast = postcss$1$1([
|
|
5343
|
+
mediaSelectorPlugin,
|
|
5344
|
+
pseudoClassPlugin
|
|
5345
|
+
]).process(cssText);
|
|
5346
|
+
result2 = ast.css;
|
|
5347
|
+
} catch (error) {
|
|
5348
|
+
console.warn("Failed to adapt css for replay", error);
|
|
5349
|
+
}
|
|
5304
5350
|
cache == null ? void 0 : cache.stylesWithHoverClass.set(cssText, result2);
|
|
5305
5351
|
return result2;
|
|
5306
5352
|
}
|
|
@@ -5321,11 +5367,39 @@ function applyCssSplits(n2, cssText, hackCss, cache) {
|
|
|
5321
5367
|
while (cssTextSplits.length > 1 && cssTextSplits.length > childTextNodes.length) {
|
|
5322
5368
|
cssTextSplits.splice(-2, 2, cssTextSplits.slice(-2).join(""));
|
|
5323
5369
|
}
|
|
5370
|
+
let adaptedCss = "";
|
|
5371
|
+
if (hackCss) {
|
|
5372
|
+
adaptedCss = adaptCssForReplay(cssTextSplits.join(""), cache);
|
|
5373
|
+
}
|
|
5374
|
+
let startIndex = 0;
|
|
5324
5375
|
for (let i2 = 0; i2 < childTextNodes.length; i2++) {
|
|
5376
|
+
if (i2 === cssTextSplits.length) {
|
|
5377
|
+
break;
|
|
5378
|
+
}
|
|
5325
5379
|
const childTextNode = childTextNodes[i2];
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
|
|
5380
|
+
if (!hackCss) {
|
|
5381
|
+
childTextNode.textContent = cssTextSplits[i2];
|
|
5382
|
+
} else if (i2 < cssTextSplits.length - 1) {
|
|
5383
|
+
let endIndex = startIndex;
|
|
5384
|
+
let endSearch = cssTextSplits[i2 + 1].length;
|
|
5385
|
+
endSearch = Math.min(endSearch, 30);
|
|
5386
|
+
let found = false;
|
|
5387
|
+
for (; endSearch > 2; endSearch--) {
|
|
5388
|
+
const searchBit = cssTextSplits[i2 + 1].substring(0, endSearch);
|
|
5389
|
+
const searchIndex = adaptedCss.substring(startIndex).indexOf(searchBit);
|
|
5390
|
+
found = searchIndex !== -1;
|
|
5391
|
+
if (found) {
|
|
5392
|
+
endIndex += searchIndex;
|
|
5393
|
+
break;
|
|
5394
|
+
}
|
|
5395
|
+
}
|
|
5396
|
+
if (!found) {
|
|
5397
|
+
endIndex += cssTextSplits[i2].length;
|
|
5398
|
+
}
|
|
5399
|
+
childTextNode.textContent = adaptedCss.substring(startIndex, endIndex);
|
|
5400
|
+
startIndex = endIndex;
|
|
5401
|
+
} else {
|
|
5402
|
+
childTextNode.textContent = adaptedCss.substring(startIndex);
|
|
5329
5403
|
}
|
|
5330
5404
|
}
|
|
5331
5405
|
}
|
|
@@ -5409,8 +5483,8 @@ function buildNode(n2, options) {
|
|
|
5409
5483
|
} else if (tagName === "meta" && n2.attributes["http-equiv"] === "Content-Security-Policy" && name === "content") {
|
|
5410
5484
|
node2.setAttribute("csp-content", value.toString());
|
|
5411
5485
|
continue;
|
|
5412
|
-
} else if (tagName === "link" && (n2.attributes.rel === "preload"
|
|
5413
|
-
} else if (tagName === "link" && n2.attributes.rel === "prefetch" && typeof n2.attributes.href === "string" && n2.attributes.href
|
|
5486
|
+
} else if (tagName === "link" && (n2.attributes.rel === "preload" && n2.attributes.as === "script" || n2.attributes.rel === "modulepreload")) {
|
|
5487
|
+
} else if (tagName === "link" && n2.attributes.rel === "prefetch" && typeof n2.attributes.href === "string" && extractFileExtension(n2.attributes.href) === "js") {
|
|
5414
5488
|
} else if (tagName === "img" && n2.attributes.srcset && n2.attributes.rr_dataURL) {
|
|
5415
5489
|
node2.setAttribute(
|
|
5416
5490
|
"rrweb-original-srcset",
|
|
@@ -5719,27 +5793,59 @@ const interactiveEvents = [
|
|
|
5719
5793
|
"touchend",
|
|
5720
5794
|
"touchcancel"
|
|
5721
5795
|
];
|
|
5796
|
+
const inlineEventAttributes = [
|
|
5797
|
+
"onclick",
|
|
5798
|
+
"ondblclick",
|
|
5799
|
+
"onmousedown",
|
|
5800
|
+
"onmouseup",
|
|
5801
|
+
"onmouseover",
|
|
5802
|
+
"onmouseout",
|
|
5803
|
+
"onmousemove",
|
|
5804
|
+
"onfocus",
|
|
5805
|
+
"onblur",
|
|
5806
|
+
"onkeydown",
|
|
5807
|
+
"onkeypress",
|
|
5808
|
+
"onkeyup",
|
|
5809
|
+
"onchange",
|
|
5810
|
+
"oninput",
|
|
5811
|
+
"onsubmit",
|
|
5812
|
+
"onreset",
|
|
5813
|
+
"onselect",
|
|
5814
|
+
"oncontextmenu",
|
|
5815
|
+
"ontouchstart",
|
|
5816
|
+
"ontouchmove",
|
|
5817
|
+
"ontouchend",
|
|
5818
|
+
"ontouchcancel"
|
|
5819
|
+
];
|
|
5722
5820
|
const interactiveElementsRegistry = /* @__PURE__ */ new WeakSet();
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
interactiveElementsRegistry.add(this);
|
|
5731
|
-
}
|
|
5821
|
+
const originalAddEventListener = EventTarget.prototype.addEventListener;
|
|
5822
|
+
EventTarget.prototype.addEventListener = function(type, listener, options) {
|
|
5823
|
+
originalAddEventListener.call(this, type, listener, options);
|
|
5824
|
+
if (this instanceof Element) {
|
|
5825
|
+
const eventType = type.toLowerCase();
|
|
5826
|
+
if (interactiveEvents.includes(eventType)) {
|
|
5827
|
+
interactiveElementsRegistry.add(this);
|
|
5732
5828
|
}
|
|
5733
|
-
}
|
|
5829
|
+
}
|
|
5830
|
+
};
|
|
5831
|
+
const originalRemoveEventListener = EventTarget.prototype.removeEventListener;
|
|
5832
|
+
EventTarget.prototype.removeEventListener = function(type, listener, options) {
|
|
5833
|
+
originalRemoveEventListener.call(this, type, listener, options);
|
|
5834
|
+
};
|
|
5835
|
+
function inspectInlineEventHandlers() {
|
|
5836
|
+
const allElements = document.querySelectorAll("*");
|
|
5837
|
+
allElements.forEach((el) => {
|
|
5838
|
+
inlineEventAttributes.forEach((attr) => {
|
|
5839
|
+
if (el.hasAttribute(attr)) {
|
|
5840
|
+
interactiveElementsRegistry.add(el);
|
|
5841
|
+
}
|
|
5842
|
+
});
|
|
5843
|
+
});
|
|
5734
5844
|
}
|
|
5735
|
-
if (
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
if (this instanceof Element) {
|
|
5740
|
-
type.toLowerCase();
|
|
5741
|
-
}
|
|
5742
|
-
};
|
|
5845
|
+
if (document.readyState === "complete" || document.readyState === "interactive") {
|
|
5846
|
+
inspectInlineEventHandlers();
|
|
5847
|
+
} else {
|
|
5848
|
+
document.addEventListener("DOMContentLoaded", inspectInlineEventHandlers);
|
|
5743
5849
|
}
|
|
5744
5850
|
function getDefaultExportFromCjs(x2) {
|
|
5745
5851
|
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
@@ -10691,6 +10797,32 @@ function querySelectorAll(n2, selectors) {
|
|
|
10691
10797
|
function mutationObserverCtor() {
|
|
10692
10798
|
return getUntaintedPrototype("MutationObserver").constructor;
|
|
10693
10799
|
}
|
|
10800
|
+
function patch(source, name, replacement) {
|
|
10801
|
+
try {
|
|
10802
|
+
if (!(name in source)) {
|
|
10803
|
+
return () => {
|
|
10804
|
+
};
|
|
10805
|
+
}
|
|
10806
|
+
const original = source[name];
|
|
10807
|
+
const wrapped = replacement(original);
|
|
10808
|
+
if (typeof wrapped === "function") {
|
|
10809
|
+
wrapped.prototype = wrapped.prototype || {};
|
|
10810
|
+
Object.defineProperties(wrapped, {
|
|
10811
|
+
__rrweb_original__: {
|
|
10812
|
+
enumerable: false,
|
|
10813
|
+
value: original
|
|
10814
|
+
}
|
|
10815
|
+
});
|
|
10816
|
+
}
|
|
10817
|
+
source[name] = wrapped;
|
|
10818
|
+
return () => {
|
|
10819
|
+
source[name] = original;
|
|
10820
|
+
};
|
|
10821
|
+
} catch {
|
|
10822
|
+
return () => {
|
|
10823
|
+
};
|
|
10824
|
+
}
|
|
10825
|
+
}
|
|
10694
10826
|
const index = {
|
|
10695
10827
|
childNodes,
|
|
10696
10828
|
parentNode,
|
|
@@ -10703,7 +10835,8 @@ const index = {
|
|
|
10703
10835
|
shadowRoot,
|
|
10704
10836
|
querySelector,
|
|
10705
10837
|
querySelectorAll,
|
|
10706
|
-
mutationObserver: mutationObserverCtor
|
|
10838
|
+
mutationObserver: mutationObserverCtor,
|
|
10839
|
+
patch
|
|
10707
10840
|
};
|
|
10708
10841
|
function on(type, fn, target = document) {
|
|
10709
10842
|
const options = { capture: true, passive: true };
|
|
@@ -10786,32 +10919,6 @@ function hookSetter(target, key, d, isRevoked, win = window) {
|
|
|
10786
10919
|
);
|
|
10787
10920
|
return () => hookSetter(target, key, original || {}, true);
|
|
10788
10921
|
}
|
|
10789
|
-
function patch(source, name, replacement) {
|
|
10790
|
-
try {
|
|
10791
|
-
if (!(name in source)) {
|
|
10792
|
-
return () => {
|
|
10793
|
-
};
|
|
10794
|
-
}
|
|
10795
|
-
const original = source[name];
|
|
10796
|
-
const wrapped = replacement(original);
|
|
10797
|
-
if (typeof wrapped === "function") {
|
|
10798
|
-
wrapped.prototype = wrapped.prototype || {};
|
|
10799
|
-
Object.defineProperties(wrapped, {
|
|
10800
|
-
__rrweb_original__: {
|
|
10801
|
-
enumerable: false,
|
|
10802
|
-
value: original
|
|
10803
|
-
}
|
|
10804
|
-
});
|
|
10805
|
-
}
|
|
10806
|
-
source[name] = wrapped;
|
|
10807
|
-
return () => {
|
|
10808
|
-
source[name] = original;
|
|
10809
|
-
};
|
|
10810
|
-
} catch {
|
|
10811
|
-
return () => {
|
|
10812
|
-
};
|
|
10813
|
-
}
|
|
10814
|
-
}
|
|
10815
10922
|
let nowTimestamp = Date.now;
|
|
10816
10923
|
if (!/* @__PURE__ */ /[1-9][0-9]{12}/.test(Date.now().toString())) {
|
|
10817
10924
|
nowTimestamp = () => (/* @__PURE__ */ new Date()).getTime();
|
|
@@ -11099,7 +11206,6 @@ const utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
11099
11206
|
return nowTimestamp;
|
|
11100
11207
|
},
|
|
11101
11208
|
on,
|
|
11102
|
-
patch,
|
|
11103
11209
|
polyfill: polyfill$1,
|
|
11104
11210
|
queueToResolveTrees,
|
|
11105
11211
|
shadowHostInDom,
|
|
@@ -11141,13 +11247,14 @@ var MouseInteractions = /* @__PURE__ */ ((MouseInteractions2) => {
|
|
|
11141
11247
|
MouseInteractions2[MouseInteractions2["MouseUp"] = 0] = "MouseUp";
|
|
11142
11248
|
MouseInteractions2[MouseInteractions2["MouseDown"] = 1] = "MouseDown";
|
|
11143
11249
|
MouseInteractions2[MouseInteractions2["Click"] = 2] = "Click";
|
|
11144
|
-
MouseInteractions2[MouseInteractions2["
|
|
11145
|
-
MouseInteractions2[MouseInteractions2["
|
|
11146
|
-
MouseInteractions2[MouseInteractions2["
|
|
11147
|
-
MouseInteractions2[MouseInteractions2["
|
|
11148
|
-
MouseInteractions2[MouseInteractions2["
|
|
11149
|
-
MouseInteractions2[MouseInteractions2["
|
|
11150
|
-
MouseInteractions2[MouseInteractions2["
|
|
11250
|
+
MouseInteractions2[MouseInteractions2["ContextMenu"] = 3] = "ContextMenu";
|
|
11251
|
+
MouseInteractions2[MouseInteractions2["DblClick"] = 4] = "DblClick";
|
|
11252
|
+
MouseInteractions2[MouseInteractions2["Focus"] = 5] = "Focus";
|
|
11253
|
+
MouseInteractions2[MouseInteractions2["Blur"] = 6] = "Blur";
|
|
11254
|
+
MouseInteractions2[MouseInteractions2["TouchStart"] = 7] = "TouchStart";
|
|
11255
|
+
MouseInteractions2[MouseInteractions2["TouchMove_Departed"] = 8] = "TouchMove_Departed";
|
|
11256
|
+
MouseInteractions2[MouseInteractions2["TouchEnd"] = 9] = "TouchEnd";
|
|
11257
|
+
MouseInteractions2[MouseInteractions2["TouchCancel"] = 10] = "TouchCancel";
|
|
11151
11258
|
return MouseInteractions2;
|
|
11152
11259
|
})(MouseInteractions || {});
|
|
11153
11260
|
var PointerTypes = /* @__PURE__ */ ((PointerTypes2) => {
|
|
@@ -11527,10 +11634,18 @@ class MutationBuffer {
|
|
|
11527
11634
|
this.attributes.push(item);
|
|
11528
11635
|
this.attributeMap.set(textarea, item);
|
|
11529
11636
|
}
|
|
11530
|
-
|
|
11637
|
+
const value = Array.from(
|
|
11531
11638
|
index.childNodes(textarea),
|
|
11532
11639
|
(cn) => index.textContent(cn) || ""
|
|
11533
11640
|
).join("");
|
|
11641
|
+
item.attributes.value = maskInputValue({
|
|
11642
|
+
element: textarea,
|
|
11643
|
+
maskInputOptions: this.maskInputOptions,
|
|
11644
|
+
tagName: textarea.tagName,
|
|
11645
|
+
type: getInputType(textarea),
|
|
11646
|
+
value,
|
|
11647
|
+
maskInputFn: this.maskInputFn
|
|
11648
|
+
});
|
|
11534
11649
|
});
|
|
11535
11650
|
__publicField(this, "processMutation", (m) => {
|
|
11536
11651
|
if (isIgnored(m.target, this.mirror, this.slimDOMOptions)) {
|
|
@@ -13951,7 +14066,6 @@ try {
|
|
|
13951
14066
|
}
|
|
13952
14067
|
const mirror = createMirror$2();
|
|
13953
14068
|
function record(options = {}) {
|
|
13954
|
-
var _a2;
|
|
13955
14069
|
const {
|
|
13956
14070
|
emit,
|
|
13957
14071
|
checkoutEveryNms,
|
|
@@ -13961,7 +14075,7 @@ function record(options = {}) {
|
|
|
13961
14075
|
blockSelector = null,
|
|
13962
14076
|
ignoreClass = "rr-ignore",
|
|
13963
14077
|
ignoreSelector = null,
|
|
13964
|
-
ignoreAttribute = "rr-ignore
|
|
14078
|
+
ignoreAttribute = "rr-ignore",
|
|
13965
14079
|
maskTextClass = "rr-mask",
|
|
13966
14080
|
maskTextSelector = null,
|
|
13967
14081
|
inlineStylesheet = true,
|
|
@@ -13987,24 +14101,12 @@ function record(options = {}) {
|
|
|
13987
14101
|
ignoreCSSAttributes = /* @__PURE__ */ new Set([]),
|
|
13988
14102
|
errorHandler: errorHandler2
|
|
13989
14103
|
} = options;
|
|
13990
|
-
const win = options.customWindow || window;
|
|
13991
|
-
const doc = options.customDocument || document;
|
|
13992
|
-
try {
|
|
13993
|
-
if (Array.from([1], (x2) => x2 * 2)[0] !== 2) {
|
|
13994
|
-
const cleanFrame = doc.createElement("iframe");
|
|
13995
|
-
doc.body.appendChild(cleanFrame);
|
|
13996
|
-
Array.from = ((_a2 = cleanFrame.contentWindow) == null ? void 0 : _a2.Array.from) || Array.from;
|
|
13997
|
-
doc.body.removeChild(cleanFrame);
|
|
13998
|
-
}
|
|
13999
|
-
} catch (err) {
|
|
14000
|
-
console.debug("Unable to override Array.from", err);
|
|
14001
|
-
}
|
|
14002
14104
|
registerErrorHandler(errorHandler2);
|
|
14003
|
-
const inEmittingFrame = recordCrossOriginIframes ?
|
|
14105
|
+
const inEmittingFrame = recordCrossOriginIframes ? window.parent === window : true;
|
|
14004
14106
|
let passEmitsToParent = false;
|
|
14005
14107
|
if (!inEmittingFrame) {
|
|
14006
14108
|
try {
|
|
14007
|
-
if (
|
|
14109
|
+
if (window.parent.document) {
|
|
14008
14110
|
passEmitsToParent = false;
|
|
14009
14111
|
}
|
|
14010
14112
|
} catch (e2) {
|
|
@@ -14071,10 +14173,10 @@ function record(options = {}) {
|
|
|
14071
14173
|
return e2;
|
|
14072
14174
|
};
|
|
14073
14175
|
wrappedEmit = (r2, isCheckout) => {
|
|
14074
|
-
var
|
|
14176
|
+
var _a2;
|
|
14075
14177
|
const e2 = r2;
|
|
14076
14178
|
e2.timestamp = nowTimestamp();
|
|
14077
|
-
if (((
|
|
14179
|
+
if (((_a2 = mutationBuffers[0]) == null ? void 0 : _a2.isFrozen()) && e2.type !== EventType.FullSnapshot && !(e2.type === EventType.IncrementalSnapshot && e2.data.source === IncrementalSource.Mutation)) {
|
|
14078
14180
|
mutationBuffers.forEach((buf) => buf.unfreeze());
|
|
14079
14181
|
}
|
|
14080
14182
|
if (inEmittingFrame) {
|
|
@@ -14083,10 +14185,10 @@ function record(options = {}) {
|
|
|
14083
14185
|
const message = {
|
|
14084
14186
|
type: "rrweb",
|
|
14085
14187
|
event: eventProcessor(e2),
|
|
14086
|
-
origin:
|
|
14188
|
+
origin: window.location.origin,
|
|
14087
14189
|
isCheckout
|
|
14088
14190
|
};
|
|
14089
|
-
|
|
14191
|
+
window.parent.postMessage(message, "*");
|
|
14090
14192
|
}
|
|
14091
14193
|
if (e2.type === EventType.FullSnapshot) {
|
|
14092
14194
|
lastFullSnapshotEvent = e2;
|
|
@@ -14157,7 +14259,7 @@ function record(options = {}) {
|
|
|
14157
14259
|
canvasManager = new CanvasManager({
|
|
14158
14260
|
recordCanvas,
|
|
14159
14261
|
mutationCb: wrappedCanvasMutationEmit,
|
|
14160
|
-
win,
|
|
14262
|
+
win: window,
|
|
14161
14263
|
blockClass,
|
|
14162
14264
|
blockSelector,
|
|
14163
14265
|
mirror,
|
|
@@ -14198,9 +14300,9 @@ function record(options = {}) {
|
|
|
14198
14300
|
{
|
|
14199
14301
|
type: EventType.Meta,
|
|
14200
14302
|
data: {
|
|
14201
|
-
href:
|
|
14202
|
-
width: getWindowWidth(
|
|
14203
|
-
height: getWindowHeight(
|
|
14303
|
+
href: window.location.href,
|
|
14304
|
+
width: getWindowWidth(),
|
|
14305
|
+
height: getWindowHeight()
|
|
14204
14306
|
}
|
|
14205
14307
|
},
|
|
14206
14308
|
isCheckout
|
|
@@ -14208,12 +14310,13 @@ function record(options = {}) {
|
|
|
14208
14310
|
stylesheetManager.reset();
|
|
14209
14311
|
shadowDomManager.init();
|
|
14210
14312
|
mutationBuffers.forEach((buf) => buf.lock());
|
|
14211
|
-
const node2 = snapshot(
|
|
14313
|
+
const node2 = snapshot(document, {
|
|
14212
14314
|
mirror,
|
|
14213
14315
|
blockClass,
|
|
14214
14316
|
blockSelector,
|
|
14215
14317
|
maskTextClass,
|
|
14216
14318
|
maskTextSelector,
|
|
14319
|
+
ignoreAttribute,
|
|
14217
14320
|
inlineStylesheet,
|
|
14218
14321
|
maskAllInputs: maskInputOptions,
|
|
14219
14322
|
maskTextFn,
|
|
@@ -14230,7 +14333,7 @@ function record(options = {}) {
|
|
|
14230
14333
|
stylesheetManager.trackLinkElement(n2);
|
|
14231
14334
|
}
|
|
14232
14335
|
if (hasShadowRoot(n2)) {
|
|
14233
|
-
shadowDomManager.addShadowRoot(index.shadowRoot(n2),
|
|
14336
|
+
shadowDomManager.addShadowRoot(index.shadowRoot(n2), document);
|
|
14234
14337
|
}
|
|
14235
14338
|
},
|
|
14236
14339
|
onIframeLoad: (iframe, childSn) => {
|
|
@@ -14250,22 +14353,22 @@ function record(options = {}) {
|
|
|
14250
14353
|
type: EventType.FullSnapshot,
|
|
14251
14354
|
data: {
|
|
14252
14355
|
node: node2,
|
|
14253
|
-
initialOffset: getWindowScroll(
|
|
14356
|
+
initialOffset: getWindowScroll(window)
|
|
14254
14357
|
}
|
|
14255
14358
|
},
|
|
14256
14359
|
isCheckout
|
|
14257
14360
|
);
|
|
14258
14361
|
mutationBuffers.forEach((buf) => buf.unlock());
|
|
14259
|
-
if (
|
|
14362
|
+
if (document.adoptedStyleSheets && document.adoptedStyleSheets.length > 0)
|
|
14260
14363
|
stylesheetManager.adoptStyleSheets(
|
|
14261
|
-
|
|
14262
|
-
mirror.getId(
|
|
14364
|
+
document.adoptedStyleSheets,
|
|
14365
|
+
mirror.getId(document)
|
|
14263
14366
|
);
|
|
14264
14367
|
};
|
|
14265
14368
|
try {
|
|
14266
14369
|
const handlers = [];
|
|
14267
|
-
const observe = (
|
|
14268
|
-
var
|
|
14370
|
+
const observe = (doc) => {
|
|
14371
|
+
var _a2;
|
|
14269
14372
|
return callbackWrapper(initObservers)(
|
|
14270
14373
|
{
|
|
14271
14374
|
mutationCb: wrappedMutationEmit,
|
|
@@ -14368,7 +14471,7 @@ function record(options = {}) {
|
|
|
14368
14471
|
inlineImages,
|
|
14369
14472
|
userTriggeredOnInput,
|
|
14370
14473
|
collectFonts,
|
|
14371
|
-
doc
|
|
14474
|
+
doc,
|
|
14372
14475
|
maskInputFn,
|
|
14373
14476
|
maskTextFn,
|
|
14374
14477
|
keepIframeSrcFn,
|
|
@@ -14382,7 +14485,7 @@ function record(options = {}) {
|
|
|
14382
14485
|
processedNodeManager,
|
|
14383
14486
|
canvasManager,
|
|
14384
14487
|
ignoreCSSAttributes,
|
|
14385
|
-
plugins: ((
|
|
14488
|
+
plugins: ((_a2 = plugins == null ? void 0 : plugins.filter((p) => p.observer)) == null ? void 0 : _a2.map((p) => ({
|
|
14386
14489
|
observer: p.observer,
|
|
14387
14490
|
options: p.options,
|
|
14388
14491
|
callback: (payload) => wrappedEmit({
|
|
@@ -14406,10 +14509,10 @@ function record(options = {}) {
|
|
|
14406
14509
|
});
|
|
14407
14510
|
const init = () => {
|
|
14408
14511
|
takeFullSnapshot$1();
|
|
14409
|
-
handlers.push(observe(
|
|
14512
|
+
handlers.push(observe(document));
|
|
14410
14513
|
recording = true;
|
|
14411
14514
|
};
|
|
14412
|
-
if (
|
|
14515
|
+
if (document.readyState === "interactive" || document.readyState === "complete") {
|
|
14413
14516
|
init();
|
|
14414
14517
|
} else {
|
|
14415
14518
|
handlers.push(
|
|
@@ -14431,7 +14534,7 @@ function record(options = {}) {
|
|
|
14431
14534
|
});
|
|
14432
14535
|
if (recordAfter === "load") init();
|
|
14433
14536
|
},
|
|
14434
|
-
|
|
14537
|
+
window
|
|
14435
14538
|
)
|
|
14436
14539
|
);
|
|
14437
14540
|
}
|