@appsurify-testmap/rrweb 2.1.0-alpha.2 → 2.1.0-alpha.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.d.cts CHANGED
@@ -8,11 +8,12 @@ import { DocumentDimension } from '@appsurify-testmap/rrweb-types';
8
8
  import { Emitter } from '@appsurify-testmap/rrweb-types';
9
9
  import { EventType } from '@appsurify-testmap/rrweb-types';
10
10
  import { eventWithTime } from '@appsurify-testmap/rrweb-types';
11
+ import { excludeAttribute } from '@appsurify-testmap/rrweb-types';
11
12
  import { Handler } from '@appsurify-testmap/rrweb-types';
12
13
  import { hookResetter } from '@appsurify-testmap/rrweb-types';
13
14
  import { hooksParam } from '@appsurify-testmap/rrweb-types';
14
- import { ignoreAttribute } from '@appsurify-testmap/rrweb-types';
15
15
  import { IMirror } from '@appsurify-testmap/rrweb-types';
16
+ import { includeAttribute } from '@appsurify-testmap/rrweb-types';
16
17
  import { IncrementalSource } from '@appsurify-testmap/rrweb-types';
17
18
  import { IWindow } from '@appsurify-testmap/rrweb-types';
18
19
  import { KeepIframeSrcFn } from '@appsurify-testmap/rrweb-types';
@@ -119,7 +120,7 @@ export declare let mirror: DeprecatedMirror;
119
120
 
120
121
  export { MouseInteractions }
121
122
 
122
- declare let nowTimestamp: () => number;
123
+ declare function nowTimestamp(): number;
123
124
 
124
125
  declare function on(type: string, fn: EventListenerOrEventListenerObject, target?: Document | IWindow): listenerHandler;
125
126
 
