@appsurify-testmap/rrweb 3.5.0-alpha.1 → 3.10.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.cjs +130 -40
- package/dist/rrweb.cjs.map +1 -1
- package/dist/rrweb.d.cts +1 -0
- package/dist/rrweb.d.ts +1 -0
- package/dist/rrweb.js +130 -40
- package/dist/rrweb.js.map +1 -1
- package/dist/rrweb.umd.cjs +130 -39
- package/dist/rrweb.umd.cjs.map +3 -3
- package/dist/rrweb.umd.min.cjs +34 -34
- package/dist/rrweb.umd.min.cjs.map +3 -3
- package/package.json +5 -5
package/dist/rrweb.d.cts
CHANGED
|
@@ -263,6 +263,7 @@ export declare type recordOptions<T> = {
|
|
|
263
263
|
inlineImages?: boolean;
|
|
264
264
|
plugins?: RecordPlugin[];
|
|
265
265
|
selector?: boolean | SelectorOptions;
|
|
266
|
+
trustSyntheticInput?: boolean;
|
|
266
267
|
mousemoveWait?: number;
|
|
267
268
|
keepIframeSrcFn?: KeepIframeSrcFn;
|
|
268
269
|
errorHandler?: ErrorHandler;
|
package/dist/rrweb.d.ts
CHANGED
|
@@ -263,6 +263,7 @@ export declare type recordOptions<T> = {
|
|
|
263
263
|
inlineImages?: boolean;
|
|
264
264
|
plugins?: RecordPlugin[];
|
|
265
265
|
selector?: boolean | SelectorOptions;
|
|
266
|
+
trustSyntheticInput?: boolean;
|
|
266
267
|
mousemoveWait?: number;
|
|
267
268
|
keepIframeSrcFn?: KeepIframeSrcFn;
|
|
268
269
|
errorHandler?: ErrorHandler;
|
package/dist/rrweb.js
CHANGED
|
@@ -15920,7 +15920,8 @@ function initInputObserver({
|
|
|
15920
15920
|
maskInputOptions,
|
|
15921
15921
|
maskInputFn,
|
|
15922
15922
|
sampling,
|
|
15923
|
-
userTriggeredOnInput
|
|
15923
|
+
userTriggeredOnInput,
|
|
15924
|
+
trustSyntheticInput
|
|
15924
15925
|
}) {
|
|
15925
15926
|
function eventHandler(event) {
|
|
15926
15927
|
let target = getEventTarget(event);
|
|
@@ -15970,34 +15971,53 @@ function initInputObserver({
|
|
|
15970
15971
|
function cbWithDedup(target, v2) {
|
|
15971
15972
|
const lastInputValue = lastInputValueMap.get(target);
|
|
15972
15973
|
const el = target;
|
|
15973
|
-
|
|
15974
|
-
|
|
15975
|
-
|
|
15976
|
-
|
|
15977
|
-
|
|
15978
|
-
|
|
15979
|
-
|
|
15980
|
-
|
|
15981
|
-
|
|
15982
|
-
|
|
15983
|
-
|
|
15984
|
-
|
|
15985
|
-
|
|
15986
|
-
|
|
15987
|
-
|
|
15988
|
-
|
|
15989
|
-
|
|
15990
|
-
|
|
15991
|
-
|
|
15992
|
-
|
|
15993
|
-
|
|
15994
|
-
|
|
15995
|
-
|
|
15996
|
-
|
|
15997
|
-
|
|
15998
|
-
|
|
15999
|
-
|
|
16000
|
-
|
|
15974
|
+
if (trustSyntheticInput) {
|
|
15975
|
+
const isInitialEmpty = !v2.userTriggered && el.value === "" && !v2.isChecked && !lastInputValue;
|
|
15976
|
+
const isSelectDefaultSelection = el.tagName === "SELECT" && !v2.userTriggered && !lastInputValue && el.selectedIndex === 0;
|
|
15977
|
+
if (isInitialEmpty || isSelectDefaultSelection) {
|
|
15978
|
+
console.debug(
|
|
15979
|
+
`[${nowTimestamp()}] [rrweb:record/observer] phantom input ignored (trust mode)`,
|
|
15980
|
+
{
|
|
15981
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call
|
|
15982
|
+
node: index.describeNode(el),
|
|
15983
|
+
tag: el.tagName,
|
|
15984
|
+
value: el.value,
|
|
15985
|
+
isInitialEmpty,
|
|
15986
|
+
isSelectDefaultSelection
|
|
15987
|
+
}
|
|
15988
|
+
);
|
|
15989
|
+
return;
|
|
15990
|
+
}
|
|
15991
|
+
} else {
|
|
15992
|
+
const hasPlaceholder = el.hasAttribute("placeholder");
|
|
15993
|
+
const isEmpty = el.value === "";
|
|
15994
|
+
const isDefaultEmpty = typeof el.defaultValue === "string" ? el.defaultValue === "" : true;
|
|
15995
|
+
const isNonUser = !v2.userTriggered;
|
|
15996
|
+
const isRepeatEmpty = !lastInputValue || lastInputValue.text === "";
|
|
15997
|
+
const isLikelyPhantom = hasPlaceholder && isEmpty && isDefaultEmpty && isRepeatEmpty && isNonUser && !v2.isChecked && el.type !== "hidden" && INPUT_TAGS.includes(el.tagName);
|
|
15998
|
+
const isRenderDrivenTextInput = el.tagName === "INPUT" && el.type === "text" && !v2.userTriggered && v2.text === el.defaultValue && !lastInputValue && el.hasAttribute("placeholder");
|
|
15999
|
+
const isValueFromDefault = !v2.userTriggered && el.value === el.defaultValue && !lastInputValue && el.hasAttribute("placeholder") && !v2.isChecked && el.type !== "hidden" && INPUT_TAGS.includes(el.tagName);
|
|
16000
|
+
const isPhantomCheckbox = el.type === "checkbox" && !v2.userTriggered && !v2.isChecked && !lastInputValue;
|
|
16001
|
+
const isPhantomRadio = el.type === "radio" && !v2.userTriggered && !v2.isChecked && !lastInputValue;
|
|
16002
|
+
if (isLikelyPhantom || isRenderDrivenTextInput || isValueFromDefault || isPhantomCheckbox || isPhantomRadio) {
|
|
16003
|
+
console.debug(
|
|
16004
|
+
`[${nowTimestamp()}] [rrweb:record/observer] ⛔ phantom input ignored`,
|
|
16005
|
+
{
|
|
16006
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call
|
|
16007
|
+
node: index.describeNode(el),
|
|
16008
|
+
tag: el.tagName,
|
|
16009
|
+
nodeType: el.nodeType,
|
|
16010
|
+
attribute: el.attributes,
|
|
16011
|
+
value: el.value,
|
|
16012
|
+
isLikelyPhantom,
|
|
16013
|
+
isRenderDrivenTextInput,
|
|
16014
|
+
isValueFromDefault,
|
|
16015
|
+
isPhantomCheckbox,
|
|
16016
|
+
isPhantomRadio
|
|
16017
|
+
}
|
|
16018
|
+
);
|
|
16019
|
+
return;
|
|
16020
|
+
}
|
|
16001
16021
|
}
|
|
16002
16022
|
if (!lastInputValue || lastInputValue.text !== v2.text || lastInputValue.isChecked !== v2.isChecked) {
|
|
16003
16023
|
lastInputValueMap.set(target, v2);
|
|
@@ -18048,8 +18068,15 @@ class NavigationManager {
|
|
|
18048
18068
|
handleNavigation(data) {
|
|
18049
18069
|
if (this.disabled) return;
|
|
18050
18070
|
if (this.locked) return;
|
|
18051
|
-
this.
|
|
18052
|
-
|
|
18071
|
+
if (this.pendingNavigation) {
|
|
18072
|
+
this.cancelTimers();
|
|
18073
|
+
this.disconnectSettlingObserver();
|
|
18074
|
+
this.pendingNavigation = null;
|
|
18075
|
+
this.onSnapshot(true);
|
|
18076
|
+
} else {
|
|
18077
|
+
this.cancelTimers();
|
|
18078
|
+
this.disconnectSettlingObserver();
|
|
18079
|
+
}
|
|
18053
18080
|
this.pendingNavigation = data;
|
|
18054
18081
|
if (this.frozen) {
|
|
18055
18082
|
return;
|
|
@@ -18256,7 +18283,7 @@ class ProcessedNodeManager {
|
|
|
18256
18283
|
destroy() {
|
|
18257
18284
|
}
|
|
18258
18285
|
}
|
|
18259
|
-
const version$1 = "3.
|
|
18286
|
+
const version$1 = "3.10.0-alpha.1";
|
|
18260
18287
|
let wrappedEmit;
|
|
18261
18288
|
let takeFullSnapshot$1;
|
|
18262
18289
|
let canvasManager;
|
|
@@ -18305,6 +18332,7 @@ function record(options = {}) {
|
|
|
18305
18332
|
recordAfter = options.recordAfter === "DOMContentLoaded" ? options.recordAfter : "load",
|
|
18306
18333
|
flushCustomEvent = options.flushCustomEvent !== void 0 ? options.flushCustomEvent : "after",
|
|
18307
18334
|
userTriggeredOnInput = false,
|
|
18335
|
+
trustSyntheticInput = false,
|
|
18308
18336
|
collectFonts = false,
|
|
18309
18337
|
inlineImages = false,
|
|
18310
18338
|
plugins,
|
|
@@ -18379,6 +18407,11 @@ function record(options = {}) {
|
|
|
18379
18407
|
let checkoutPending = false;
|
|
18380
18408
|
let checkoutDebounceTimer = null;
|
|
18381
18409
|
let checkoutFreezeTimestamp = null;
|
|
18410
|
+
let lastScrollEmitTime = 0;
|
|
18411
|
+
const scrollSettleTime = (sampling.scroll || 100) * 2;
|
|
18412
|
+
let lastSignificantMutationTime = 0;
|
|
18413
|
+
const mutationGracePeriod = 500;
|
|
18414
|
+
let hadVisibilityCheckoutInGrace = false;
|
|
18382
18415
|
const eventProcessor = (e2) => {
|
|
18383
18416
|
for (const plugin3 of plugins || []) {
|
|
18384
18417
|
if (plugin3.eventProcessor) {
|
|
@@ -18469,6 +18502,12 @@ function record(options = {}) {
|
|
|
18469
18502
|
}
|
|
18470
18503
|
};
|
|
18471
18504
|
const wrappedMutationEmit = (m) => {
|
|
18505
|
+
var _a2, _b;
|
|
18506
|
+
const totalChanges = (((_a2 = m.adds) == null ? void 0 : _a2.length) ?? 0) + (((_b = m.removes) == null ? void 0 : _b.length) ?? 0);
|
|
18507
|
+
if (totalChanges > 10) {
|
|
18508
|
+
lastSignificantMutationTime = nowTimestamp();
|
|
18509
|
+
hadVisibilityCheckoutInGrace = false;
|
|
18510
|
+
}
|
|
18472
18511
|
wrappedEmit({
|
|
18473
18512
|
type: EventType.IncrementalSnapshot,
|
|
18474
18513
|
data: {
|
|
@@ -18486,13 +18525,16 @@ function record(options = {}) {
|
|
|
18486
18525
|
}
|
|
18487
18526
|
});
|
|
18488
18527
|
};
|
|
18489
|
-
const wrappedScrollEmit = (p) =>
|
|
18490
|
-
|
|
18491
|
-
|
|
18492
|
-
|
|
18493
|
-
|
|
18494
|
-
|
|
18495
|
-
|
|
18528
|
+
const wrappedScrollEmit = (p) => {
|
|
18529
|
+
lastScrollEmitTime = nowTimestamp();
|
|
18530
|
+
wrappedEmit({
|
|
18531
|
+
type: EventType.IncrementalSnapshot,
|
|
18532
|
+
data: {
|
|
18533
|
+
source: IncrementalSource.Scroll,
|
|
18534
|
+
...p
|
|
18535
|
+
}
|
|
18536
|
+
});
|
|
18537
|
+
};
|
|
18496
18538
|
const wrappedCanvasMutationEmit = (p) => wrappedEmit({
|
|
18497
18539
|
type: EventType.IncrementalSnapshot,
|
|
18498
18540
|
data: {
|
|
@@ -18576,9 +18618,19 @@ function record(options = {}) {
|
|
|
18576
18618
|
mutationCb: recordVisibility ? wrappedVisibilityEmit : () => {
|
|
18577
18619
|
},
|
|
18578
18620
|
notifyActivity: checkoutEveryNvm != null ? (count) => {
|
|
18621
|
+
const now = nowTimestamp();
|
|
18622
|
+
const scrollRecent = now - lastScrollEmitTime < scrollSettleTime;
|
|
18623
|
+
const mutationRecent = now - lastSignificantMutationTime < mutationGracePeriod;
|
|
18624
|
+
if (scrollRecent && !mutationRecent) {
|
|
18625
|
+
return;
|
|
18626
|
+
}
|
|
18627
|
+
if (mutationRecent && hadVisibilityCheckoutInGrace) {
|
|
18628
|
+
return;
|
|
18629
|
+
}
|
|
18579
18630
|
visibilityMutationCount += count;
|
|
18580
18631
|
if (visibilityMutationCount >= checkoutEveryNvm) {
|
|
18581
18632
|
visibilityMutationCount = 0;
|
|
18633
|
+
hadVisibilityCheckoutInGrace = true;
|
|
18582
18634
|
if (checkoutDebounce) {
|
|
18583
18635
|
if (!checkoutPending) {
|
|
18584
18636
|
checkoutPending = true;
|
|
@@ -18820,6 +18872,7 @@ function record(options = {}) {
|
|
|
18820
18872
|
recordCanvas,
|
|
18821
18873
|
inlineImages,
|
|
18822
18874
|
userTriggeredOnInput,
|
|
18875
|
+
trustSyntheticInput,
|
|
18823
18876
|
collectFonts,
|
|
18824
18877
|
doc,
|
|
18825
18878
|
maskInputFn,
|
|
@@ -18896,6 +18949,43 @@ function record(options = {}) {
|
|
|
18896
18949
|
);
|
|
18897
18950
|
}
|
|
18898
18951
|
return () => {
|
|
18952
|
+
if (recording) {
|
|
18953
|
+
const activeEl = document.activeElement;
|
|
18954
|
+
if (activeEl && INPUT_TAGS.includes(activeEl.tagName)) {
|
|
18955
|
+
const inputEl = activeEl;
|
|
18956
|
+
const id = mirror.getId(inputEl);
|
|
18957
|
+
if (id !== -1) {
|
|
18958
|
+
const lastValue = lastInputValueMap.get(inputEl);
|
|
18959
|
+
let text = inputEl.value;
|
|
18960
|
+
let isChecked = false;
|
|
18961
|
+
const type = getInputType(inputEl) || "";
|
|
18962
|
+
if (type === "radio" || type === "checkbox") {
|
|
18963
|
+
isChecked = inputEl.checked;
|
|
18964
|
+
} else if (maskInputOptions[inputEl.tagName.toLowerCase()] || maskInputOptions[type]) {
|
|
18965
|
+
text = maskInputValue({
|
|
18966
|
+
element: inputEl,
|
|
18967
|
+
maskInputOptions,
|
|
18968
|
+
tagName: inputEl.tagName,
|
|
18969
|
+
type,
|
|
18970
|
+
value: text,
|
|
18971
|
+
maskInputFn
|
|
18972
|
+
});
|
|
18973
|
+
}
|
|
18974
|
+
if (!lastValue || lastValue.text !== text || lastValue.isChecked !== isChecked) {
|
|
18975
|
+
const inputData = userTriggeredOnInput ? { text, isChecked, userTriggered: false } : { text, isChecked };
|
|
18976
|
+
lastInputValueMap.set(inputEl, inputData);
|
|
18977
|
+
wrappedEmit({
|
|
18978
|
+
type: EventType.IncrementalSnapshot,
|
|
18979
|
+
data: {
|
|
18980
|
+
source: IncrementalSource.Input,
|
|
18981
|
+
...inputData,
|
|
18982
|
+
id
|
|
18983
|
+
}
|
|
18984
|
+
});
|
|
18985
|
+
}
|
|
18986
|
+
}
|
|
18987
|
+
}
|
|
18988
|
+
}
|
|
18899
18989
|
if (checkoutDebounceTimer) {
|
|
18900
18990
|
clearTimeout(checkoutDebounceTimer);
|
|
18901
18991
|
checkoutDebounceTimer = null;
|
|
@@ -21835,7 +21925,7 @@ class Replayer {
|
|
|
21835
21925
|
this.config.logger.log(REPLAY_CONSOLE_PREFIX, ...args);
|
|
21836
21926
|
}
|
|
21837
21927
|
}
|
|
21838
|
-
const version = "3.
|
|
21928
|
+
const version = "3.10.0-alpha.1";
|
|
21839
21929
|
const { getVersion } = record;
|
|
21840
21930
|
const { isRecording } = record;
|
|
21841
21931
|
const { flushCustomEventQueue } = record;
|