@appsurify-testmap/rrweb-all 2.1.0-alpha.2 → 2.1.0-alpha.3

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.
@@ -915,6 +915,10 @@ function cleanAttributes(doc, element, ignoreAttribute) {
915
915
  }
916
916
  return attributes;
917
917
  }
918
+ function shouldIgnoreAttribute(ignore, name) {
919
+ if (!ignore) return false;
920
+ return typeof ignore === "string" ? name === ignore : ignore.test(name);
921
+ }
918
922
  function _isBlockedElement(element, blockClass, blockSelector) {
919
923
  try {
920
924
  if (typeof blockClass === "string") {
@@ -10919,9 +10923,8 @@ function hookSetter(target, key, d, isRevoked, win = window) {
10919
10923
  );
10920
10924
  return () => hookSetter(target, key, original || {}, true);
10921
10925
  }
10922
- let nowTimestamp = Date.now;
10923
- if (!/* @__PURE__ */ /[1-9][0-9]{12}/.test(Date.now().toString())) {
10924
- nowTimestamp = () => (/* @__PURE__ */ new Date()).getTime();
10926
+ function nowTimestamp() {
10927
+ return performance.timeOrigin + performance.now();
10925
10928
  }
10926
10929
  function getWindowScroll(win = window) {
10927
10930
  var _a2, _b2, _c, _d;
@@ -11202,9 +11205,7 @@ const utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
11202
11205
  isSerializedStylesheet,
11203
11206
  iterateResolveTree,
11204
11207
  legacy_isTouchEvent,
11205
- get nowTimestamp() {
11206
- return nowTimestamp;
11207
- },
11208
+ nowTimestamp,
11208
11209
  on,
11209
11210
  polyfill: polyfill$1,
11210
11211
  queueToResolveTrees,
@@ -11590,6 +11591,21 @@ class MutationBuffer {
11590
11591
  };
11591
11592
  }).filter((text) => !addedIds.has(text.id)).filter((text) => this.mirror.has(text.id)),
11592
11593
  attributes: this.attributes.map((attribute) => {
11594
+ const element = attribute.node;
11595
+ const filtered = {};
11596
+ for (const [name, value] of Object.entries(attribute.attributes)) {
11597
+ const isIgnored2 = shouldIgnoreAttribute(this.ignoreAttribute, name);
11598
+ const existedBefore = element.hasAttribute(name);
11599
+ const keep = value !== null && !isIgnored2 || value === null && (!isIgnored2 || attribute.attributes[name] !== null || existedBefore);
11600
+ if (keep) {
11601
+ filtered[name] = value;
11602
+ }
11603
+ }
11604
+ return {
11605
+ ...attribute,
11606
+ attributes: filtered
11607
+ };
11608
+ }).filter((attribute) => Object.keys(attribute.attributes).length > 0).map((attribute) => {
11593
11609
  const { attributes } = attribute;
11594
11610
  if (typeof attributes.style === "string") {
11595
11611
  const diffAsStr = JSON.stringify(attribute.styleDiff);
@@ -11671,7 +11687,10 @@ class MutationBuffer {
11671
11687
  case "attributes": {
11672
11688
  const target = m.target;
11673
11689
  let attributeName = m.attributeName;
11674
- let value = m.target.getAttribute(attributeName);
11690
+ let value = target.getAttribute(attributeName);
11691
+ if (value === null && m.oldValue === null) {
11692
+ return;
11693
+ }
11675
11694
  if (attributeName === "value") {
11676
11695
  const type = getInputType(target);
11677
11696
  value = maskInputValue({
@@ -11707,7 +11726,8 @@ class MutationBuffer {
11707
11726
  if (attributeName === "type" && target.tagName === "INPUT" && (m.oldValue || "").toLowerCase() === "password") {
11708
11727
  target.setAttribute("data-rr-is-password", "true");
11709
11728
  }
11710
- if (!isIgnoreAttribute(target.tagName, attributeName)) {
11729
+ if (!isIgnoreAttribute(target.tagName, attributeName) && // eslint-disable-next-line @typescript-eslint/no-unsafe-call
11730
+ !shouldIgnoreAttribute(this.ignoreAttribute, attributeName)) {
11711
11731
  item.attributes[attributeName] = transformAttribute(
11712
11732
  this.doc,
11713
11733
  toLowerCase(target.tagName),