@@ -223,14 +224,14 @@ export declare type recordOptions<T> = {
223
224
  emit?: (e: T, isCheckout?: boolean) => void;
224
225
  checkoutEveryNth?: number;
225
226
  checkoutEveryNms?: number;
226
- checkoutEveryEvc?: boolean;
227
227
  blockClass?: blockClass;
228
228
  blockSelector?: string;
229
229
  ignoreClass?: string;
230
230
  ignoreSelector?: string;
231
231
  maskTextClass?: maskTextClass;
232
232
  maskTextSelector?: string;
233
- ignoreAttribute?: ignoreAttribute;
233
+ excludeAttribute?: excludeAttribute;
234
+ includeAttribute?: includeAttribute;
234
235
  maskAllInputs?: boolean;
235
236
  maskInputOptions?: MaskInputOptions;
236
237
  maskInputFn?: MaskInputFn;
@@ -431,6 +432,7 @@ declare namespace utils {
431
432
  on,
432
433
  throttle,
433
434
  hookSetter,
435
+ nowTimestamp,
434
436
  getWindowScroll,
435
437
  getWindowHeight,
436
438
  getWindowWidth,
@@ -455,7 +457,6 @@ declare namespace utils {
455
457
  shadowHostInDom,
456
458
  inDom,
457
459
  mirror as _mirror,
458
- nowTimestamp,
459
460
  AppendedIframe,
460
461
  StyleSheetMirror
461
462
  }
package/dist/rrweb.d.ts CHANGED
@@ -8,11 +8,12 @@ import { DocumentDimension } from '@appsurify-testmap/rrweb-types';
8
8
  import { Emitter } from '@appsurify-testmap/rrweb-types';
9
9
  import { EventType } from '@appsurify-testmap/rrweb-types';
10
10
  import { eventWithTime } from '@appsurify-testmap/rrweb-types';
11
+ import { excludeAttribute } from '@appsurify-testmap/rrweb-types';
11
12
  import { Handler } from '@appsurify-testmap/rrweb-types';
12
13
  import { hookResetter } from '@appsurify-testmap/rrweb-types';
13
14
  import { hooksParam } from '@appsurify-testmap/rrweb-types';
14
- import { ignoreAttribute } from '@appsurify-testmap/rrweb-types';
15
15
  import { IMirror } from '@appsurify-testmap/rrweb-types';
16
+ import { includeAttribute } from '@appsurify-testmap/rrweb-types';
16
17
  import { IncrementalSource } from '@appsurify-testmap/rrweb-types';
17
18
  import { IWindow } from '@appsurify-testmap/rrweb-types';
18
19
  import { KeepIframeSrcFn } from '@appsurify-testmap/rrweb-types';
@@ -119,7 +120,7 @@ export declare let mirror: DeprecatedMirror;
119
120
 
120
121
  export { MouseInteractions }
121
122
 
122
- declare let nowTimestamp: () => number;
123
+ declare function nowTimestamp(): number;
123
124
 
124
125
  declare function on(type: string, fn: EventListenerOrEventListenerObject, target?: Document | IWindow): listenerHandler;
125
126
 
@@ -223,14 +224,14 @@ export declare type recordOptions<T> = {
223
224
  emit?: (e: T, isCheckout?: boolean) => void;
224
225
  checkoutEveryNth?: number;
225
226
  checkoutEveryNms?: number;
226
- checkoutEveryEvc?: boolean;
227
227
  blockClass?: blockClass;
228
228
  blockSelector?: string;
229
229
  ignoreClass?: string;
230
230
  ignoreSelector?: string;
231
231
  maskTextClass?: maskTextClass;
232
232
  maskTextSelector?: string;
233
- ignoreAttribute?: ignoreAttribute;
233
+ excludeAttribute?: excludeAttribute;
234
+ includeAttribute?: includeAttribute;
234
235
  maskAllInputs?: boolean;
235
236
  maskInputOptions?: MaskInputOptions;
236
237
  maskInputFn?: MaskInputFn;
@@ -431,6 +432,7 @@ declare namespace utils {
431
432
  on,
432
433
  throttle,
433
434
  hookSetter,
435
+ nowTimestamp,
434
436
  getWindowScroll,
435
437
  getWindowHeight,
436
438
  getWindowWidth,
@@ -455,7 +457,6 @@ declare namespace utils {
455
457
  shadowHostInDom,
456
458
  inDom,
457
459
  mirror as _mirror,
458
- nowTimestamp,
459
460
  AppendedIframe,
460
461
  StyleSheetMirror
461
462
  }
package/dist/rrweb.js CHANGED
@@ -890,28 +890,14 @@ function transformAttribute(doc, tagName, name, value) {
890
890
  }
891
891
  return value;
892
892
  }
893
- function isIgnoreAttribute(tagName, name, _value) {
893
+ function ignoreAttribute(tagName, name, _value) {
894
894
  return (tagName === "video" || tagName === "audio") && name === "autoplay";
895
895
  }
896
- function cleanAttributes(doc, element, ignoreAttribute) {
897
- const tagName = getValidTagName$1(element);
898
- const attributes = {};
899
- const len = element.attributes.length;
900
- for (let i2 = 0; i2 < len; i2++) {
901
- const attr = element.attributes[i2];
902
- const name = attr.name;
903
- const value = attr.value;
904
- const shouldIgnoreByName = typeof ignoreAttribute === "string" ? name === ignoreAttribute : ignoreAttribute.test(name);
905
- if (!shouldIgnoreByName && !isIgnoreAttribute(tagName, name)) {
906
- attributes[name] = transformAttribute(
907
- doc,
908
- tagName,
909
- toLowerCase(name),
910
- value
911
- );
912
- }
913
- }
914
- return attributes;
896
+ function isIncludeAttribute(name, include) {
897
+ return typeof include === "string" ? name.includes(include) : include.test(name);
898
+ }
899
+ function isExcludeAttribute(name, exclude) {
900
+ return typeof exclude === "string" ? name.includes(exclude) : exclude.test(name);
915
901
  }
916
902
  function _isBlockedElement(element, blockClass, blockSelector) {
917
903
  try {
@@ -1042,7 +1028,8 @@ function serializeNode(n2, options) {
1042
1028
  mirror: mirror2,
1043
1029
  blockClass,
1044
1030
  blockSelector,
1045
- ignoreAttribute,
1031
+ excludeAttribute,
1032
+ includeAttribute,
1046
1033
  needsMask,
1047
1034
  inlineStylesheet,
1048
1035
  maskInputOptions = {},
@@ -1088,7 +1075,8 @@ function serializeNode(n2, options) {
1088
1075
  doc,
1089
1076
  blockClass,
1090
1077
  blockSelector,
1091
- ignoreAttribute,
1078
+ excludeAttribute,
1079
+ includeAttribute,
1092
1080
  inlineStylesheet,
1093
1081
  maskInputOptions,
1094
1082
  maskInputFn,
@@ -1166,7 +1154,8 @@ function serializeElementNode(n2, options) {
1166
1154
  doc,
1167
1155
  blockClass,
1168
1156
  blockSelector,
1169
- ignoreAttribute,
1157
+ excludeAttribute,
1158
+ includeAttribute,
1170
1159
  inlineStylesheet,
1171
1160
  maskInputOptions = {},
1172
1161
  maskInputFn,
@@ -1180,7 +1169,22 @@ function serializeElementNode(n2, options) {
1180
1169
  } = options;
1181
1170
  const needBlock = _isBlockedElement(n2, blockClass, blockSelector);
1182
1171
  const tagName = getValidTagName$1(n2);
1183
- let attributes = cleanAttributes(doc, n2, ignoreAttribute);
1172
+ let attributes = {};
1173
+ const len = n2.attributes.length;
1174
+ for (let i2 = 0; i2 < len; i2++) {
1175
+ const attr = n2.attributes[i2];
1176
+ if (isExcludeAttribute(attr.name, excludeAttribute) && !isIncludeAttribute(attr.name, includeAttribute)) {
1177
+ continue;
1178
+ }
1179
+ if (!ignoreAttribute(tagName, attr.name, attr.value)) {
1180
+ attributes[attr.name] = transformAttribute(
1181
+ doc,
1182
+ tagName,
1183
+ toLowerCase(attr.name),
1184
+ attr.value
1185
+ );
1186
+ }
1187
+ }
1184
1188
  if (tagName === "link" && inlineStylesheet) {
1185
1189
  const stylesheet = Array.from(doc.styleSheets).find((s2) => {
1186
1190
  return s2.href === n2.href;
@@ -1394,7 +1398,8 @@ function serializeNodeWithId(n2, options) {
1394
1398
  blockSelector,
1395
1399
  maskTextClass,
1396
1400
  maskTextSelector,
1397
- ignoreAttribute,
1401
+ excludeAttribute,
1402
+ includeAttribute,
1398
1403
  skipChild = false,
1399
1404
  inlineStylesheet = true,
1400
1405
  maskInputOptions = {},
@@ -1429,7 +1434,8 @@ function serializeNodeWithId(n2, options) {
1429
1434
  mirror: mirror2,
1430
1435
  blockClass,
1431
1436
  blockSelector,
1432
- ignoreAttribute,
1437
+ excludeAttribute,
1438
+ includeAttribute,
1433
1439
  needsMask,
1434
1440
  inlineStylesheet,
1435
1441
  maskInputOptions,
@@ -1482,7 +1488,8 @@ function serializeNodeWithId(n2, options) {
1482
1488
  needsMask,
1483
1489
  maskTextClass,
1484
1490
  maskTextSelector,
1485
- ignoreAttribute,
1491
+ excludeAttribute,
1492
+ includeAttribute,
1486
1493
  skipChild,
1487
1494
  inlineStylesheet,
1488
1495
  maskInputOptions,
@@ -1542,7 +1549,8 @@ function serializeNodeWithId(n2, options) {
1542
1549
  needsMask,
1543
1550
  maskTextClass,
1544
1551
  maskTextSelector,
1545
- ignoreAttribute,
1552
+ excludeAttribute,
1553
+ includeAttribute,
1546
1554
  skipChild: false,
1547
1555
  inlineStylesheet,
1548
1556
  maskInputOptions,
@@ -1584,7 +1592,8 @@ function serializeNodeWithId(n2, options) {
1584
1592
  needsMask,
1585
1593
  maskTextClass,
1586
1594
  maskTextSelector,
1587
- ignoreAttribute,
1595
+ excludeAttribute,
1596
+ includeAttribute,
1588
1597
  skipChild: false,
1589
1598
  inlineStylesheet,
1590
1599
  maskInputOptions,
@@ -1622,7 +1631,8 @@ function snapshot(n2, options) {
1622
1631
  blockSelector = null,
1623
1632
  maskTextClass = "rr-mask",
1624
1633
  maskTextSelector = null,
1625
- ignoreAttribute = "rr-ignore",
1634
+ excludeAttribute = /^$a/,
1635
+ includeAttribute = /.+/i,
1626
1636
  inlineStylesheet = true,
1627
1637
  inlineImages = false,
1628
1638
  recordCanvas = false,
@@ -1682,7 +1692,8 @@ function snapshot(n2, options) {
1682
1692
  blockSelector,
1683
1693
  maskTextClass,
1684
1694
  maskTextSelector,
1685
- ignoreAttribute,
1695
+ excludeAttribute,
1696
+ includeAttribute,
1686
1697
  skipChild: false,
1687
1698
  inlineStylesheet,
1688
1699
  maskInputOptions,
@@ -10917,9 +10928,8 @@ function hookSetter(target, key, d, isRevoked, win = window) {
10917
10928
  );
10918
10929
  return () => hookSetter(target, key, original || {}, true);
10919
10930
  }
10920
- let nowTimestamp = Date.now;
10921
- if (!/* @__PURE__ */ /[1-9][0-9]{12}/.test(Date.now().toString())) {
10922
- nowTimestamp = () => (/* @__PURE__ */ new Date()).getTime();
10931
+ function nowTimestamp() {
10932
+ return Math.round(performance.timeOrigin + performance.now());
10923
10933
  }
10924
10934
  function getWindowScroll(win = window) {
10925
10935
  var _a2, _b, _c, _d;
@@ -11200,9 +11210,7 @@ const utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
11200
11210
  isSerializedStylesheet,
11201
11211
  iterateResolveTree,
11202
11212
  legacy_isTouchEvent,
11203
- get nowTimestamp() {
11204
- return nowTimestamp;
11205
- },
11213
+ nowTimestamp,
11206
11214
  on,
11207
11215
  polyfill: polyfill$1,
11208
11216
  queueToResolveTrees,
@@ -11238,7 +11246,6 @@ var IncrementalSource = /* @__PURE__ */ ((IncrementalSource2) => {
11238
11246
  IncrementalSource2[IncrementalSource2["Selection"] = 14] = "Selection";
11239
11247
  IncrementalSource2[IncrementalSource2["AdoptedStyleSheet"] = 15] = "AdoptedStyleSheet";
11240
11248
  IncrementalSource2[IncrementalSource2["CustomElement"] = 16] = "CustomElement";
11241
- IncrementalSource2[IncrementalSource2["VisibilityChange"] = 17] = "VisibilityChange";
11242
11249
  return IncrementalSource2;
11243
11250
  })(IncrementalSource || {});
11244
11251
  var MouseInteractions = /* @__PURE__ */ ((MouseInteractions2) => {
@@ -11421,7 +11428,8 @@ class MutationBuffer {
11421
11428
  __publicField(this, "blockSelector");
11422
11429
  __publicField(this, "maskTextClass");
11423
11430
  __publicField(this, "maskTextSelector");
11424
- __publicField(this, "ignoreAttribute");
11431
+ __publicField(this, "excludeAttribute");
11432
+ __publicField(this, "includeAttribute");
11425
11433
  __publicField(this, "inlineStylesheet");
11426
11434
  __publicField(this, "maskInputOptions");
11427
11435
  __publicField(this, "maskTextFn");
@@ -11485,7 +11493,8 @@ class MutationBuffer {
11485
11493
  blockSelector: this.blockSelector,
11486
11494
  maskTextClass: this.maskTextClass,
11487
11495
  maskTextSelector: this.maskTextSelector,
11488
- ignoreAttribute: this.ignoreAttribute || "",
11496
+ excludeAttribute: this.excludeAttribute,
11497
+ includeAttribute: this.includeAttribute,
11489
11498
  skipChild: true,
11490
11499
  newlyAddedElement: true,
11491
11500
  inlineStylesheet: this.inlineStylesheet,
@@ -11687,6 +11696,14 @@ class MutationBuffer {
11687
11696
  const target = m.target;
11688
11697
  let attributeName = m.attributeName;
11689
11698
  let value = m.target.getAttribute(attributeName);
11699
+ const propValue = target[attributeName];
11700
+ const isPhantomAttributeMutation = value === null && !target.hasAttribute(attributeName) && m.oldValue !== null && (propValue === "" || propValue === null || typeof propValue === "undefined");
11701
+ if (isPhantomAttributeMutation && !isIncludeAttribute(attributeName, this.includeAttribute)) {
11702
+ return;
11703
+ }
11704
+ if (isExcludeAttribute(attributeName, this.excludeAttribute)) {
11705
+ return;
11706
+ }
11690
11707
  if (attributeName === "value") {
11691
11708
  const type = getInputType(target);
11692
11709
  value = maskInputValue({
@@ -11722,13 +11739,21 @@ class MutationBuffer {
11722
11739
  if (attributeName === "type" && target.tagName === "INPUT" && (m.oldValue || "").toLowerCase() === "password") {
11723
11740
  target.setAttribute("data-rr-is-password", "true");
11724
11741
  }
11725
- if (!isIgnoreAttribute(target.tagName, attributeName)) {
11742
+ if (!ignoreAttribute(target.tagName, attributeName)) {
11726
11743
  item.attributes[attributeName] = transformAttribute(
11727
11744
  this.doc,
11728
11745
  toLowerCase(target.tagName),
11729
11746
  toLowerCase(attributeName),
11730
11747
  value
11731
11748
  );
11749
+ if (value === item.attributes[attributeName] && !isIncludeAttribute(attributeName, this.includeAttribute)) {
11750
+ delete item.attributes[attributeName];
11751
+ if (Object.keys(item.attributes).length === 0) {
11752
+ this.attributes = this.attributes.filter((a2) => a2 !== item);
11753
+ this.attributeMap.delete(m.target);
11754
+ }
11755
+ return;
11756
+ }
11732
11757
  if (attributeName === "style") {
11733
11758
  if (!this.unattachedDoc) {
11734
11759
  try {
@@ -11844,7 +11869,8 @@ class MutationBuffer {
11844
11869
  "blockSelector",
11845
11870
  "maskTextClass",
11846
11871
  "maskTextSelector",
11847
- "ignoreAttribute",
11872
+ "excludeAttribute",
11873
+ "includeAttribute",
11848
11874
  "inlineStylesheet",
11849
11875
  "maskInputOptions",
11850
11876
  "maskTextFn",
@@ -11983,60 +12009,6 @@ function initMutationObserver(options, rootEl) {
11983
12009
  });
11984
12010
  return observer;
11985
12011
  }
11986
- function initVisibilityObserver({
11987
- visibilityChangeCb,
11988
- doc,
11989
- mirror: mirror2,
11990
- sampling
11991
- }) {
11992
- if (!visibilityChangeCb) {
11993
- return () => {
11994
- };
11995
- }
11996
- const observedElements = /* @__PURE__ */ new WeakMap();
11997
- const debounceThreshold = typeof sampling.visibility === "number" ? sampling.visibility : 50;
11998
- const throttledCb = throttle(
11999
- callbackWrapper((entry) => {
12000
- const target = entry.target;
12001
- const id = mirror2.getId(target);
12002
- const isVisible = entry.isIntersecting || entry.intersectionRatio > 0;
12003
- if (id !== -1) {
12004
- visibilityChangeCb({
12005
- id,
12006
- isVisible,
12007
- visibilityRatio: entry.intersectionRatio
12008
- });
12009
- }
12010
- }),
12011
- debounceThreshold,
12012
- { leading: sampling.visibility !== false, trailing: true }
12013
- );
12014
- const observer = new IntersectionObserver((entries) => {
12015
- entries.forEach((entry) => {
12016
- const target = entry.target;
12017
- if (observedElements.has(target)) {
12018
- throttledCb(entry);
12019
- } else {
12020
- observedElements.set(target, true);
12021
- }
12022
- });
12023
- }, { root: null, threshold: [0.1, 0.9] });
12024
- doc.querySelectorAll("*").forEach((el) => observer.observe(el));
12025
- const mutationObserver = new MutationObserver((mutations) => {
12026
- mutations.forEach((mutation) => {
12027
- mutation.addedNodes.forEach((node2) => {
12028
- if (node2 instanceof Element) {
12029
- observer.observe(node2);
12030
- }
12031
- });
12032
- });
12033
- });
12034
- mutationObserver.observe(doc, { childList: true, subtree: true });
12035
- return () => {
12036
- observer.disconnect();
12037
- mutationObserver.disconnect();
12038
- };
12039
- }
12040
12012
  function initMoveObserver({
12041
12013
  mousemoveCb,
12042
12014
  sampling,
@@ -12316,6 +12288,20 @@ function initInputObserver({
12316
12288
  }
12317
12289
  function cbWithDedup(target, v2) {
12318
12290
  const lastInputValue = lastInputValueMap.get(target);
12291
+ const el = target;
12292
+ const hasPlaceholder = el.hasAttribute("placeholder");
12293
+ const isEmpty = el.value === "";
12294
+ const isDefaultEmpty = typeof el.defaultValue === "string" ? el.defaultValue === "" : true;
12295
+ const isNonUser = !v2.userTriggered;
12296
+ const isRepeatEmpty = !lastInputValue || lastInputValue.text === "";
12297
+ const isLikelyPhantom = hasPlaceholder && isEmpty && isDefaultEmpty && isRepeatEmpty && isNonUser && !v2.isChecked && el.type !== "hidden" && INPUT_TAGS.includes(el.tagName);
12298
+ const isRenderDrivenTextInput = el.tagName === "INPUT" && el.type === "text" && !v2.userTriggered && v2.text === el.defaultValue && !lastInputValue && el.hasAttribute("placeholder");
12299
+ const isValueFromDefault = !v2.userTriggered && el.value === el.defaultValue && !lastInputValue && el.hasAttribute("placeholder") && !v2.isChecked && el.type !== "hidden" && INPUT_TAGS.includes(el.tagName);
12300
+ const isPhantomCheckbox = el.type === "checkbox" && !v2.userTriggered && !v2.isChecked && !lastInputValue;
12301
+ const isPhantomRadio = el.type === "radio" && !v2.userTriggered && !v2.isChecked && !lastInputValue;
12302
+ if (isLikelyPhantom || isRenderDrivenTextInput || isValueFromDefault || isPhantomCheckbox || isPhantomRadio) {
12303
+ return;
12304
+ }
12319
12305
  if (!lastInputValue || lastInputValue.text !== v2.text || lastInputValue.isChecked !== v2.isChecked) {
12320
12306
  lastInputValueMap.set(target, v2);
12321
12307
  const id = mirror2.getId(target);
@@ -12853,7 +12839,6 @@ function initCustomElementObserver({
12853
12839
  function mergeHooks(o2, hooks) {
12854
12840
  const {
12855
12841
  mutationCb,
12856
- visibilityChangeCb,
12857
12842
  mousemoveCb,
12858
12843
  mouseInteractionCb,
12859
12844
  scrollCb,
@@ -12873,12 +12858,6 @@ function mergeHooks(o2, hooks) {
12873
12858
  }
12874
12859
  mutationCb(...p);
12875
12860
  };
12876
- o2.visibilityChangeCb = (...p) => {
12877
- if (hooks.visibilityChange) {
12878
- hooks.visibilityChange(...p);
12879
- }
12880
- visibilityChangeCb(...p);
12881
- };
12882
12861
  o2.mousemoveCb = (...p) => {
12883
12862
  if (hooks.mousemove) {
12884
12863
  hooks.mousemove(...p);
@@ -12971,7 +12950,6 @@ function initObservers(o2, hooks = {}) {
12971
12950
  });
12972
12951
  const inputHandler = initInputObserver(o2);
12973
12952
  const mediaInteractionHandler = initMediaInteractionObserver(o2);
12974
- const visibleHandler = initVisibilityObserver(o2);
12975
12953
  let styleSheetObserver = () => {
12976
12954
  };
12977
12955
  let adoptedStyleSheetObserver = () => {
@@ -13001,7 +12979,6 @@ function initObservers(o2, hooks = {}) {
13001
12979
  return callbackWrapper(() => {
13002
12980
  mutationBuffers.forEach((b) => b.reset());
13003
12981
  mutationObserver == null ? void 0 : mutationObserver.disconnect();
13004
- visibleHandler();
13005
12982
  mousemoveHandler();
13006
12983
  mouseInteractionHandler();
13007
12984
  scrollHandler();
@@ -14088,12 +14065,12 @@ function record(options = {}) {
14088
14065
  emit,
14089
14066
  checkoutEveryNms,
14090
14067
  checkoutEveryNth,
14091
- checkoutEveryEvc,
14092
14068
  blockClass = "rr-block",
14093
14069
  blockSelector = null,
14094
14070
  ignoreClass = "rr-ignore",
14095
14071
  ignoreSelector = null,
14096
- ignoreAttribute = "rr-ignore",
14072
+ excludeAttribute: _excludeAttribute,
14073
+ includeAttribute: _includeAttribute,
14097
14074
  maskTextClass = "rr-mask",
14098
14075
  maskTextSelector = null,
14099
14076
  inlineStylesheet = true,
@@ -14142,6 +14119,8 @@ function record(options = {}) {
14142
14119
  sampling.mousemove = mousemoveWait;
14143
14120
  }
14144
14121
  mirror.reset();
14122
+ const excludeAttribute = _excludeAttribute === void 0 ? /^$a/ : _excludeAttribute;
14123
+ const includeAttribute = _includeAttribute === void 0 ? /.+/i : _includeAttribute;
14145
14124
  const maskInputOptions = maskAllInputs === true ? {
14146
14125
  color: true,
14147
14126
  date: true,
@@ -14218,8 +14197,7 @@ function record(options = {}) {
14218
14197
  incrementalSnapshotCount++;
14219
14198
  const exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;
14220
14199
  const exceedTime = checkoutEveryNms && e2.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;
14221
- const isVisibilityChanged = checkoutEveryEvc && e2.type === EventType.IncrementalSnapshot && e2.data.source === IncrementalSource.VisibilityChange;
14222
- if (exceedCount || exceedTime || isVisibilityChanged) {
14200
+ if (exceedCount || exceedTime) {
14223
14201
  takeFullSnapshot$1(true);
14224
14202
  }
14225
14203
  }
@@ -14292,7 +14270,8 @@ function record(options = {}) {
14292
14270
  blockSelector,
14293
14271
  maskTextClass,
14294
14272
  maskTextSelector,
14295
- ignoreAttribute,
14273
+ excludeAttribute,
14274
+ includeAttribute,
14296
14275
  inlineStylesheet,
14297
14276
  maskInputOptions,
14298
14277
  dataURLOptions,
@@ -14334,7 +14313,8 @@ function record(options = {}) {
14334
14313
  blockSelector,
14335
14314
  maskTextClass,
14336
14315
  maskTextSelector,
14337
- ignoreAttribute,
14316
+ excludeAttribute,
14317
+ includeAttribute,
14338
14318
  inlineStylesheet,
14339
14319
  maskAllInputs: maskInputOptions,
14340
14320
  maskTextFn,
@@ -14390,15 +14370,6 @@ function record(options = {}) {
14390
14370
  return callbackWrapper(initObservers)(
14391
14371
  {
14392
14372
  mutationCb: wrappedMutationEmit,
14393
- visibilityChangeCb: (v2) => {
14394
- wrappedEmit({
14395
- type: EventType.IncrementalSnapshot,
14396
- data: {
14397
- source: IncrementalSource.VisibilityChange,
14398
- ...v2
14399
- }
14400
- });
14401
- },
14402
14373
  mousemoveCb: (positions, source) => wrappedEmit({
14403
14374
  type: EventType.IncrementalSnapshot,
14404
14375
  data: {
@@ -14480,7 +14451,8 @@ function record(options = {}) {
14480
14451
  ignoreSelector,
14481
14452
  maskTextClass,
14482
14453
  maskTextSelector,
14483
- ignoreAttribute,
14454
+ excludeAttribute,
14455
+ includeAttribute,
14484
14456
  maskInputOptions,
14485
14457
  inlineStylesheet,
14486
14458
  sampling,