@sentry/replay 11.9.0 → 11.10.0
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/README.md +5 -1
- package/build/npm/cjs/index.js +208 -97
- package/build/npm/cjs/index.js.map +1 -1
- package/build/npm/esm/index.js +208 -97
- package/build/npm/esm/index.js.map +1 -1
- package/build/npm/esm/package.json +1 -1
- package/build/npm/types/coreHandlers/handleClick.d.ts.map +1 -1
- package/build/npm/types/coreHandlers/handleDom.d.ts +2 -2
- package/build/npm/types/coreHandlers/handleDom.d.ts.map +1 -1
- package/build/npm/types/coreHandlers/handleKeyboardEvent.d.ts +2 -2
- package/build/npm/types/coreHandlers/handleKeyboardEvent.d.ts.map +1 -1
- package/build/npm/types/replay.d.ts +1 -0
- package/build/npm/types/replay.d.ts.map +1 -1
- package/build/npm/types/types/replay.d.ts +1 -0
- package/build/npm/types/types/replay.d.ts.map +1 -1
- package/build/npm/types/types/rrweb.d.ts +1 -0
- package/build/npm/types/types/rrweb.d.ts.map +1 -1
- package/package.json +8 -9
package/build/npm/esm/index.js
CHANGED
|
@@ -21,7 +21,7 @@ const MIN_REPLAY_DURATION = 4999;
|
|
|
21
21
|
const MIN_REPLAY_DURATION_LIMIT = 5e4;
|
|
22
22
|
const MAX_REPLAY_DURATION = 36e5;
|
|
23
23
|
|
|
24
|
-
const
|
|
24
|
+
const hb="sentry.segment.name.source";
|
|
25
25
|
|
|
26
26
|
var __defProp = Object.defineProperty;
|
|
27
27
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -1420,6 +1420,7 @@ function snapshot(n, options) {
|
|
|
1420
1420
|
time: true,
|
|
1421
1421
|
url: true,
|
|
1422
1422
|
week: true,
|
|
1423
|
+
hidden: true,
|
|
1423
1424
|
textarea: true,
|
|
1424
1425
|
select: true
|
|
1425
1426
|
} : maskAllInputs === false ? {} : maskAllInputs;
|
|
@@ -2170,7 +2171,9 @@ class MutationBuffer {
|
|
|
2170
2171
|
}
|
|
2171
2172
|
};
|
|
2172
2173
|
while (this.mapRemoves.length) {
|
|
2173
|
-
this.
|
|
2174
|
+
const removedNode = this.mapRemoves.shift();
|
|
2175
|
+
this.mirror.removeNodeFromMap(removedNode);
|
|
2176
|
+
this.shadowDomManager.removeShadowRootsFor(removedNode);
|
|
2174
2177
|
}
|
|
2175
2178
|
for (const n2 of this.movedSet) {
|
|
2176
2179
|
if (isParentRemoved(this.removes, n2, this.mirror) && !this.movedSet.has(n2.parentNode)) {
|
|
@@ -2534,6 +2537,23 @@ class MutationBuffer {
|
|
|
2534
2537
|
this.shadowDomManager.reset();
|
|
2535
2538
|
this.canvasManager.reset();
|
|
2536
2539
|
}
|
|
2540
|
+
/**
|
|
2541
|
+
* Drops mirror entries for removals this buffer has not emitted yet,
|
|
2542
|
+
* without emitting anything. Used when the buffer's root is torn down.
|
|
2543
|
+
*/
|
|
2544
|
+
release(pending) {
|
|
2545
|
+
pending.forEach((m) => {
|
|
2546
|
+
if (m.type === "childList") {
|
|
2547
|
+
m.removedNodes.forEach((n2) => this.mapRemoves.push(n2));
|
|
2548
|
+
}
|
|
2549
|
+
});
|
|
2550
|
+
while (this.mapRemoves.length) {
|
|
2551
|
+
const removedNode = this.mapRemoves.shift();
|
|
2552
|
+
if (inDom(removedNode)) continue;
|
|
2553
|
+
this.mirror.removeNodeFromMap(removedNode);
|
|
2554
|
+
this.shadowDomManager.removeShadowRootsFor(removedNode);
|
|
2555
|
+
}
|
|
2556
|
+
}
|
|
2537
2557
|
}
|
|
2538
2558
|
function deepDelete(addsSet, n2) {
|
|
2539
2559
|
addsSet.delete(n2);
|
|
@@ -2569,6 +2589,10 @@ function _isAncestorInSet(set, n2) {
|
|
|
2569
2589
|
return _isAncestorInSet(set, parentNode);
|
|
2570
2590
|
}
|
|
2571
2591
|
const mutationBuffers = [];
|
|
2592
|
+
function forEachMutationBuffer(cb) {
|
|
2593
|
+
[...mutationBuffers].forEach(cb);
|
|
2594
|
+
}
|
|
2595
|
+
const observerBuffers = /* @__PURE__ */ new WeakMap();
|
|
2572
2596
|
function getEventTarget(event) {
|
|
2573
2597
|
try {
|
|
2574
2598
|
if ("composedPath" in event) {
|
|
@@ -2600,12 +2624,23 @@ function initMutationObserver(options, rootEl) {
|
|
|
2600
2624
|
if (angularZoneSymbol && window[angularZoneSymbol]) {
|
|
2601
2625
|
mutationObserverCtor = window[angularZoneSymbol];
|
|
2602
2626
|
}
|
|
2627
|
+
const { onMutation, blockClass, blockSelector, unblockSelector } = options;
|
|
2628
|
+
const onMutationHelpers = {
|
|
2629
|
+
isBlocked: (node) => isBlocked(node, blockClass, blockSelector, unblockSelector, true)
|
|
2630
|
+
};
|
|
2603
2631
|
const observer = new mutationObserverCtor(
|
|
2604
2632
|
callbackWrapper((mutations) => {
|
|
2605
|
-
|
|
2606
|
-
|
|
2633
|
+
let toProcess = mutations;
|
|
2634
|
+
if (onMutation) {
|
|
2635
|
+
const result = onMutation(mutations, onMutationHelpers);
|
|
2636
|
+
if (result === false) {
|
|
2637
|
+
return;
|
|
2638
|
+
}
|
|
2639
|
+
if (Array.isArray(result)) {
|
|
2640
|
+
toProcess = result;
|
|
2641
|
+
}
|
|
2607
2642
|
}
|
|
2608
|
-
mutationBuffer.processMutations
|
|
2643
|
+
mutationBuffer.processMutations(toProcess);
|
|
2609
2644
|
})
|
|
2610
2645
|
);
|
|
2611
2646
|
observer.observe(rootEl, {
|
|
@@ -2616,8 +2651,22 @@ function initMutationObserver(options, rootEl) {
|
|
|
2616
2651
|
childList: true,
|
|
2617
2652
|
subtree: true
|
|
2618
2653
|
});
|
|
2654
|
+
observerBuffers.set(observer, mutationBuffer);
|
|
2619
2655
|
return observer;
|
|
2620
2656
|
}
|
|
2657
|
+
function removeMutationBuffer(observer) {
|
|
2658
|
+
const pending = observer.takeRecords();
|
|
2659
|
+
observer.disconnect();
|
|
2660
|
+
const buffer = observerBuffers.get(observer);
|
|
2661
|
+
if (buffer) {
|
|
2662
|
+
buffer.release(pending);
|
|
2663
|
+
const index = mutationBuffers.indexOf(buffer);
|
|
2664
|
+
if (index !== -1) {
|
|
2665
|
+
mutationBuffers.splice(index, 1);
|
|
2666
|
+
}
|
|
2667
|
+
observerBuffers.delete(observer);
|
|
2668
|
+
}
|
|
2669
|
+
}
|
|
2621
2670
|
function initMoveObserver({
|
|
2622
2671
|
mousemoveCb,
|
|
2623
2672
|
sampling,
|
|
@@ -3521,7 +3570,7 @@ function initObservers(o2, _hooks = {}) {
|
|
|
3521
3570
|
);
|
|
3522
3571
|
}
|
|
3523
3572
|
return callbackWrapper(() => {
|
|
3524
|
-
|
|
3573
|
+
forEachMutationBuffer((b) => b.reset());
|
|
3525
3574
|
mutationObserver?.disconnect();
|
|
3526
3575
|
mousemoveHandler();
|
|
3527
3576
|
mouseInteractionHandler();
|
|
@@ -3855,12 +3904,15 @@ class ShadowDomManagerNoop {
|
|
|
3855
3904
|
}
|
|
3856
3905
|
observeAttachShadow() {
|
|
3857
3906
|
}
|
|
3907
|
+
removeShadowRootsFor() {
|
|
3908
|
+
}
|
|
3858
3909
|
reset() {
|
|
3859
3910
|
}
|
|
3860
3911
|
}
|
|
3861
3912
|
class ShadowDomManager {
|
|
3862
3913
|
constructor(options) {
|
|
3863
3914
|
this.shadowDoms = /* @__PURE__ */ new WeakSet();
|
|
3915
|
+
this.shadowRootTeardowns = /* @__PURE__ */ new Map();
|
|
3864
3916
|
this.restoreHandlers = [];
|
|
3865
3917
|
this.mutationCb = options.mutationCb;
|
|
3866
3918
|
this.scrollCb = options.scrollCb;
|
|
@@ -3876,6 +3928,8 @@ class ShadowDomManager {
|
|
|
3876
3928
|
if (!isNativeShadowDom(shadowRoot)) return;
|
|
3877
3929
|
if (this.shadowDoms.has(shadowRoot)) return;
|
|
3878
3930
|
this.shadowDoms.add(shadowRoot);
|
|
3931
|
+
const teardowns = [];
|
|
3932
|
+
this.shadowRootTeardowns.set(shadowRoot, teardowns);
|
|
3879
3933
|
this.bypassOptions.canvasManager.addShadowRoot(shadowRoot);
|
|
3880
3934
|
const observer = initMutationObserver(
|
|
3881
3935
|
{
|
|
@@ -3887,8 +3941,8 @@ class ShadowDomManager {
|
|
|
3887
3941
|
},
|
|
3888
3942
|
shadowRoot
|
|
3889
3943
|
);
|
|
3890
|
-
|
|
3891
|
-
|
|
3944
|
+
teardowns.push(() => removeMutationBuffer(observer));
|
|
3945
|
+
teardowns.push(
|
|
3892
3946
|
initScrollObserver({
|
|
3893
3947
|
...this.bypassOptions,
|
|
3894
3948
|
scrollCb: this.scrollCb,
|
|
@@ -3899,12 +3953,13 @@ class ShadowDomManager {
|
|
|
3899
3953
|
})
|
|
3900
3954
|
);
|
|
3901
3955
|
setTimeout$2(() => {
|
|
3956
|
+
if (this.shadowRootTeardowns.get(shadowRoot) !== teardowns) return;
|
|
3902
3957
|
if (shadowRoot.adoptedStyleSheets && shadowRoot.adoptedStyleSheets.length > 0)
|
|
3903
3958
|
this.bypassOptions.stylesheetManager.adoptStyleSheets(
|
|
3904
3959
|
shadowRoot.adoptedStyleSheets,
|
|
3905
3960
|
this.mirror.getId(shadowRoot.host)
|
|
3906
3961
|
);
|
|
3907
|
-
|
|
3962
|
+
teardowns.push(
|
|
3908
3963
|
initAdoptedStyleSheetObserver(
|
|
3909
3964
|
{
|
|
3910
3965
|
mirror: this.mirror,
|
|
@@ -3915,6 +3970,31 @@ class ShadowDomManager {
|
|
|
3915
3970
|
);
|
|
3916
3971
|
}, 0);
|
|
3917
3972
|
}
|
|
3973
|
+
/** Disconnects one shadow root and forgets it. */
|
|
3974
|
+
removeShadowRoot(shadowRoot) {
|
|
3975
|
+
const teardowns = this.shadowRootTeardowns.get(shadowRoot);
|
|
3976
|
+
if (teardowns) {
|
|
3977
|
+
teardowns.forEach((teardown) => {
|
|
3978
|
+
try {
|
|
3979
|
+
teardown();
|
|
3980
|
+
} catch (e2) {
|
|
3981
|
+
}
|
|
3982
|
+
});
|
|
3983
|
+
this.shadowRootTeardowns.delete(shadowRoot);
|
|
3984
|
+
}
|
|
3985
|
+
this.shadowDoms.delete(shadowRoot);
|
|
3986
|
+
}
|
|
3987
|
+
removeShadowRootsFor(node) {
|
|
3988
|
+
if (this.shadowRootTeardowns.size === 0) return;
|
|
3989
|
+
if (hasShadowRoot(node)) {
|
|
3990
|
+
const shadowRoot = node.shadowRoot;
|
|
3991
|
+
if (this.shadowDoms.has(shadowRoot) && !inDom(node)) {
|
|
3992
|
+
this.removeShadowRoot(shadowRoot);
|
|
3993
|
+
}
|
|
3994
|
+
this.removeShadowRootsFor(shadowRoot);
|
|
3995
|
+
}
|
|
3996
|
+
node.childNodes?.forEach((child) => this.removeShadowRootsFor(child));
|
|
3997
|
+
}
|
|
3918
3998
|
/**
|
|
3919
3999
|
* Monkey patch 'attachShadow' of an IFrameElement to observe newly added shadow doms.
|
|
3920
4000
|
*/
|
|
@@ -3959,6 +4039,15 @@ class ShadowDomManager {
|
|
|
3959
4039
|
}
|
|
3960
4040
|
});
|
|
3961
4041
|
this.restoreHandlers = [];
|
|
4042
|
+
this.shadowRootTeardowns.forEach((teardowns) => {
|
|
4043
|
+
teardowns.forEach((teardown) => {
|
|
4044
|
+
try {
|
|
4045
|
+
teardown();
|
|
4046
|
+
} catch (e2) {
|
|
4047
|
+
}
|
|
4048
|
+
});
|
|
4049
|
+
});
|
|
4050
|
+
this.shadowRootTeardowns = /* @__PURE__ */ new Map();
|
|
3962
4051
|
this.shadowDoms = /* @__PURE__ */ new WeakSet();
|
|
3963
4052
|
this.bypassOptions.canvasManager.resetShadowRoots();
|
|
3964
4053
|
}
|
|
@@ -4135,6 +4224,7 @@ function record(options = {}) {
|
|
|
4135
4224
|
time: true,
|
|
4136
4225
|
url: true,
|
|
4137
4226
|
week: true,
|
|
4227
|
+
hidden: true,
|
|
4138
4228
|
textarea: true,
|
|
4139
4229
|
select: true,
|
|
4140
4230
|
radio: true,
|
|
@@ -4155,8 +4245,9 @@ function record(options = {}) {
|
|
|
4155
4245
|
headMetaDescKeywords: _slimDOMOptions === "all"
|
|
4156
4246
|
} : _slimDOMOptions ? _slimDOMOptions : {};
|
|
4157
4247
|
polyfill();
|
|
4158
|
-
let
|
|
4248
|
+
let lastFullSnapshotTimestamp = 0;
|
|
4159
4249
|
let incrementalSnapshotCount = 0;
|
|
4250
|
+
let failedSnapshotCount = 0;
|
|
4160
4251
|
const eventProcessor = (e2) => {
|
|
4161
4252
|
for (const plugin of plugins || []) {
|
|
4162
4253
|
if (plugin.eventProcessor) {
|
|
@@ -4173,7 +4264,7 @@ function record(options = {}) {
|
|
|
4173
4264
|
const e2 = r2;
|
|
4174
4265
|
e2.timestamp = nowTimestamp();
|
|
4175
4266
|
if (mutationBuffers[0]?.isFrozen() && e2.type !== EventType.FullSnapshot && !(e2.type === EventType.IncrementalSnapshot && e2.data.source === IncrementalSource.Mutation)) {
|
|
4176
|
-
|
|
4267
|
+
forEachMutationBuffer((buf) => buf.unfreeze());
|
|
4177
4268
|
}
|
|
4178
4269
|
if (inEmittingFrame) {
|
|
4179
4270
|
emit?.(eventProcessor(e2), isCheckout);
|
|
@@ -4187,15 +4278,16 @@ function record(options = {}) {
|
|
|
4187
4278
|
window.parent.postMessage(message, "*");
|
|
4188
4279
|
}
|
|
4189
4280
|
if (e2.type === EventType.FullSnapshot) {
|
|
4190
|
-
|
|
4281
|
+
lastFullSnapshotTimestamp = e2.timestamp;
|
|
4191
4282
|
incrementalSnapshotCount = 0;
|
|
4283
|
+
failedSnapshotCount = 0;
|
|
4192
4284
|
} else if (e2.type === EventType.IncrementalSnapshot) {
|
|
4193
4285
|
if (e2.data.source === IncrementalSource.Mutation && e2.data.isAttachIframe) {
|
|
4194
4286
|
return;
|
|
4195
4287
|
}
|
|
4196
4288
|
incrementalSnapshotCount++;
|
|
4197
4289
|
const exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;
|
|
4198
|
-
const exceedTime = checkoutEveryNms &&
|
|
4290
|
+
const exceedTime = checkoutEveryNms && lastFullSnapshotTimestamp && e2.timestamp - lastFullSnapshotTimestamp > checkoutEveryNms;
|
|
4199
4291
|
if (exceedCount || exceedTime) {
|
|
4200
4292
|
takeFullSnapshot2(true);
|
|
4201
4293
|
}
|
|
@@ -4322,80 +4414,96 @@ function record(options = {}) {
|
|
|
4322
4414
|
);
|
|
4323
4415
|
stylesheetManager.reset();
|
|
4324
4416
|
shadowDomManager.init();
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4417
|
+
forEachMutationBuffer((buf) => buf.lock());
|
|
4418
|
+
let snapshotEmitted = false;
|
|
4419
|
+
try {
|
|
4420
|
+
const node = snapshot(document, {
|
|
4421
|
+
mirror,
|
|
4422
|
+
blockClass,
|
|
4423
|
+
blockSelector,
|
|
4424
|
+
unblockSelector,
|
|
4425
|
+
maskAllText,
|
|
4426
|
+
maskTextClass,
|
|
4427
|
+
unmaskTextClass,
|
|
4428
|
+
maskTextSelector,
|
|
4429
|
+
unmaskTextSelector,
|
|
4430
|
+
inlineStylesheet,
|
|
4431
|
+
maskAllInputs: maskInputOptions,
|
|
4432
|
+
maskAttributeFn,
|
|
4433
|
+
maskInputFn,
|
|
4434
|
+
maskTextFn,
|
|
4435
|
+
slimDOM: slimDOMOptions,
|
|
4436
|
+
dataURLOptions,
|
|
4437
|
+
recordCanvas,
|
|
4438
|
+
inlineImages,
|
|
4439
|
+
onSerialize: (n2) => {
|
|
4440
|
+
if (isSerializedIframe(n2, mirror)) {
|
|
4441
|
+
iframeManager.addIframe(n2);
|
|
4442
|
+
}
|
|
4443
|
+
if (isSerializedStylesheet(n2, mirror)) {
|
|
4444
|
+
stylesheetManager.trackLinkElement(n2);
|
|
4445
|
+
}
|
|
4446
|
+
if (hasShadowRoot(n2)) {
|
|
4447
|
+
shadowDomManager.addShadowRoot(n2.shadowRoot, document);
|
|
4448
|
+
}
|
|
4449
|
+
},
|
|
4450
|
+
onIframeLoad: (iframe, childSn) => {
|
|
4451
|
+
iframeManager.attachIframe(iframe, childSn);
|
|
4452
|
+
const contentWindow = getIFrameContentWindow(iframe);
|
|
4453
|
+
if (contentWindow) {
|
|
4454
|
+
canvasManager.addWindow(contentWindow);
|
|
4455
|
+
}
|
|
4456
|
+
shadowDomManager.observeAttachShadow(iframe);
|
|
4457
|
+
},
|
|
4458
|
+
onStylesheetLoad: (linkEl, childSn) => {
|
|
4459
|
+
stylesheetManager.attachLinkElement(linkEl, childSn);
|
|
4460
|
+
},
|
|
4461
|
+
onBlockedImageLoad: (_imageEl, serializedNode, { width, height }) => {
|
|
4462
|
+
wrappedMutationEmit({
|
|
4463
|
+
adds: [],
|
|
4464
|
+
removes: [],
|
|
4465
|
+
texts: [],
|
|
4466
|
+
attributes: [
|
|
4467
|
+
{
|
|
4468
|
+
id: serializedNode.id,
|
|
4469
|
+
attributes: {
|
|
4470
|
+
style: {
|
|
4471
|
+
width: `${width}px`,
|
|
4472
|
+
height: `${height}px`
|
|
4473
|
+
}
|
|
4379
4474
|
}
|
|
4380
4475
|
}
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
}
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
return console.warn("Failed to snapshot the document");
|
|
4390
|
-
}
|
|
4391
|
-
wrappedEmit({
|
|
4392
|
-
type: EventType.FullSnapshot,
|
|
4393
|
-
data: {
|
|
4394
|
-
node,
|
|
4395
|
-
initialOffset: getWindowScroll(window)
|
|
4476
|
+
]
|
|
4477
|
+
});
|
|
4478
|
+
},
|
|
4479
|
+
keepIframeSrcFn,
|
|
4480
|
+
ignoreCSSAttributes
|
|
4481
|
+
});
|
|
4482
|
+
if (!node) {
|
|
4483
|
+
return console.warn("Failed to snapshot the document");
|
|
4396
4484
|
}
|
|
4397
|
-
|
|
4398
|
-
|
|
4485
|
+
wrappedEmit({
|
|
4486
|
+
type: EventType.FullSnapshot,
|
|
4487
|
+
data: {
|
|
4488
|
+
node,
|
|
4489
|
+
initialOffset: getWindowScroll(window)
|
|
4490
|
+
}
|
|
4491
|
+
});
|
|
4492
|
+
snapshotEmitted = true;
|
|
4493
|
+
} finally {
|
|
4494
|
+
if (!snapshotEmitted) {
|
|
4495
|
+
failedSnapshotCount++;
|
|
4496
|
+
if (checkoutEveryNms) {
|
|
4497
|
+
const retryDelay = Math.min(
|
|
4498
|
+
1e3 * 2 ** (failedSnapshotCount - 1),
|
|
4499
|
+
checkoutEveryNms
|
|
4500
|
+
);
|
|
4501
|
+
lastFullSnapshotTimestamp = nowTimestamp() - checkoutEveryNms + retryDelay;
|
|
4502
|
+
}
|
|
4503
|
+
incrementalSnapshotCount = 0;
|
|
4504
|
+
}
|
|
4505
|
+
forEachMutationBuffer((buf) => buf.unlock());
|
|
4506
|
+
}
|
|
4399
4507
|
if (document.adoptedStyleSheets && document.adoptedStyleSheets.length > 0)
|
|
4400
4508
|
stylesheetManager.adoptStyleSheets(
|
|
4401
4509
|
document.adoptedStyleSheets,
|
|
@@ -4781,10 +4889,10 @@ class ClickDetector {
|
|
|
4781
4889
|
const timedOutClicks = [];
|
|
4782
4890
|
const now = nowInSeconds();
|
|
4783
4891
|
this._clicks.forEach((click) => {
|
|
4784
|
-
if (
|
|
4892
|
+
if (click.mutationAfter === void 0 && this._lastMutation) {
|
|
4785
4893
|
click.mutationAfter = click.timestamp <= this._lastMutation ? this._lastMutation - click.timestamp : void 0;
|
|
4786
4894
|
}
|
|
4787
|
-
if (
|
|
4895
|
+
if (click.scrollAfter === void 0 && this._lastScroll) {
|
|
4788
4896
|
click.scrollAfter = click.timestamp <= this._lastScroll ? this._lastScroll - click.timestamp : void 0;
|
|
4789
4897
|
}
|
|
4790
4898
|
if (click.timestamp + this._timeout <= now) {
|
|
@@ -4805,8 +4913,8 @@ class ClickDetector {
|
|
|
4805
4913
|
/** Generate matching breadcrumb(s) for the click. */
|
|
4806
4914
|
_generateBreadcrumbs(click) {
|
|
4807
4915
|
const replay = this._replay;
|
|
4808
|
-
const hadScroll = click.scrollAfter && click.scrollAfter <= this._scrollTimeout;
|
|
4809
|
-
const hadMutation = click.mutationAfter && click.mutationAfter <= this._threshold;
|
|
4916
|
+
const hadScroll = click.scrollAfter !== void 0 && click.scrollAfter <= this._scrollTimeout;
|
|
4917
|
+
const hadMutation = click.mutationAfter !== void 0 && click.mutationAfter <= this._threshold;
|
|
4810
4918
|
const isSlowClick = !hadScroll && !hadMutation;
|
|
4811
4919
|
const { clickCount, clickBreadcrumb } = click;
|
|
4812
4920
|
if (isSlowClick) {
|
|
@@ -4962,7 +5070,7 @@ const handleDomListener = (replay) => {
|
|
|
4962
5070
|
if (!replay.isEnabled()) {
|
|
4963
5071
|
return;
|
|
4964
5072
|
}
|
|
4965
|
-
const result = handleDom(handlerData);
|
|
5073
|
+
const result = handleDom(handlerData, replay.getMaskAttributeFn());
|
|
4966
5074
|
if (!result) {
|
|
4967
5075
|
return;
|
|
4968
5076
|
}
|
|
@@ -4992,20 +5100,20 @@ function getBaseDomBreadcrumb(target, message) {
|
|
|
4992
5100
|
} : {}
|
|
4993
5101
|
};
|
|
4994
5102
|
}
|
|
4995
|
-
function handleDom(handlerData) {
|
|
4996
|
-
const { target, message } = getDomTarget(handlerData);
|
|
5103
|
+
function handleDom(handlerData, maskAttributeFn) {
|
|
5104
|
+
const { target, message } = getDomTarget(handlerData, maskAttributeFn);
|
|
4997
5105
|
return createBreadcrumb({
|
|
4998
5106
|
category: `ui.${handlerData.name}`,
|
|
4999
5107
|
...getBaseDomBreadcrumb(target, message)
|
|
5000
5108
|
});
|
|
5001
5109
|
}
|
|
5002
|
-
function getDomTarget(handlerData) {
|
|
5110
|
+
function getDomTarget(handlerData, maskAttributeFn) {
|
|
5003
5111
|
const isClick = handlerData.name === "click";
|
|
5004
5112
|
let message;
|
|
5005
5113
|
let target = null;
|
|
5006
5114
|
try {
|
|
5007
5115
|
target = isClick ? getClickTargetNode(handlerData.event) : getTargetNode(handlerData.event);
|
|
5008
|
-
message = htmlTreeAsString(target, { maxStringLength: 200 }) || "<unknown>";
|
|
5116
|
+
message = htmlTreeAsString(target, { maxStringLength: 200, maskAttributeFn }) || "<unknown>";
|
|
5009
5117
|
} catch {
|
|
5010
5118
|
message = "<unknown>";
|
|
5011
5119
|
}
|
|
@@ -5020,13 +5128,13 @@ function handleKeyboardEvent(replay, event) {
|
|
|
5020
5128
|
return;
|
|
5021
5129
|
}
|
|
5022
5130
|
replay.updateUserActivity();
|
|
5023
|
-
const breadcrumb = getKeyboardBreadcrumb(event);
|
|
5131
|
+
const breadcrumb = getKeyboardBreadcrumb(event, replay.getMaskAttributeFn());
|
|
5024
5132
|
if (!breadcrumb) {
|
|
5025
5133
|
return;
|
|
5026
5134
|
}
|
|
5027
5135
|
addBreadcrumbEvent(replay, breadcrumb);
|
|
5028
5136
|
}
|
|
5029
|
-
function getKeyboardBreadcrumb(event) {
|
|
5137
|
+
function getKeyboardBreadcrumb(event, maskAttributeFn) {
|
|
5030
5138
|
const { metaKey, shiftKey, ctrlKey, altKey, key, target } = event;
|
|
5031
5139
|
if (!target || isInputElement(target) || !key) {
|
|
5032
5140
|
return null;
|
|
@@ -5036,7 +5144,7 @@ function getKeyboardBreadcrumb(event) {
|
|
|
5036
5144
|
if (!hasModifierKey && isCharacterKey) {
|
|
5037
5145
|
return null;
|
|
5038
5146
|
}
|
|
5039
|
-
const message = htmlTreeAsString(target, { maxStringLength: 200 }) || "<unknown>";
|
|
5147
|
+
const message = htmlTreeAsString(target, { maxStringLength: 200, maskAttributeFn }) || "<unknown>";
|
|
5040
5148
|
const baseBreadcrumb = getBaseDomBreadcrumb(target, message);
|
|
5041
5149
|
return createBreadcrumb({
|
|
5042
5150
|
category: "ui.keyDown",
|
|
@@ -7344,6 +7452,9 @@ class ReplayContainer {
|
|
|
7344
7452
|
getOptions() {
|
|
7345
7453
|
return this._options;
|
|
7346
7454
|
}
|
|
7455
|
+
getMaskAttributeFn() {
|
|
7456
|
+
return this._recordingOptions.maskAttributeFn;
|
|
7457
|
+
}
|
|
7347
7458
|
/** A wrapper to conditionally capture exceptions. */
|
|
7348
7459
|
handleException(error) {
|
|
7349
7460
|
DEBUG_BUILD && debug.exception(error);
|
|
@@ -7734,7 +7845,7 @@ class ReplayContainer {
|
|
|
7734
7845
|
return void 0;
|
|
7735
7846
|
}
|
|
7736
7847
|
const spanJson = spanToJSON(lastRootSpan);
|
|
7737
|
-
const source = spanJson.attributes[
|
|
7848
|
+
const source = spanJson.attributes[hb];
|
|
7738
7849
|
if (!source || !["route", "custom"].includes(source)) {
|
|
7739
7850
|
return void 0;
|
|
7740
7851
|
}
|