@kalayanasundaram123/rrweb 2.0.3 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rrweb.cjs +423 -117
- package/dist/rrweb.cjs.map +1 -1
- package/dist/rrweb.js +423 -117
- package/dist/rrweb.js.map +1 -1
- package/dist/rrweb.umd.cjs +424 -117
- package/dist/rrweb.umd.cjs.map +3 -3
- package/dist/rrweb.umd.min.cjs +37 -18
- package/dist/rrweb.umd.min.cjs.map +3 -3
- package/package.json +1 -1
- package/umd/rrweb.js +424 -117
- package/umd/rrweb.min.js +37 -18
package/dist/rrweb.cjs
CHANGED
|
@@ -25,14 +25,18 @@ const testableAccessors$1 = {
|
|
|
25
25
|
"ownerDocument"
|
|
26
26
|
],
|
|
27
27
|
ShadowRoot: ["host", "styleSheets"],
|
|
28
|
-
Element: ["shadowRoot"
|
|
29
|
-
MutationObserver: []
|
|
28
|
+
Element: ["shadowRoot"],
|
|
29
|
+
MutationObserver: [],
|
|
30
|
+
EventTarget: []
|
|
30
31
|
};
|
|
31
32
|
const testableMethods$1 = {
|
|
32
33
|
Node: ["contains", "getRootNode"],
|
|
33
34
|
ShadowRoot: ["getSelection"],
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
// PR #1802: moved from testableAccessors
|
|
36
|
+
Element: ["querySelector", "querySelectorAll"],
|
|
37
|
+
MutationObserver: ["constructor"],
|
|
38
|
+
// PR #1814
|
|
39
|
+
EventTarget: ["addEventListener", "removeEventListener"]
|
|
36
40
|
};
|
|
37
41
|
const untaintedBasePrototype$1 = {};
|
|
38
42
|
const untaintedBaseIframeCleanup$1 = {};
|
|
@@ -157,10 +161,10 @@ function shadowRoot$1(n2) {
|
|
|
157
161
|
return getUntaintedAccessor$1("Element", n2, "shadowRoot");
|
|
158
162
|
}
|
|
159
163
|
function querySelector$1(n2, selectors) {
|
|
160
|
-
return
|
|
164
|
+
return getUntaintedMethod$1("Element", n2, "querySelector")(selectors);
|
|
161
165
|
}
|
|
162
166
|
function querySelectorAll$1(n2, selectors) {
|
|
163
|
-
return
|
|
167
|
+
return getUntaintedMethod$1("Element", n2, "querySelectorAll")(selectors);
|
|
164
168
|
}
|
|
165
169
|
function mutationObserverCtor$1() {
|
|
166
170
|
return [
|
|
@@ -169,10 +173,67 @@ function mutationObserverCtor$1() {
|
|
|
169
173
|
})
|
|
170
174
|
];
|
|
171
175
|
}
|
|
176
|
+
function getUntaintedProxy$1() {
|
|
177
|
+
var _a2;
|
|
178
|
+
let UntaintedProxy = globalThis.Proxy;
|
|
179
|
+
try {
|
|
180
|
+
if (typeof UntaintedProxy !== "function" || !Function.prototype.toString.call(UntaintedProxy).includes("[native code]")) {
|
|
181
|
+
const frame = document.createElement("iframe");
|
|
182
|
+
frame.style.display = "none";
|
|
183
|
+
document.documentElement.appendChild(frame);
|
|
184
|
+
UntaintedProxy = ((_a2 = frame.contentWindow) == null ? void 0 : _a2.Proxy) ?? UntaintedProxy;
|
|
185
|
+
document.documentElement.removeChild(frame);
|
|
186
|
+
}
|
|
187
|
+
} catch {
|
|
188
|
+
}
|
|
189
|
+
return UntaintedProxy;
|
|
190
|
+
}
|
|
172
191
|
let nowTimestamp$1 = Date.now;
|
|
173
192
|
if (!/* @__PURE__ */ /[1-9][0-9]{12}/.test(Date.now().toString())) {
|
|
174
193
|
nowTimestamp$1 = () => (/* @__PURE__ */ new Date()).getTime();
|
|
175
194
|
}
|
|
195
|
+
const _rrwebNativeMap$2 = /* @__PURE__ */ new WeakMap();
|
|
196
|
+
let _nativeToStringStr$2 = "";
|
|
197
|
+
(function _installToStringProxy() {
|
|
198
|
+
var _a2;
|
|
199
|
+
const _nativeToString = Function.prototype.toString;
|
|
200
|
+
_nativeToStringStr$2 = _nativeToString.call(_nativeToString);
|
|
201
|
+
let _Proxy = globalThis.Proxy;
|
|
202
|
+
try {
|
|
203
|
+
if (typeof _Proxy !== "function" || !_nativeToString.call(_Proxy).includes("[native code]")) {
|
|
204
|
+
const frame = document.createElement("iframe");
|
|
205
|
+
frame.style.display = "none";
|
|
206
|
+
document.documentElement.appendChild(frame);
|
|
207
|
+
_Proxy = ((_a2 = frame.contentWindow) == null ? void 0 : _a2.Proxy) ?? _Proxy;
|
|
208
|
+
document.documentElement.removeChild(frame);
|
|
209
|
+
}
|
|
210
|
+
} catch {
|
|
211
|
+
}
|
|
212
|
+
const _fnProto = Object.getPrototypeOf(_nativeToString);
|
|
213
|
+
const _proxy = new _Proxy(_nativeToString, {
|
|
214
|
+
apply(target, thisArg, args) {
|
|
215
|
+
const str = _rrwebNativeMap$2.get(thisArg);
|
|
216
|
+
if (str !== void 0) return str;
|
|
217
|
+
if (thisArg != null && typeof thisArg === "function" && !_fnProto.isPrototypeOf(
|
|
218
|
+
thisArg.toString
|
|
219
|
+
)) {
|
|
220
|
+
return thisArg.toString();
|
|
221
|
+
}
|
|
222
|
+
return target.apply(thisArg, args);
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
_rrwebNativeMap$2.set(_proxy, _nativeToStringStr$2);
|
|
226
|
+
Object.defineProperty(Function.prototype, "toString", {
|
|
227
|
+
value: _proxy,
|
|
228
|
+
configurable: true,
|
|
229
|
+
writable: true
|
|
230
|
+
});
|
|
231
|
+
})();
|
|
232
|
+
function makeNativeFn$1(fn, nativeFn) {
|
|
233
|
+
const name = fn.name || nativeFn.name || "";
|
|
234
|
+
_rrwebNativeMap$2.set(fn, _nativeToStringStr$2.replace("toString", name));
|
|
235
|
+
return fn;
|
|
236
|
+
}
|
|
176
237
|
function patch$1(source, name, replacement) {
|
|
177
238
|
try {
|
|
178
239
|
if (!(name in source)) {
|
|
@@ -189,6 +250,10 @@ function patch$1(source, name, replacement) {
|
|
|
189
250
|
value: original
|
|
190
251
|
}
|
|
191
252
|
});
|
|
253
|
+
_rrwebNativeMap$2.set(
|
|
254
|
+
wrapped,
|
|
255
|
+
_nativeToStringStr$2.replace("toString", name)
|
|
256
|
+
);
|
|
192
257
|
}
|
|
193
258
|
source[name] = wrapped;
|
|
194
259
|
return () => {
|
|
@@ -214,7 +279,9 @@ const index$1 = {
|
|
|
214
279
|
querySelectorAll: querySelectorAll$1,
|
|
215
280
|
nowTimestamp: nowTimestamp$1,
|
|
216
281
|
mutationObserverCtor: mutationObserverCtor$1,
|
|
217
|
-
patch: patch$1
|
|
282
|
+
patch: patch$1,
|
|
283
|
+
makeNativeFn: makeNativeFn$1,
|
|
284
|
+
getUntaintedProxy: getUntaintedProxy$1
|
|
218
285
|
};
|
|
219
286
|
function isElement(n2) {
|
|
220
287
|
return n2.nodeType === n2.ELEMENT_NODE;
|
|
@@ -5758,6 +5825,43 @@ var __defProp22 = Object.defineProperty;
|
|
|
5758
5825
|
var __defNormalProp22 = (obj, key, value) => key in obj ? __defProp22(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5759
5826
|
var __publicField22 = (obj, key, value) => __defNormalProp22(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5760
5827
|
if (!/* @__PURE__ */ /[1-9][0-9]{12}/.test(Date.now().toString())) ;
|
|
5828
|
+
const _rrwebNativeMap$1 = /* @__PURE__ */ new WeakMap();
|
|
5829
|
+
let _nativeToStringStr$1 = "";
|
|
5830
|
+
(function _installToStringProxy2() {
|
|
5831
|
+
var _a2;
|
|
5832
|
+
const _nativeToString = Function.prototype.toString;
|
|
5833
|
+
_nativeToStringStr$1 = _nativeToString.call(_nativeToString);
|
|
5834
|
+
let _Proxy = globalThis.Proxy;
|
|
5835
|
+
try {
|
|
5836
|
+
if (typeof _Proxy !== "function" || !_nativeToString.call(_Proxy).includes("[native code]")) {
|
|
5837
|
+
const frame = document.createElement("iframe");
|
|
5838
|
+
frame.style.display = "none";
|
|
5839
|
+
document.documentElement.appendChild(frame);
|
|
5840
|
+
_Proxy = ((_a2 = frame.contentWindow) == null ? void 0 : _a2.Proxy) ?? _Proxy;
|
|
5841
|
+
document.documentElement.removeChild(frame);
|
|
5842
|
+
}
|
|
5843
|
+
} catch {
|
|
5844
|
+
}
|
|
5845
|
+
const _fnProto = Object.getPrototypeOf(_nativeToString);
|
|
5846
|
+
const _proxy = new _Proxy(_nativeToString, {
|
|
5847
|
+
apply(target, thisArg, args) {
|
|
5848
|
+
const str = _rrwebNativeMap$1.get(thisArg);
|
|
5849
|
+
if (str !== void 0) return str;
|
|
5850
|
+
if (thisArg != null && typeof thisArg === "function" && !_fnProto.isPrototypeOf(
|
|
5851
|
+
thisArg.toString
|
|
5852
|
+
)) {
|
|
5853
|
+
return thisArg.toString();
|
|
5854
|
+
}
|
|
5855
|
+
return target.apply(thisArg, args);
|
|
5856
|
+
}
|
|
5857
|
+
});
|
|
5858
|
+
_rrwebNativeMap$1.set(_proxy, _nativeToStringStr$1);
|
|
5859
|
+
Object.defineProperty(Function.prototype, "toString", {
|
|
5860
|
+
value: _proxy,
|
|
5861
|
+
configurable: true,
|
|
5862
|
+
writable: true
|
|
5863
|
+
});
|
|
5864
|
+
})();
|
|
5761
5865
|
let Mirror$1 = class Mirror2 {
|
|
5762
5866
|
constructor() {
|
|
5763
5867
|
__publicField22(this, "idNodeMap", /* @__PURE__ */ new Map());
|
|
@@ -10850,14 +10954,18 @@ const testableAccessors = {
|
|
|
10850
10954
|
"ownerDocument"
|
|
10851
10955
|
],
|
|
10852
10956
|
ShadowRoot: ["host", "styleSheets"],
|
|
10853
|
-
Element: ["shadowRoot"
|
|
10854
|
-
MutationObserver: []
|
|
10957
|
+
Element: ["shadowRoot"],
|
|
10958
|
+
MutationObserver: [],
|
|
10959
|
+
EventTarget: []
|
|
10855
10960
|
};
|
|
10856
10961
|
const testableMethods = {
|
|
10857
10962
|
Node: ["contains", "getRootNode"],
|
|
10858
10963
|
ShadowRoot: ["getSelection"],
|
|
10859
|
-
|
|
10860
|
-
|
|
10964
|
+
// PR #1802: moved from testableAccessors
|
|
10965
|
+
Element: ["querySelector", "querySelectorAll"],
|
|
10966
|
+
MutationObserver: ["constructor"],
|
|
10967
|
+
// PR #1814
|
|
10968
|
+
EventTarget: ["addEventListener", "removeEventListener"]
|
|
10861
10969
|
};
|
|
10862
10970
|
const untaintedBasePrototype = {};
|
|
10863
10971
|
const untaintedBaseIframeCleanup = {};
|
|
@@ -10982,10 +11090,10 @@ function shadowRoot(n2) {
|
|
|
10982
11090
|
return getUntaintedAccessor("Element", n2, "shadowRoot");
|
|
10983
11091
|
}
|
|
10984
11092
|
function querySelector(n2, selectors) {
|
|
10985
|
-
return
|
|
11093
|
+
return getUntaintedMethod("Element", n2, "querySelector")(selectors);
|
|
10986
11094
|
}
|
|
10987
11095
|
function querySelectorAll(n2, selectors) {
|
|
10988
|
-
return
|
|
11096
|
+
return getUntaintedMethod("Element", n2, "querySelectorAll")(selectors);
|
|
10989
11097
|
}
|
|
10990
11098
|
function mutationObserverCtor() {
|
|
10991
11099
|
return [
|
|
@@ -10994,10 +11102,67 @@ function mutationObserverCtor() {
|
|
|
10994
11102
|
})
|
|
10995
11103
|
];
|
|
10996
11104
|
}
|
|
11105
|
+
function getUntaintedProxy() {
|
|
11106
|
+
var _a2;
|
|
11107
|
+
let UntaintedProxy = globalThis.Proxy;
|
|
11108
|
+
try {
|
|
11109
|
+
if (typeof UntaintedProxy !== "function" || !Function.prototype.toString.call(UntaintedProxy).includes("[native code]")) {
|
|
11110
|
+
const frame = document.createElement("iframe");
|
|
11111
|
+
frame.style.display = "none";
|
|
11112
|
+
document.documentElement.appendChild(frame);
|
|
11113
|
+
UntaintedProxy = ((_a2 = frame.contentWindow) == null ? void 0 : _a2.Proxy) ?? UntaintedProxy;
|
|
11114
|
+
document.documentElement.removeChild(frame);
|
|
11115
|
+
}
|
|
11116
|
+
} catch {
|
|
11117
|
+
}
|
|
11118
|
+
return UntaintedProxy;
|
|
11119
|
+
}
|
|
10997
11120
|
let nowTimestamp = Date.now;
|
|
10998
11121
|
if (!/* @__PURE__ */ /[1-9][0-9]{12}/.test(Date.now().toString())) {
|
|
10999
11122
|
nowTimestamp = () => (/* @__PURE__ */ new Date()).getTime();
|
|
11000
11123
|
}
|
|
11124
|
+
const _rrwebNativeMap = /* @__PURE__ */ new WeakMap();
|
|
11125
|
+
let _nativeToStringStr = "";
|
|
11126
|
+
(function _installToStringProxy3() {
|
|
11127
|
+
var _a2;
|
|
11128
|
+
const _nativeToString = Function.prototype.toString;
|
|
11129
|
+
_nativeToStringStr = _nativeToString.call(_nativeToString);
|
|
11130
|
+
let _Proxy = globalThis.Proxy;
|
|
11131
|
+
try {
|
|
11132
|
+
if (typeof _Proxy !== "function" || !_nativeToString.call(_Proxy).includes("[native code]")) {
|
|
11133
|
+
const frame = document.createElement("iframe");
|
|
11134
|
+
frame.style.display = "none";
|
|
11135
|
+
document.documentElement.appendChild(frame);
|
|
11136
|
+
_Proxy = ((_a2 = frame.contentWindow) == null ? void 0 : _a2.Proxy) ?? _Proxy;
|
|
11137
|
+
document.documentElement.removeChild(frame);
|
|
11138
|
+
}
|
|
11139
|
+
} catch {
|
|
11140
|
+
}
|
|
11141
|
+
const _fnProto = Object.getPrototypeOf(_nativeToString);
|
|
11142
|
+
const _proxy = new _Proxy(_nativeToString, {
|
|
11143
|
+
apply(target, thisArg, args) {
|
|
11144
|
+
const str = _rrwebNativeMap.get(thisArg);
|
|
11145
|
+
if (str !== void 0) return str;
|
|
11146
|
+
if (thisArg != null && typeof thisArg === "function" && !_fnProto.isPrototypeOf(
|
|
11147
|
+
thisArg.toString
|
|
11148
|
+
)) {
|
|
11149
|
+
return thisArg.toString();
|
|
11150
|
+
}
|
|
11151
|
+
return target.apply(thisArg, args);
|
|
11152
|
+
}
|
|
11153
|
+
});
|
|
11154
|
+
_rrwebNativeMap.set(_proxy, _nativeToStringStr);
|
|
11155
|
+
Object.defineProperty(Function.prototype, "toString", {
|
|
11156
|
+
value: _proxy,
|
|
11157
|
+
configurable: true,
|
|
11158
|
+
writable: true
|
|
11159
|
+
});
|
|
11160
|
+
})();
|
|
11161
|
+
function makeNativeFn(fn, nativeFn) {
|
|
11162
|
+
const name = fn.name || nativeFn.name || "";
|
|
11163
|
+
_rrwebNativeMap.set(fn, _nativeToStringStr.replace("toString", name));
|
|
11164
|
+
return fn;
|
|
11165
|
+
}
|
|
11001
11166
|
function patch(source, name, replacement) {
|
|
11002
11167
|
try {
|
|
11003
11168
|
if (!(name in source)) {
|
|
@@ -11014,6 +11179,10 @@ function patch(source, name, replacement) {
|
|
|
11014
11179
|
value: original
|
|
11015
11180
|
}
|
|
11016
11181
|
});
|
|
11182
|
+
_rrwebNativeMap.set(
|
|
11183
|
+
wrapped,
|
|
11184
|
+
_nativeToStringStr.replace("toString", name)
|
|
11185
|
+
);
|
|
11017
11186
|
}
|
|
11018
11187
|
source[name] = wrapped;
|
|
11019
11188
|
return () => {
|
|
@@ -11039,12 +11208,23 @@ const index = {
|
|
|
11039
11208
|
querySelectorAll,
|
|
11040
11209
|
nowTimestamp,
|
|
11041
11210
|
mutationObserverCtor,
|
|
11042
|
-
patch
|
|
11211
|
+
patch,
|
|
11212
|
+
makeNativeFn,
|
|
11213
|
+
getUntaintedProxy
|
|
11043
11214
|
};
|
|
11044
11215
|
function on(type, fn, target = document) {
|
|
11045
11216
|
const options = { capture: true, passive: true };
|
|
11046
|
-
|
|
11047
|
-
|
|
11217
|
+
const eventTarget = target;
|
|
11218
|
+
getUntaintedMethod("EventTarget", eventTarget, "addEventListener")(
|
|
11219
|
+
type,
|
|
11220
|
+
fn,
|
|
11221
|
+
options
|
|
11222
|
+
);
|
|
11223
|
+
return () => getUntaintedMethod("EventTarget", eventTarget, "removeEventListener")(
|
|
11224
|
+
type,
|
|
11225
|
+
fn,
|
|
11226
|
+
options
|
|
11227
|
+
);
|
|
11048
11228
|
}
|
|
11049
11229
|
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.";
|
|
11050
11230
|
exports.mirror = {
|
|
@@ -11106,20 +11286,27 @@ function throttle(func, wait, options = {}) {
|
|
|
11106
11286
|
}
|
|
11107
11287
|
function hookSetter(target, key, d, isRevoked, win = window) {
|
|
11108
11288
|
const original = win.Object.getOwnPropertyDescriptor(target, key);
|
|
11109
|
-
|
|
11110
|
-
|
|
11111
|
-
|
|
11112
|
-
|
|
11113
|
-
|
|
11289
|
+
if (!isRevoked && (original == null ? void 0 : original.set)) {
|
|
11290
|
+
const hookedSetter = function(value) {
|
|
11291
|
+
setTimeout(() => {
|
|
11292
|
+
d.set.call(this, value);
|
|
11293
|
+
}, 0);
|
|
11294
|
+
original.set.call(this, value);
|
|
11295
|
+
};
|
|
11296
|
+
makeNativeFn(hookedSetter, original.set);
|
|
11297
|
+
win.Object.defineProperty(target, key, { set: hookedSetter });
|
|
11298
|
+
} else {
|
|
11299
|
+
win.Object.defineProperty(
|
|
11300
|
+
target,
|
|
11301
|
+
key,
|
|
11302
|
+
isRevoked ? d : { set(value) {
|
|
11114
11303
|
setTimeout(() => {
|
|
11115
11304
|
d.set.call(this, value);
|
|
11116
11305
|
}, 0);
|
|
11117
|
-
if (original && original.set)
|
|
11118
|
-
|
|
11119
|
-
|
|
11120
|
-
|
|
11121
|
-
}
|
|
11122
|
-
);
|
|
11306
|
+
if (original && original.set) original.set.call(this, value);
|
|
11307
|
+
} }
|
|
11308
|
+
);
|
|
11309
|
+
}
|
|
11123
11310
|
return () => hookSetter(target, key, original || {}, true);
|
|
11124
11311
|
}
|
|
11125
11312
|
function getWindowScroll(win) {
|
|
@@ -12147,6 +12334,7 @@ const callbackWrapper = (cb) => {
|
|
|
12147
12334
|
};
|
|
12148
12335
|
return rrwebWrapped;
|
|
12149
12336
|
};
|
|
12337
|
+
const Proxy$1 = getUntaintedProxy();
|
|
12150
12338
|
const mutationBuffers = [];
|
|
12151
12339
|
function getEventTarget(event) {
|
|
12152
12340
|
try {
|
|
@@ -12550,61 +12738,11 @@ function initStyleSheetObserver({ styleSheetRuleCb, mirror: mirror2, stylesheetM
|
|
|
12550
12738
|
};
|
|
12551
12739
|
}
|
|
12552
12740
|
const insertRule = win.CSSStyleSheet.prototype.insertRule;
|
|
12553
|
-
win.CSSStyleSheet.prototype.insertRule =
|
|
12554
|
-
|
|
12555
|
-
(target, thisArg, argumentsList) => {
|
|
12556
|
-
const [rule2, index2] = argumentsList;
|
|
12557
|
-
const { id, styleId } = getIdAndStyleId(
|
|
12558
|
-
thisArg,
|
|
12559
|
-
mirror2,
|
|
12560
|
-
stylesheetManager.styleMirror
|
|
12561
|
-
);
|
|
12562
|
-
if (id && id !== -1 || styleId && styleId !== -1) {
|
|
12563
|
-
styleSheetRuleCb({
|
|
12564
|
-
id,
|
|
12565
|
-
styleId,
|
|
12566
|
-
adds: [{ rule: rule2, index: index2 }]
|
|
12567
|
-
});
|
|
12568
|
-
}
|
|
12569
|
-
return target.apply(thisArg, argumentsList);
|
|
12570
|
-
}
|
|
12571
|
-
)
|
|
12572
|
-
});
|
|
12573
|
-
win.CSSStyleSheet.prototype.addRule = function(selector, styleBlock, index2 = this.cssRules.length) {
|
|
12574
|
-
const rule2 = `${selector} { ${styleBlock} }`;
|
|
12575
|
-
return win.CSSStyleSheet.prototype.insertRule.apply(this, [rule2, index2]);
|
|
12576
|
-
};
|
|
12577
|
-
const deleteRule = win.CSSStyleSheet.prototype.deleteRule;
|
|
12578
|
-
win.CSSStyleSheet.prototype.deleteRule = new Proxy(deleteRule, {
|
|
12579
|
-
apply: callbackWrapper(
|
|
12580
|
-
(target, thisArg, argumentsList) => {
|
|
12581
|
-
const [index2] = argumentsList;
|
|
12582
|
-
const { id, styleId } = getIdAndStyleId(
|
|
12583
|
-
thisArg,
|
|
12584
|
-
mirror2,
|
|
12585
|
-
stylesheetManager.styleMirror
|
|
12586
|
-
);
|
|
12587
|
-
if (id && id !== -1 || styleId && styleId !== -1) {
|
|
12588
|
-
styleSheetRuleCb({
|
|
12589
|
-
id,
|
|
12590
|
-
styleId,
|
|
12591
|
-
removes: [{ index: index2 }]
|
|
12592
|
-
});
|
|
12593
|
-
}
|
|
12594
|
-
return target.apply(thisArg, argumentsList);
|
|
12595
|
-
}
|
|
12596
|
-
)
|
|
12597
|
-
});
|
|
12598
|
-
win.CSSStyleSheet.prototype.removeRule = function(index2) {
|
|
12599
|
-
return win.CSSStyleSheet.prototype.deleteRule.apply(this, [index2]);
|
|
12600
|
-
};
|
|
12601
|
-
let replace;
|
|
12602
|
-
if (win.CSSStyleSheet.prototype.replace) {
|
|
12603
|
-
replace = win.CSSStyleSheet.prototype.replace;
|
|
12604
|
-
win.CSSStyleSheet.prototype.replace = new Proxy(replace, {
|
|
12741
|
+
win.CSSStyleSheet.prototype.insertRule = makeNativeFn(
|
|
12742
|
+
new Proxy$1(insertRule, {
|
|
12605
12743
|
apply: callbackWrapper(
|
|
12606
12744
|
(target, thisArg, argumentsList) => {
|
|
12607
|
-
const [
|
|
12745
|
+
const [rule2, index2] = argumentsList;
|
|
12608
12746
|
const { id, styleId } = getIdAndStyleId(
|
|
12609
12747
|
thisArg,
|
|
12610
12748
|
mirror2,
|
|
@@ -12614,21 +12752,28 @@ function initStyleSheetObserver({ styleSheetRuleCb, mirror: mirror2, stylesheetM
|
|
|
12614
12752
|
styleSheetRuleCb({
|
|
12615
12753
|
id,
|
|
12616
12754
|
styleId,
|
|
12617
|
-
|
|
12755
|
+
adds: [{ rule: rule2, index: index2 }]
|
|
12618
12756
|
});
|
|
12619
12757
|
}
|
|
12620
12758
|
return target.apply(thisArg, argumentsList);
|
|
12621
12759
|
}
|
|
12622
12760
|
)
|
|
12623
|
-
})
|
|
12624
|
-
|
|
12625
|
-
|
|
12626
|
-
|
|
12627
|
-
|
|
12628
|
-
|
|
12761
|
+
}),
|
|
12762
|
+
insertRule
|
|
12763
|
+
);
|
|
12764
|
+
win.CSSStyleSheet.prototype.addRule = makeNativeFn(
|
|
12765
|
+
function(selector, styleBlock, index2 = this.cssRules.length) {
|
|
12766
|
+
const rule2 = `${selector} { ${styleBlock} }`;
|
|
12767
|
+
return win.CSSStyleSheet.prototype.insertRule.apply(this, [rule2, index2]);
|
|
12768
|
+
},
|
|
12769
|
+
insertRule
|
|
12770
|
+
);
|
|
12771
|
+
const deleteRule = win.CSSStyleSheet.prototype.deleteRule;
|
|
12772
|
+
win.CSSStyleSheet.prototype.deleteRule = makeNativeFn(
|
|
12773
|
+
new Proxy$1(deleteRule, {
|
|
12629
12774
|
apply: callbackWrapper(
|
|
12630
12775
|
(target, thisArg, argumentsList) => {
|
|
12631
|
-
const [
|
|
12776
|
+
const [index2] = argumentsList;
|
|
12632
12777
|
const { id, styleId } = getIdAndStyleId(
|
|
12633
12778
|
thisArg,
|
|
12634
12779
|
mirror2,
|
|
@@ -12638,13 +12783,74 @@ function initStyleSheetObserver({ styleSheetRuleCb, mirror: mirror2, stylesheetM
|
|
|
12638
12783
|
styleSheetRuleCb({
|
|
12639
12784
|
id,
|
|
12640
12785
|
styleId,
|
|
12641
|
-
|
|
12786
|
+
removes: [{ index: index2 }]
|
|
12642
12787
|
});
|
|
12643
12788
|
}
|
|
12644
12789
|
return target.apply(thisArg, argumentsList);
|
|
12645
12790
|
}
|
|
12646
12791
|
)
|
|
12647
|
-
})
|
|
12792
|
+
}),
|
|
12793
|
+
deleteRule
|
|
12794
|
+
);
|
|
12795
|
+
win.CSSStyleSheet.prototype.removeRule = makeNativeFn(
|
|
12796
|
+
function(index2) {
|
|
12797
|
+
return win.CSSStyleSheet.prototype.deleteRule.apply(this, [index2]);
|
|
12798
|
+
},
|
|
12799
|
+
deleteRule
|
|
12800
|
+
);
|
|
12801
|
+
let replace;
|
|
12802
|
+
if (win.CSSStyleSheet.prototype.replace) {
|
|
12803
|
+
replace = win.CSSStyleSheet.prototype.replace;
|
|
12804
|
+
win.CSSStyleSheet.prototype.replace = makeNativeFn(
|
|
12805
|
+
new Proxy$1(replace, {
|
|
12806
|
+
apply: callbackWrapper(
|
|
12807
|
+
(target, thisArg, argumentsList) => {
|
|
12808
|
+
const [text] = argumentsList;
|
|
12809
|
+
const { id, styleId } = getIdAndStyleId(
|
|
12810
|
+
thisArg,
|
|
12811
|
+
mirror2,
|
|
12812
|
+
stylesheetManager.styleMirror
|
|
12813
|
+
);
|
|
12814
|
+
if (id && id !== -1 || styleId && styleId !== -1) {
|
|
12815
|
+
styleSheetRuleCb({
|
|
12816
|
+
id,
|
|
12817
|
+
styleId,
|
|
12818
|
+
replace: text
|
|
12819
|
+
});
|
|
12820
|
+
}
|
|
12821
|
+
return target.apply(thisArg, argumentsList);
|
|
12822
|
+
}
|
|
12823
|
+
)
|
|
12824
|
+
}),
|
|
12825
|
+
replace
|
|
12826
|
+
);
|
|
12827
|
+
}
|
|
12828
|
+
let replaceSync;
|
|
12829
|
+
if (win.CSSStyleSheet.prototype.replaceSync) {
|
|
12830
|
+
replaceSync = win.CSSStyleSheet.prototype.replaceSync;
|
|
12831
|
+
win.CSSStyleSheet.prototype.replaceSync = makeNativeFn(
|
|
12832
|
+
new Proxy$1(replaceSync, {
|
|
12833
|
+
apply: callbackWrapper(
|
|
12834
|
+
(target, thisArg, argumentsList) => {
|
|
12835
|
+
const [text] = argumentsList;
|
|
12836
|
+
const { id, styleId } = getIdAndStyleId(
|
|
12837
|
+
thisArg,
|
|
12838
|
+
mirror2,
|
|
12839
|
+
stylesheetManager.styleMirror
|
|
12840
|
+
);
|
|
12841
|
+
if (id && id !== -1 || styleId && styleId !== -1) {
|
|
12842
|
+
styleSheetRuleCb({
|
|
12843
|
+
id,
|
|
12844
|
+
styleId,
|
|
12845
|
+
replaceSync: text
|
|
12846
|
+
});
|
|
12847
|
+
}
|
|
12848
|
+
return target.apply(thisArg, argumentsList);
|
|
12849
|
+
}
|
|
12850
|
+
)
|
|
12851
|
+
}),
|
|
12852
|
+
replaceSync
|
|
12853
|
+
);
|
|
12648
12854
|
}
|
|
12649
12855
|
const supportedNestedCSSRuleTypes = {};
|
|
12650
12856
|
if (canMonkeyPatchNestedCSSRule("CSSGroupingRule")) {
|
|
@@ -12668,9 +12874,8 @@ function initStyleSheetObserver({ styleSheetRuleCb, mirror: mirror2, stylesheetM
|
|
|
12668
12874
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
12669
12875
|
deleteRule: type.prototype.deleteRule
|
|
12670
12876
|
};
|
|
12671
|
-
type.prototype.insertRule =
|
|
12672
|
-
unmodifiedFunctions[typeKey].insertRule,
|
|
12673
|
-
{
|
|
12877
|
+
type.prototype.insertRule = makeNativeFn(
|
|
12878
|
+
new Proxy$1(unmodifiedFunctions[typeKey].insertRule, {
|
|
12674
12879
|
apply: callbackWrapper(
|
|
12675
12880
|
(target, thisArg, argumentsList) => {
|
|
12676
12881
|
const [rule2, index2] = argumentsList;
|
|
@@ -12698,11 +12903,11 @@ function initStyleSheetObserver({ styleSheetRuleCb, mirror: mirror2, stylesheetM
|
|
|
12698
12903
|
return target.apply(thisArg, argumentsList);
|
|
12699
12904
|
}
|
|
12700
12905
|
)
|
|
12701
|
-
}
|
|
12906
|
+
}),
|
|
12907
|
+
unmodifiedFunctions[typeKey].insertRule
|
|
12702
12908
|
);
|
|
12703
|
-
type.prototype.deleteRule =
|
|
12704
|
-
unmodifiedFunctions[typeKey].deleteRule,
|
|
12705
|
-
{
|
|
12909
|
+
type.prototype.deleteRule = makeNativeFn(
|
|
12910
|
+
new Proxy$1(unmodifiedFunctions[typeKey].deleteRule, {
|
|
12706
12911
|
apply: callbackWrapper(
|
|
12707
12912
|
(target, thisArg, argumentsList) => {
|
|
12708
12913
|
const [index2] = argumentsList;
|
|
@@ -12723,7 +12928,8 @@ function initStyleSheetObserver({ styleSheetRuleCb, mirror: mirror2, stylesheetM
|
|
|
12723
12928
|
return target.apply(thisArg, argumentsList);
|
|
12724
12929
|
}
|
|
12725
12930
|
)
|
|
12726
|
-
}
|
|
12931
|
+
}),
|
|
12932
|
+
unmodifiedFunctions[typeKey].deleteRule
|
|
12727
12933
|
);
|
|
12728
12934
|
});
|
|
12729
12935
|
return callbackWrapper(() => {
|
|
@@ -12790,7 +12996,7 @@ function initStyleDeclarationObserver({
|
|
|
12790
12996
|
stylesheetManager
|
|
12791
12997
|
}, { win }) {
|
|
12792
12998
|
const setProperty = win.CSSStyleDeclaration.prototype.setProperty;
|
|
12793
|
-
win.CSSStyleDeclaration.prototype.setProperty = new Proxy(setProperty, {
|
|
12999
|
+
win.CSSStyleDeclaration.prototype.setProperty = new Proxy$1(setProperty, {
|
|
12794
13000
|
apply: callbackWrapper(
|
|
12795
13001
|
(target, thisArg, argumentsList) => {
|
|
12796
13002
|
var _a2;
|
|
@@ -12821,7 +13027,7 @@ function initStyleDeclarationObserver({
|
|
|
12821
13027
|
)
|
|
12822
13028
|
});
|
|
12823
13029
|
const removeProperty = win.CSSStyleDeclaration.prototype.removeProperty;
|
|
12824
|
-
win.CSSStyleDeclaration.prototype.removeProperty = new Proxy(removeProperty, {
|
|
13030
|
+
win.CSSStyleDeclaration.prototype.removeProperty = new Proxy$1(removeProperty, {
|
|
12825
13031
|
apply: callbackWrapper(
|
|
12826
13032
|
(target, thisArg, argumentsList) => {
|
|
12827
13033
|
var _a2;
|
|
@@ -12903,16 +13109,19 @@ function initFontObserver({ fontCb, doc }) {
|
|
|
12903
13109
|
const handlers = [];
|
|
12904
13110
|
const fontMap = /* @__PURE__ */ new WeakMap();
|
|
12905
13111
|
const originalFontFace = win.FontFace;
|
|
12906
|
-
win.FontFace =
|
|
12907
|
-
|
|
12908
|
-
|
|
12909
|
-
|
|
12910
|
-
|
|
12911
|
-
|
|
12912
|
-
|
|
12913
|
-
|
|
12914
|
-
|
|
12915
|
-
|
|
13112
|
+
win.FontFace = makeNativeFn(
|
|
13113
|
+
function FontFace2(family, source, descriptors) {
|
|
13114
|
+
const fontFace = new originalFontFace(family, source, descriptors);
|
|
13115
|
+
fontMap.set(fontFace, {
|
|
13116
|
+
family,
|
|
13117
|
+
buffer: typeof source !== "string",
|
|
13118
|
+
descriptors,
|
|
13119
|
+
fontSource: typeof source === "string" ? source : JSON.stringify(Array.from(new Uint8Array(source)))
|
|
13120
|
+
});
|
|
13121
|
+
return fontFace;
|
|
13122
|
+
},
|
|
13123
|
+
originalFontFace
|
|
13124
|
+
);
|
|
12916
13125
|
const restoreHandler = patch(
|
|
12917
13126
|
doc.fonts,
|
|
12918
13127
|
"add",
|
|
@@ -13225,7 +13434,7 @@ class CrossOriginIframeMirror {
|
|
|
13225
13434
|
return remoteIdToIdMap;
|
|
13226
13435
|
}
|
|
13227
13436
|
}
|
|
13228
|
-
class
|
|
13437
|
+
const _IframeManager = class _IframeManager {
|
|
13229
13438
|
constructor(options) {
|
|
13230
13439
|
__publicField(this, "iframes", /* @__PURE__ */ new WeakMap());
|
|
13231
13440
|
__publicField(this, "crossOriginIframeMap", /* @__PURE__ */ new WeakMap());
|
|
@@ -13238,6 +13447,9 @@ class IframeManager {
|
|
|
13238
13447
|
__publicField(this, "loadListener");
|
|
13239
13448
|
__publicField(this, "stylesheetManager");
|
|
13240
13449
|
__publicField(this, "recordCrossOriginIframes");
|
|
13450
|
+
// Loop detection: track rapid re-navigations per iframe to prevent CPU spikes
|
|
13451
|
+
// from redirect loops (e.g. OAuth silent-refresh frames that can't complete auth).
|
|
13452
|
+
__publicField(this, "iframeNavStats", /* @__PURE__ */ new WeakMap());
|
|
13241
13453
|
this.mutationCb = options.mutationCb;
|
|
13242
13454
|
this.wrappedEmit = options.wrappedEmit;
|
|
13243
13455
|
this.stylesheetManager = options.stylesheetManager;
|
|
@@ -13260,6 +13472,21 @@ class IframeManager {
|
|
|
13260
13472
|
addLoadListener(cb) {
|
|
13261
13473
|
this.loadListener = cb;
|
|
13262
13474
|
}
|
|
13475
|
+
isIframeLooping(iframeEl) {
|
|
13476
|
+
const now = Date.now();
|
|
13477
|
+
const stats = this.iframeNavStats.get(iframeEl);
|
|
13478
|
+
if (!stats || now - stats.windowStart > _IframeManager.LOOP_NAV_WINDOW_MS) {
|
|
13479
|
+
this.iframeNavStats.set(iframeEl, { count: 1, windowStart: now });
|
|
13480
|
+
return false;
|
|
13481
|
+
}
|
|
13482
|
+
stats.count++;
|
|
13483
|
+
if (stats.count > _IframeManager.LOOP_NAV_LIMIT) {
|
|
13484
|
+
stats.windowStart = now;
|
|
13485
|
+
stats.count = 0;
|
|
13486
|
+
return true;
|
|
13487
|
+
}
|
|
13488
|
+
return false;
|
|
13489
|
+
}
|
|
13263
13490
|
attachIframe(iframeEl, childSn) {
|
|
13264
13491
|
var _a2, _b;
|
|
13265
13492
|
this.mutationCb({
|
|
@@ -13280,7 +13507,9 @@ class IframeManager {
|
|
|
13280
13507
|
"message",
|
|
13281
13508
|
this.handleMessage.bind(this)
|
|
13282
13509
|
);
|
|
13283
|
-
(
|
|
13510
|
+
if (!this.isIframeLooping(iframeEl)) {
|
|
13511
|
+
(_b = this.loadListener) == null ? void 0 : _b.call(this, iframeEl);
|
|
13512
|
+
}
|
|
13284
13513
|
if (iframeEl.contentDocument && iframeEl.contentDocument.adoptedStyleSheets && iframeEl.contentDocument.adoptedStyleSheets.length > 0)
|
|
13285
13514
|
this.stylesheetManager.adoptStyleSheets(
|
|
13286
13515
|
iframeEl.contentDocument.adoptedStyleSheets,
|
|
@@ -13458,7 +13687,10 @@ class IframeManager {
|
|
|
13458
13687
|
});
|
|
13459
13688
|
}
|
|
13460
13689
|
}
|
|
13461
|
-
}
|
|
13690
|
+
};
|
|
13691
|
+
__publicField(_IframeManager, "LOOP_NAV_LIMIT", 5);
|
|
13692
|
+
__publicField(_IframeManager, "LOOP_NAV_WINDOW_MS", 3e3);
|
|
13693
|
+
let IframeManager = _IframeManager;
|
|
13462
13694
|
class ShadowDomManager {
|
|
13463
13695
|
constructor(options) {
|
|
13464
13696
|
__publicField(this, "shadowDoms", /* @__PURE__ */ new WeakSet());
|
|
@@ -13950,6 +14182,26 @@ function fnv1aHash(buffer) {
|
|
|
13950
14182
|
function canSnapshotCanvas() {
|
|
13951
14183
|
return typeof OffscreenCanvas !== "undefined";
|
|
13952
14184
|
}
|
|
14185
|
+
const FPS_WORKER_SOURCE = `
|
|
14186
|
+
var _C='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
14187
|
+
function _enc(ab){var b=new Uint8Array(ab),i,n=b.length,o='';for(i=0;i<n;i+=3){o+=_C[b[i]>>2];o+=_C[(b[i]&3)<<4|b[i+1]>>4];o+=_C[(b[i+1]&15)<<2|b[i+2]>>6];o+=_C[b[i+2]&63];}if(n%3===2){o=o.substring(0,o.length-1)+'=';}else if(n%3===1){o=o.substring(0,o.length-2)+'==';}return o;}
|
|
14188
|
+
function _fp(ab){var v=new Uint8Array(ab),h=0x811c9dc5;for(var i=0;i<v.length;i++){h^=v[i];h=(h*0x01000193)|0;}return (h>>>0).toString(16);}
|
|
14189
|
+
var _last=new Map(),_cv=null,_ctx=null;
|
|
14190
|
+
self.onmessage=async function(e){
|
|
14191
|
+
var d=e.data,id=d.id,bm=d.bitmap,w=d.width,h=d.height,opt=d.dataURLOptions;
|
|
14192
|
+
try{
|
|
14193
|
+
if(!('OffscreenCanvas' in self)){bm.close();return self.postMessage({id:id});}
|
|
14194
|
+
if(!_cv||_cv.width!==w||_cv.height!==h){_cv=new OffscreenCanvas(w,h);_ctx=_cv.getContext('2d');}
|
|
14195
|
+
_ctx.clearRect(0,0,w,h);_ctx.drawImage(bm,0,0);bm.close();
|
|
14196
|
+
var blob=await _cv.convertToBlob(opt);
|
|
14197
|
+
var buf=await blob.arrayBuffer();
|
|
14198
|
+
var fp=_fp(buf);
|
|
14199
|
+
if(_last.get(id)===fp)return self.postMessage({id:id});
|
|
14200
|
+
_last.set(id,fp);
|
|
14201
|
+
self.postMessage({id:id,type:blob.type,base64:_enc(buf),width:w,height:h});
|
|
14202
|
+
}catch(err){try{bm.close();}catch(_){}self.postMessage({id:id});}
|
|
14203
|
+
};
|
|
14204
|
+
`;
|
|
13953
14205
|
class CanvasManager {
|
|
13954
14206
|
constructor(options) {
|
|
13955
14207
|
__publicField(this, "pendingCanvasMutations", /* @__PURE__ */ new Map());
|
|
@@ -13972,6 +14224,9 @@ class CanvasManager {
|
|
|
13972
14224
|
__publicField(this, "lastFingerprintMap", /* @__PURE__ */ new Map());
|
|
13973
14225
|
__publicField(this, "snapshotCanvas", null);
|
|
13974
14226
|
__publicField(this, "snapshotCtx", null);
|
|
14227
|
+
// Encode worker (created from a `data:` URL). null => encode on the main
|
|
14228
|
+
// thread instead (worker unavailable or blocked by CSP).
|
|
14229
|
+
__publicField(this, "worker", null);
|
|
13975
14230
|
__publicField(this, "lastSnapshotTime", 0);
|
|
13976
14231
|
__publicField(this, "processMutation", (target, mutation) => {
|
|
13977
14232
|
const newFrame = this.rafStamps.invokeId && this.rafStamps.latestId !== this.rafStamps.invokeId;
|
|
@@ -13993,10 +14248,12 @@ class CanvasManager {
|
|
|
13993
14248
|
this.startPendingCanvasMutationFlusher();
|
|
13994
14249
|
}
|
|
13995
14250
|
if (recordCanvas && typeof sampling === "number" && canSnapshotCanvas()) {
|
|
14251
|
+
this.worker = this.initFPSWorker();
|
|
13996
14252
|
this.initCanvasFPSObserver();
|
|
13997
14253
|
}
|
|
13998
14254
|
}
|
|
13999
14255
|
reset() {
|
|
14256
|
+
var _a2;
|
|
14000
14257
|
this.pendingCanvasMutations.clear();
|
|
14001
14258
|
this.restoreHandlers.forEach((handler) => {
|
|
14002
14259
|
try {
|
|
@@ -14012,6 +14269,8 @@ class CanvasManager {
|
|
|
14012
14269
|
this.lastFingerprintMap = /* @__PURE__ */ new Map();
|
|
14013
14270
|
this.snapshotCanvas = null;
|
|
14014
14271
|
this.snapshotCtx = null;
|
|
14272
|
+
(_a2 = this.worker) == null ? void 0 : _a2.terminate();
|
|
14273
|
+
this.worker = null;
|
|
14015
14274
|
}
|
|
14016
14275
|
freeze() {
|
|
14017
14276
|
this.frozen = true;
|
|
@@ -14025,6 +14284,29 @@ class CanvasManager {
|
|
|
14025
14284
|
unlock() {
|
|
14026
14285
|
this.locked = false;
|
|
14027
14286
|
}
|
|
14287
|
+
initFPSWorker() {
|
|
14288
|
+
try {
|
|
14289
|
+
const worker = new Worker(
|
|
14290
|
+
"data:application/javascript;charset=utf-8," + encodeURIComponent(FPS_WORKER_SOURCE)
|
|
14291
|
+
);
|
|
14292
|
+
worker.onmessage = (e2) => {
|
|
14293
|
+
const data = e2.data;
|
|
14294
|
+
const { id } = data;
|
|
14295
|
+
this.snapshotInProgressMap.set(id, false);
|
|
14296
|
+
if (data.base64 === void 0) return;
|
|
14297
|
+
this.emitCanvasSnapshot(
|
|
14298
|
+
id,
|
|
14299
|
+
data.base64,
|
|
14300
|
+
data.type || "image/png",
|
|
14301
|
+
data.width || 0,
|
|
14302
|
+
data.height || 0
|
|
14303
|
+
);
|
|
14304
|
+
};
|
|
14305
|
+
return worker;
|
|
14306
|
+
} catch {
|
|
14307
|
+
return null;
|
|
14308
|
+
}
|
|
14309
|
+
}
|
|
14028
14310
|
/**
|
|
14029
14311
|
* Begin observing canvas activity inside `win` — the top window, or the
|
|
14030
14312
|
* `contentWindow` of a same-origin iframe. De-duplicated, so it is safe to
|
|
@@ -14231,9 +14513,22 @@ class CanvasManager {
|
|
|
14231
14513
|
}
|
|
14232
14514
|
const width = canvas.width;
|
|
14233
14515
|
const height = canvas.height;
|
|
14234
|
-
createImageBitmap(canvas).then(
|
|
14235
|
-
(
|
|
14236
|
-
|
|
14516
|
+
createImageBitmap(canvas).then((bitmap) => {
|
|
14517
|
+
if (this.worker) {
|
|
14518
|
+
this.worker.postMessage(
|
|
14519
|
+
{ id, bitmap, width, height, dataURLOptions },
|
|
14520
|
+
[bitmap]
|
|
14521
|
+
);
|
|
14522
|
+
} else {
|
|
14523
|
+
void this.snapshotImageBitmap(
|
|
14524
|
+
id,
|
|
14525
|
+
bitmap,
|
|
14526
|
+
width,
|
|
14527
|
+
height,
|
|
14528
|
+
dataURLOptions
|
|
14529
|
+
);
|
|
14530
|
+
}
|
|
14531
|
+
}).catch(() => {
|
|
14237
14532
|
this.snapshotInProgressMap.set(id, false);
|
|
14238
14533
|
});
|
|
14239
14534
|
});
|
|
@@ -14779,9 +15074,20 @@ function record(options = {}) {
|
|
|
14779
15074
|
hooks
|
|
14780
15075
|
);
|
|
14781
15076
|
};
|
|
15077
|
+
const iframeObservers = /* @__PURE__ */ new Map();
|
|
14782
15078
|
iframeManager.addLoadListener((iframeEl) => {
|
|
14783
15079
|
try {
|
|
14784
|
-
|
|
15080
|
+
const prevCleanup = iframeObservers.get(iframeEl);
|
|
15081
|
+
if (prevCleanup) {
|
|
15082
|
+
try {
|
|
15083
|
+
prevCleanup();
|
|
15084
|
+
} catch {
|
|
15085
|
+
}
|
|
15086
|
+
iframeObservers.delete(iframeEl);
|
|
15087
|
+
}
|
|
15088
|
+
const cleanup = observe(iframeEl.contentDocument);
|
|
15089
|
+
handlers.push(cleanup);
|
|
15090
|
+
iframeObservers.set(iframeEl, cleanup);
|
|
14785
15091
|
} catch (error) {
|
|
14786
15092
|
console.warn(error);
|
|
14787
15093
|
}
|