@glimt/record 0.0.56 → 0.0.57
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/record.cjs +63 -13
- package/dist/record.cjs.map +1 -1
- package/dist/record.js +63 -13
- package/dist/record.js.map +1 -1
- package/dist/record.umd.cjs +63 -13
- package/dist/record.umd.cjs.map +2 -2
- package/dist/record.umd.min.cjs +24 -24
- package/dist/record.umd.min.cjs.map +3 -3
- package/package.json +1 -1
package/dist/record.cjs
CHANGED
|
@@ -430,6 +430,9 @@ const index = {
|
|
|
430
430
|
const shouldTryAnonymousFetchingOnCorsError$1 = () => {
|
|
431
431
|
return !("_rrweb_skip_re_fetching_to_suppress_cors_errors" in window && window._rrweb_skip_re_fetching_to_suppress_cors_errors === true);
|
|
432
432
|
};
|
|
433
|
+
const isDebug$1 = () => {
|
|
434
|
+
return "_rrweb_is_debug" in window && window._rrweb_is_debug ? window._rrweb_is_debug : false;
|
|
435
|
+
};
|
|
433
436
|
function isElement(n2) {
|
|
434
437
|
return n2.nodeType === n2.ELEMENT_NODE;
|
|
435
438
|
}
|
|
@@ -815,7 +818,7 @@ function markCssSplits(cssText, style) {
|
|
|
815
818
|
return splitCssText(cssText, style).join("/* rr_split */");
|
|
816
819
|
}
|
|
817
820
|
const CLEANUP_DEBOUNCE_TIME$1 = 1e3 * 30;
|
|
818
|
-
const DATA_ATTRIBUTE_CLONED_NAME$1 = "data-rrweb-link-cloned";
|
|
821
|
+
const DATA_ATTRIBUTE_CLONED_NAME$1 = "data-recapt-rrweb-link-cloned";
|
|
819
822
|
const DISALLOWED_EXTENSIONS$1 = [
|
|
820
823
|
// Fonts
|
|
821
824
|
"woff",
|
|
@@ -1535,9 +1538,10 @@ function serializeElementNode(n2, options) {
|
|
|
1535
1538
|
return;
|
|
1536
1539
|
}
|
|
1537
1540
|
} else {
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
+
if (isDebug$1())
|
|
1542
|
+
console.warn(
|
|
1543
|
+
`Cannot inline img src=${imageSrc}! Error: ${err}`
|
|
1544
|
+
);
|
|
1541
1545
|
}
|
|
1542
1546
|
}
|
|
1543
1547
|
inlineImageCleanup();
|
|
@@ -1693,7 +1697,7 @@ function serializeNodeWithId(n2, options) {
|
|
|
1693
1697
|
cssCaptured
|
|
1694
1698
|
});
|
|
1695
1699
|
if (!_serializedNode) {
|
|
1696
|
-
console.warn(n2, "not serialized");
|
|
1700
|
+
if (isDebug$1()) console.warn(n2, "not serialized");
|
|
1697
1701
|
return null;
|
|
1698
1702
|
}
|
|
1699
1703
|
let id;
|
|
@@ -5720,7 +5724,7 @@ function absolutifyURLs(cssText, href) {
|
|
|
5720
5724
|
);
|
|
5721
5725
|
}
|
|
5722
5726
|
const CLEANUP_DEBOUNCE_TIME = 1e3 * 30;
|
|
5723
|
-
const DATA_ATTRIBUTE_CLONED_NAME = "data-rrweb-link-cloned";
|
|
5727
|
+
const DATA_ATTRIBUTE_CLONED_NAME = "data-recapt-rrweb-link-cloned";
|
|
5724
5728
|
const DISALLOWED_EXTENSIONS = [
|
|
5725
5729
|
// Fonts
|
|
5726
5730
|
"woff",
|
|
@@ -10147,6 +10151,13 @@ class IframeManager {
|
|
|
10147
10151
|
}
|
|
10148
10152
|
}
|
|
10149
10153
|
}
|
|
10154
|
+
const isDebug = () => {
|
|
10155
|
+
return "_rrweb_is_debug" in window && window._rrweb_is_debug ? window._rrweb_is_debug : false;
|
|
10156
|
+
};
|
|
10157
|
+
const debugLog = (...args) => {
|
|
10158
|
+
if (!isDebug()) return;
|
|
10159
|
+
console.log("[recapt:rrweb]", ...args);
|
|
10160
|
+
};
|
|
10150
10161
|
const _StormSnapshotManager = class _StormSnapshotManager2 {
|
|
10151
10162
|
constructor() {
|
|
10152
10163
|
__publicField(this, "lastFullSnapshot", -1);
|
|
@@ -10182,10 +10193,10 @@ const _StormSnapshotManager = class _StormSnapshotManager2 {
|
|
|
10182
10193
|
}
|
|
10183
10194
|
takeSnapshot() {
|
|
10184
10195
|
if (Date.now() - this.lastFullSnapshot < this.intervalBetweenSnapshots) {
|
|
10185
|
-
|
|
10196
|
+
debugLog("StormSnapshotManager, takeSnapshot: too soon");
|
|
10186
10197
|
return;
|
|
10187
10198
|
}
|
|
10188
|
-
|
|
10199
|
+
debugLog("StormSnapshotManager, takeSnapshot: taking full snapshot");
|
|
10189
10200
|
takeFullSnapshot();
|
|
10190
10201
|
this.lastFullSnapshot = Date.now();
|
|
10191
10202
|
}
|
|
@@ -10274,6 +10285,14 @@ class DoubleLinkedList {
|
|
|
10274
10285
|
}
|
|
10275
10286
|
}
|
|
10276
10287
|
const moveKey = (id, parentId) => `${id}@${parentId}`;
|
|
10288
|
+
const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
10289
|
+
function makeid(length = 8) {
|
|
10290
|
+
let result2 = "";
|
|
10291
|
+
for (let i2 = 0; i2 < length; i2++) {
|
|
10292
|
+
result2 += characters.charAt(Math.floor(Math.random() * characters.length));
|
|
10293
|
+
}
|
|
10294
|
+
return result2;
|
|
10295
|
+
}
|
|
10277
10296
|
class MutationBuffer {
|
|
10278
10297
|
constructor() {
|
|
10279
10298
|
__publicField(this, "frozen", false);
|
|
@@ -10310,6 +10329,7 @@ class MutationBuffer {
|
|
|
10310
10329
|
__publicField(this, "canvasManager");
|
|
10311
10330
|
__publicField(this, "processedNodeManager");
|
|
10312
10331
|
__publicField(this, "unattachedDoc");
|
|
10332
|
+
__publicField(this, "bufId", isDebug() ? makeid() : "");
|
|
10313
10333
|
__publicField(this, "stormBatches", []);
|
|
10314
10334
|
__publicField(this, "stormInfo", null);
|
|
10315
10335
|
__publicField(this, "stormSettings", {
|
|
@@ -10323,6 +10343,11 @@ class MutationBuffer {
|
|
|
10323
10343
|
__publicField(this, "handleStormMutations", (muts) => {
|
|
10324
10344
|
const time = Date.now();
|
|
10325
10345
|
if (this.stormInfo == null) {
|
|
10346
|
+
debugLog(
|
|
10347
|
+
"detected probable mutation storm start",
|
|
10348
|
+
"buffer id:",
|
|
10349
|
+
this.bufId
|
|
10350
|
+
);
|
|
10326
10351
|
this.stormInfo = {
|
|
10327
10352
|
startedAt: time,
|
|
10328
10353
|
totalMutations: 0,
|
|
@@ -10353,6 +10378,18 @@ class MutationBuffer {
|
|
|
10353
10378
|
__publicField(this, "handleStormFinish", () => {
|
|
10354
10379
|
if (!this.stormInfo) return;
|
|
10355
10380
|
const { stormExceededLimit } = this.stormInfo;
|
|
10381
|
+
debugLog(
|
|
10382
|
+
"mutation storm finished",
|
|
10383
|
+
"totalMutations:",
|
|
10384
|
+
this.stormInfo.totalMutations,
|
|
10385
|
+
"stormExceededLimit:",
|
|
10386
|
+
stormExceededLimit,
|
|
10387
|
+
"storm duration:",
|
|
10388
|
+
Date.now() - this.stormInfo.startedAt,
|
|
10389
|
+
"ms",
|
|
10390
|
+
"buffer id:",
|
|
10391
|
+
this.bufId
|
|
10392
|
+
);
|
|
10356
10393
|
clearTimeout(this.stormInfo.timeout);
|
|
10357
10394
|
this.stormInfo = null;
|
|
10358
10395
|
if (!stormExceededLimit) {
|
|
@@ -10375,6 +10412,13 @@ class MutationBuffer {
|
|
|
10375
10412
|
for (const mut of muts) {
|
|
10376
10413
|
this.processMutation(mut);
|
|
10377
10414
|
}
|
|
10415
|
+
debugLog(
|
|
10416
|
+
"processed mutations from storm",
|
|
10417
|
+
"overrideStorm:",
|
|
10418
|
+
overrideStorm,
|
|
10419
|
+
"buffer id:",
|
|
10420
|
+
this.bufId
|
|
10421
|
+
);
|
|
10378
10422
|
this.emit();
|
|
10379
10423
|
});
|
|
10380
10424
|
__publicField(this, "processMutations", (mutations) => {
|
|
@@ -10840,7 +10884,6 @@ class MutationBuffer {
|
|
|
10840
10884
|
}
|
|
10841
10885
|
});
|
|
10842
10886
|
}
|
|
10843
|
-
// private bufId: string = makeid();
|
|
10844
10887
|
init(options) {
|
|
10845
10888
|
[
|
|
10846
10889
|
"mutationCb",
|
|
@@ -12687,7 +12730,7 @@ try {
|
|
|
12687
12730
|
document.body.removeChild(cleanFrame);
|
|
12688
12731
|
}
|
|
12689
12732
|
} catch (err) {
|
|
12690
|
-
console.debug("Unable to override Array.from", err);
|
|
12733
|
+
if (isDebug()) console.debug("Unable to override Array.from", err);
|
|
12691
12734
|
}
|
|
12692
12735
|
const mirror = createMirror$2();
|
|
12693
12736
|
function record(options = {}) {
|
|
@@ -12966,7 +13009,8 @@ function record(options = {}) {
|
|
|
12966
13009
|
keepIframeSrcFn
|
|
12967
13010
|
});
|
|
12968
13011
|
if (!node2) {
|
|
12969
|
-
|
|
13012
|
+
if (isDebug()) console.warn("Failed to snapshot the document");
|
|
13013
|
+
return;
|
|
12970
13014
|
}
|
|
12971
13015
|
wrappedEmit(
|
|
12972
13016
|
{
|
|
@@ -13114,7 +13158,10 @@ function record(options = {}) {
|
|
|
13114
13158
|
try {
|
|
13115
13159
|
handlers.push(observe(iframeEl.contentDocument));
|
|
13116
13160
|
} catch (error) {
|
|
13117
|
-
|
|
13161
|
+
if (isDebug()) {
|
|
13162
|
+
console.warn("internal error");
|
|
13163
|
+
console.warn(error);
|
|
13164
|
+
}
|
|
13118
13165
|
}
|
|
13119
13166
|
});
|
|
13120
13167
|
let initedAt = null;
|
|
@@ -13173,7 +13220,10 @@ function record(options = {}) {
|
|
|
13173
13220
|
unregisterErrorHandler();
|
|
13174
13221
|
};
|
|
13175
13222
|
} catch (error) {
|
|
13176
|
-
|
|
13223
|
+
if (isDebug()) {
|
|
13224
|
+
console.warn("internal error1");
|
|
13225
|
+
console.warn(error);
|
|
13226
|
+
}
|
|
13177
13227
|
}
|
|
13178
13228
|
}
|
|
13179
13229
|
record.addCustomEvent = (tag, payload) => {
|