@appsurify-testmap/rrweb-player 2.0.0-alpha.41 → 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-player.cjs +192 -56
- package/dist/rrweb-player.cjs.map +1 -1
- package/dist/rrweb-player.js +192 -56
- package/dist/rrweb-player.js.map +1 -1
- package/dist/rrweb-player.umd.cjs +193 -56
- package/dist/rrweb-player.umd.cjs.map +3 -3
- package/dist/rrweb-player.umd.min.cjs +28 -28
- package/dist/rrweb-player.umd.min.cjs.map +3 -3
- package/package.json +4 -5
|
@@ -444,6 +444,9 @@ var NodeType$3 = /* @__PURE__ */ ((NodeType2) => {
|
|
|
444
444
|
NodeType2[NodeType2["Comment"] = 5] = "Comment";
|
|
445
445
|
return NodeType2;
|
|
446
446
|
})(NodeType$3 || {});
|
|
447
|
+
function isElement(n2) {
|
|
448
|
+
return n2.nodeType === n2.ELEMENT_NODE;
|
|
449
|
+
}
|
|
447
450
|
class Mirror {
|
|
448
451
|
constructor() {
|
|
449
452
|
__publicField$1(this, "idNodeMap", /* @__PURE__ */ new Map());
|
|
@@ -517,8 +520,17 @@ function isNodeMetaEqual(a2, b) {
|
|
|
517
520
|
return a2.tagName === b.tagName && JSON.stringify(a2.attributes) === JSON.stringify(b.attributes) && a2.isSVG === b.isSVG && a2.needBlock === b.needBlock;
|
|
518
521
|
return false;
|
|
519
522
|
}
|
|
520
|
-
function
|
|
521
|
-
|
|
523
|
+
function extractFileExtension(path, baseURL) {
|
|
524
|
+
var _a2;
|
|
525
|
+
let url;
|
|
526
|
+
try {
|
|
527
|
+
url = new URL(path, baseURL != null ? baseURL : window.location.href);
|
|
528
|
+
} catch (err) {
|
|
529
|
+
return null;
|
|
530
|
+
}
|
|
531
|
+
const regex = /\.([0-9a-z]+)(?:$)/i;
|
|
532
|
+
const match = url.pathname.match(regex);
|
|
533
|
+
return (_a2 = match == null ? void 0 : match[1]) != null ? _a2 : null;
|
|
522
534
|
}
|
|
523
535
|
const interactiveEvents$1 = [
|
|
524
536
|
"change",
|
|
@@ -545,27 +557,59 @@ const interactiveEvents$1 = [
|
|
|
545
557
|
"touchend",
|
|
546
558
|
"touchcancel"
|
|
547
559
|
];
|
|
560
|
+
const inlineEventAttributes$1 = [
|
|
561
|
+
"onclick",
|
|
562
|
+
"ondblclick",
|
|
563
|
+
"onmousedown",
|
|
564
|
+
"onmouseup",
|
|
565
|
+
"onmouseover",
|
|
566
|
+
"onmouseout",
|
|
567
|
+
"onmousemove",
|
|
568
|
+
"onfocus",
|
|
569
|
+
"onblur",
|
|
570
|
+
"onkeydown",
|
|
571
|
+
"onkeypress",
|
|
572
|
+
"onkeyup",
|
|
573
|
+
"onchange",
|
|
574
|
+
"oninput",
|
|
575
|
+
"onsubmit",
|
|
576
|
+
"onreset",
|
|
577
|
+
"onselect",
|
|
578
|
+
"oncontextmenu",
|
|
579
|
+
"ontouchstart",
|
|
580
|
+
"ontouchmove",
|
|
581
|
+
"ontouchend",
|
|
582
|
+
"ontouchcancel"
|
|
583
|
+
];
|
|
548
584
|
const interactiveElementsRegistry$1 = /* @__PURE__ */ new WeakSet();
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
interactiveElementsRegistry$1.add(this);
|
|
557
|
-
}
|
|
585
|
+
const originalAddEventListener$1 = EventTarget.prototype.addEventListener;
|
|
586
|
+
EventTarget.prototype.addEventListener = function(type, listener, options) {
|
|
587
|
+
originalAddEventListener$1.call(this, type, listener, options);
|
|
588
|
+
if (this instanceof Element) {
|
|
589
|
+
const eventType = type.toLowerCase();
|
|
590
|
+
if (interactiveEvents$1.includes(eventType)) {
|
|
591
|
+
interactiveElementsRegistry$1.add(this);
|
|
558
592
|
}
|
|
559
|
-
}
|
|
593
|
+
}
|
|
594
|
+
};
|
|
595
|
+
const originalRemoveEventListener$1 = EventTarget.prototype.removeEventListener;
|
|
596
|
+
EventTarget.prototype.removeEventListener = function(type, listener, options) {
|
|
597
|
+
originalRemoveEventListener$1.call(this, type, listener, options);
|
|
598
|
+
};
|
|
599
|
+
function inspectInlineEventHandlers$1() {
|
|
600
|
+
const allElements = document.querySelectorAll("*");
|
|
601
|
+
allElements.forEach((el) => {
|
|
602
|
+
inlineEventAttributes$1.forEach((attr2) => {
|
|
603
|
+
if (el.hasAttribute(attr2)) {
|
|
604
|
+
interactiveElementsRegistry$1.add(el);
|
|
605
|
+
}
|
|
606
|
+
});
|
|
607
|
+
});
|
|
560
608
|
}
|
|
561
|
-
if (
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
if (this instanceof Element) {
|
|
566
|
-
type.toLowerCase();
|
|
567
|
-
}
|
|
568
|
-
};
|
|
609
|
+
if (document.readyState === "complete" || document.readyState === "interactive") {
|
|
610
|
+
inspectInlineEventHandlers$1();
|
|
611
|
+
} else {
|
|
612
|
+
document.addEventListener("DOMContentLoaded", inspectInlineEventHandlers$1);
|
|
569
613
|
}
|
|
570
614
|
const MEDIA_SELECTOR = /(max|min)-device-(width|height)/;
|
|
571
615
|
const MEDIA_SELECTOR_GLOBAL = new RegExp(MEDIA_SELECTOR.source, "g");
|
|
@@ -4204,11 +4248,16 @@ function getTagName(n2) {
|
|
|
4204
4248
|
function adaptCssForReplay(cssText, cache) {
|
|
4205
4249
|
const cachedStyle = cache == null ? void 0 : cache.stylesWithHoverClass.get(cssText);
|
|
4206
4250
|
if (cachedStyle) return cachedStyle;
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4251
|
+
let result2 = cssText;
|
|
4252
|
+
try {
|
|
4253
|
+
const ast = postcss$1$1([
|
|
4254
|
+
mediaSelectorPlugin,
|
|
4255
|
+
pseudoClassPlugin
|
|
4256
|
+
]).process(cssText);
|
|
4257
|
+
result2 = ast.css;
|
|
4258
|
+
} catch (error) {
|
|
4259
|
+
console.warn("Failed to adapt css for replay", error);
|
|
4260
|
+
}
|
|
4212
4261
|
cache == null ? void 0 : cache.stylesWithHoverClass.set(cssText, result2);
|
|
4213
4262
|
return result2;
|
|
4214
4263
|
}
|
|
@@ -4229,11 +4278,39 @@ function applyCssSplits(n2, cssText, hackCss, cache) {
|
|
|
4229
4278
|
while (cssTextSplits.length > 1 && cssTextSplits.length > childTextNodes.length) {
|
|
4230
4279
|
cssTextSplits.splice(-2, 2, cssTextSplits.slice(-2).join(""));
|
|
4231
4280
|
}
|
|
4281
|
+
let adaptedCss = "";
|
|
4282
|
+
if (hackCss) {
|
|
4283
|
+
adaptedCss = adaptCssForReplay(cssTextSplits.join(""), cache);
|
|
4284
|
+
}
|
|
4285
|
+
let startIndex = 0;
|
|
4232
4286
|
for (let i2 = 0; i2 < childTextNodes.length; i2++) {
|
|
4287
|
+
if (i2 === cssTextSplits.length) {
|
|
4288
|
+
break;
|
|
4289
|
+
}
|
|
4233
4290
|
const childTextNode = childTextNodes[i2];
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4291
|
+
if (!hackCss) {
|
|
4292
|
+
childTextNode.textContent = cssTextSplits[i2];
|
|
4293
|
+
} else if (i2 < cssTextSplits.length - 1) {
|
|
4294
|
+
let endIndex = startIndex;
|
|
4295
|
+
let endSearch = cssTextSplits[i2 + 1].length;
|
|
4296
|
+
endSearch = Math.min(endSearch, 30);
|
|
4297
|
+
let found = false;
|
|
4298
|
+
for (; endSearch > 2; endSearch--) {
|
|
4299
|
+
const searchBit = cssTextSplits[i2 + 1].substring(0, endSearch);
|
|
4300
|
+
const searchIndex = adaptedCss.substring(startIndex).indexOf(searchBit);
|
|
4301
|
+
found = searchIndex !== -1;
|
|
4302
|
+
if (found) {
|
|
4303
|
+
endIndex += searchIndex;
|
|
4304
|
+
break;
|
|
4305
|
+
}
|
|
4306
|
+
}
|
|
4307
|
+
if (!found) {
|
|
4308
|
+
endIndex += cssTextSplits[i2].length;
|
|
4309
|
+
}
|
|
4310
|
+
childTextNode.textContent = adaptedCss.substring(startIndex, endIndex);
|
|
4311
|
+
startIndex = endIndex;
|
|
4312
|
+
} else {
|
|
4313
|
+
childTextNode.textContent = adaptedCss.substring(startIndex);
|
|
4237
4314
|
}
|
|
4238
4315
|
}
|
|
4239
4316
|
}
|
|
@@ -4317,8 +4394,8 @@ function buildNode(n2, options) {
|
|
|
4317
4394
|
} else if (tagName === "meta" && n2.attributes["http-equiv"] === "Content-Security-Policy" && name === "content") {
|
|
4318
4395
|
node2.setAttribute("csp-content", value.toString());
|
|
4319
4396
|
continue;
|
|
4320
|
-
} else if (tagName === "link" && (n2.attributes.rel === "preload"
|
|
4321
|
-
} else if (tagName === "link" && n2.attributes.rel === "prefetch" && typeof n2.attributes.href === "string" && n2.attributes.href
|
|
4397
|
+
} else if (tagName === "link" && (n2.attributes.rel === "preload" && n2.attributes.as === "script" || n2.attributes.rel === "modulepreload")) {
|
|
4398
|
+
} else if (tagName === "link" && n2.attributes.rel === "prefetch" && typeof n2.attributes.href === "string" && extractFileExtension(n2.attributes.href) === "js") {
|
|
4322
4399
|
} else if (tagName === "img" && n2.attributes.srcset && n2.attributes.rr_dataURL) {
|
|
4323
4400
|
node2.setAttribute(
|
|
4324
4401
|
"rrweb-original-srcset",
|
|
@@ -4627,27 +4704,59 @@ const interactiveEvents = [
|
|
|
4627
4704
|
"touchend",
|
|
4628
4705
|
"touchcancel"
|
|
4629
4706
|
];
|
|
4707
|
+
const inlineEventAttributes = [
|
|
4708
|
+
"onclick",
|
|
4709
|
+
"ondblclick",
|
|
4710
|
+
"onmousedown",
|
|
4711
|
+
"onmouseup",
|
|
4712
|
+
"onmouseover",
|
|
4713
|
+
"onmouseout",
|
|
4714
|
+
"onmousemove",
|
|
4715
|
+
"onfocus",
|
|
4716
|
+
"onblur",
|
|
4717
|
+
"onkeydown",
|
|
4718
|
+
"onkeypress",
|
|
4719
|
+
"onkeyup",
|
|
4720
|
+
"onchange",
|
|
4721
|
+
"oninput",
|
|
4722
|
+
"onsubmit",
|
|
4723
|
+
"onreset",
|
|
4724
|
+
"onselect",
|
|
4725
|
+
"oncontextmenu",
|
|
4726
|
+
"ontouchstart",
|
|
4727
|
+
"ontouchmove",
|
|
4728
|
+
"ontouchend",
|
|
4729
|
+
"ontouchcancel"
|
|
4730
|
+
];
|
|
4630
4731
|
const interactiveElementsRegistry = /* @__PURE__ */ new WeakSet();
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
interactiveElementsRegistry.add(this);
|
|
4639
|
-
}
|
|
4732
|
+
const originalAddEventListener = EventTarget.prototype.addEventListener;
|
|
4733
|
+
EventTarget.prototype.addEventListener = function(type, listener, options) {
|
|
4734
|
+
originalAddEventListener.call(this, type, listener, options);
|
|
4735
|
+
if (this instanceof Element) {
|
|
4736
|
+
const eventType = type.toLowerCase();
|
|
4737
|
+
if (interactiveEvents.includes(eventType)) {
|
|
4738
|
+
interactiveElementsRegistry.add(this);
|
|
4640
4739
|
}
|
|
4641
|
-
}
|
|
4740
|
+
}
|
|
4741
|
+
};
|
|
4742
|
+
const originalRemoveEventListener = EventTarget.prototype.removeEventListener;
|
|
4743
|
+
EventTarget.prototype.removeEventListener = function(type, listener, options) {
|
|
4744
|
+
originalRemoveEventListener.call(this, type, listener, options);
|
|
4745
|
+
};
|
|
4746
|
+
function inspectInlineEventHandlers() {
|
|
4747
|
+
const allElements = document.querySelectorAll("*");
|
|
4748
|
+
allElements.forEach((el) => {
|
|
4749
|
+
inlineEventAttributes.forEach((attr2) => {
|
|
4750
|
+
if (el.hasAttribute(attr2)) {
|
|
4751
|
+
interactiveElementsRegistry.add(el);
|
|
4752
|
+
}
|
|
4753
|
+
});
|
|
4754
|
+
});
|
|
4642
4755
|
}
|
|
4643
|
-
if (
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
if (this instanceof Element) {
|
|
4648
|
-
type.toLowerCase();
|
|
4649
|
-
}
|
|
4650
|
-
};
|
|
4756
|
+
if (document.readyState === "complete" || document.readyState === "interactive") {
|
|
4757
|
+
inspectInlineEventHandlers();
|
|
4758
|
+
} else {
|
|
4759
|
+
document.addEventListener("DOMContentLoaded", inspectInlineEventHandlers);
|
|
4651
4760
|
}
|
|
4652
4761
|
function getDefaultExportFromCjs(x2) {
|
|
4653
4762
|
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
@@ -9603,6 +9712,32 @@ function querySelectorAll(n2, selectors) {
|
|
|
9603
9712
|
function mutationObserverCtor() {
|
|
9604
9713
|
return getUntaintedPrototype("MutationObserver").constructor;
|
|
9605
9714
|
}
|
|
9715
|
+
function patch(source, name, replacement) {
|
|
9716
|
+
try {
|
|
9717
|
+
if (!(name in source)) {
|
|
9718
|
+
return () => {
|
|
9719
|
+
};
|
|
9720
|
+
}
|
|
9721
|
+
const original = source[name];
|
|
9722
|
+
const wrapped = replacement(original);
|
|
9723
|
+
if (typeof wrapped === "function") {
|
|
9724
|
+
wrapped.prototype = wrapped.prototype || {};
|
|
9725
|
+
Object.defineProperties(wrapped, {
|
|
9726
|
+
__rrweb_original__: {
|
|
9727
|
+
enumerable: false,
|
|
9728
|
+
value: original
|
|
9729
|
+
}
|
|
9730
|
+
});
|
|
9731
|
+
}
|
|
9732
|
+
source[name] = wrapped;
|
|
9733
|
+
return () => {
|
|
9734
|
+
source[name] = original;
|
|
9735
|
+
};
|
|
9736
|
+
} catch (e2) {
|
|
9737
|
+
return () => {
|
|
9738
|
+
};
|
|
9739
|
+
}
|
|
9740
|
+
}
|
|
9606
9741
|
const index = {
|
|
9607
9742
|
childNodes,
|
|
9608
9743
|
parentNode,
|
|
@@ -9615,7 +9750,8 @@ const index = {
|
|
|
9615
9750
|
shadowRoot,
|
|
9616
9751
|
querySelector,
|
|
9617
9752
|
querySelectorAll,
|
|
9618
|
-
mutationObserver: mutationObserverCtor
|
|
9753
|
+
mutationObserver: mutationObserverCtor,
|
|
9754
|
+
patch
|
|
9619
9755
|
};
|
|
9620
9756
|
const DEPARTED_MIRROR_ACCESS_WARNING = "Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";
|
|
9621
9757
|
let _mirror = {
|
|
@@ -9834,13 +9970,14 @@ var MouseInteractions = /* @__PURE__ */ ((MouseInteractions2) => {
|
|
|
9834
9970
|
MouseInteractions2[MouseInteractions2["MouseUp"] = 0] = "MouseUp";
|
|
9835
9971
|
MouseInteractions2[MouseInteractions2["MouseDown"] = 1] = "MouseDown";
|
|
9836
9972
|
MouseInteractions2[MouseInteractions2["Click"] = 2] = "Click";
|
|
9837
|
-
MouseInteractions2[MouseInteractions2["
|
|
9838
|
-
MouseInteractions2[MouseInteractions2["
|
|
9839
|
-
MouseInteractions2[MouseInteractions2["
|
|
9840
|
-
MouseInteractions2[MouseInteractions2["
|
|
9841
|
-
MouseInteractions2[MouseInteractions2["
|
|
9842
|
-
MouseInteractions2[MouseInteractions2["
|
|
9843
|
-
MouseInteractions2[MouseInteractions2["
|
|
9973
|
+
MouseInteractions2[MouseInteractions2["ContextMenu"] = 3] = "ContextMenu";
|
|
9974
|
+
MouseInteractions2[MouseInteractions2["DblClick"] = 4] = "DblClick";
|
|
9975
|
+
MouseInteractions2[MouseInteractions2["Focus"] = 5] = "Focus";
|
|
9976
|
+
MouseInteractions2[MouseInteractions2["Blur"] = 6] = "Blur";
|
|
9977
|
+
MouseInteractions2[MouseInteractions2["TouchStart"] = 7] = "TouchStart";
|
|
9978
|
+
MouseInteractions2[MouseInteractions2["TouchMove_Departed"] = 8] = "TouchMove_Departed";
|
|
9979
|
+
MouseInteractions2[MouseInteractions2["TouchEnd"] = 9] = "TouchEnd";
|
|
9980
|
+
MouseInteractions2[MouseInteractions2["TouchCancel"] = 10] = "TouchCancel";
|
|
9844
9981
|
return MouseInteractions2;
|
|
9845
9982
|
})(MouseInteractions || {});
|
|
9846
9983
|
var CanvasContext = /* @__PURE__ */ ((CanvasContext2) => {
|