@appsurify-testmap/rrweb-record 2.1.3-alpha.3 → 2.1.3-alpha.4

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.
@@ -12607,7 +12607,7 @@ class VisibilityManager {
12607
12607
  }
12608
12608
  }
12609
12609
  }
12610
- const version$1 = "2.1.3-alpha.3";
12610
+ const version$1 = "2.1.3-alpha.4";
12611
12611
  let wrappedEmit;
12612
12612
  let takeFullSnapshot$1;
12613
12613
  let canvasManager;
@@ -12769,13 +12769,27 @@ function record(options = {}) {
12769
12769
  }
12770
12770
  return e2;
12771
12771
  };
12772
+ let lastMetaHref = null;
12773
+ let navSnapshotInProgress = false;
12772
12774
  wrappedEmit = (r2, isCheckout) => {
12773
- var _a2;
12775
+ var _a2, _b;
12774
12776
  const e2 = r2;
12775
12777
  e2.timestamp = nowTimestamp();
12778
+ let navTriggeredFS = false;
12776
12779
  if (((_a2 = mutationBuffers[0]) == null ? void 0 : _a2.isFrozen()) && e2.type !== EventType.FullSnapshot && !(e2.type === EventType.IncrementalSnapshot && e2.data.source === IncrementalSource.Mutation)) {
12777
12780
  mutationBuffers.forEach((buf) => buf.unfreeze());
12778
12781
  }
12782
+ if (!navSnapshotInProgress && e2.type !== EventType.Meta && e2.type !== EventType.FullSnapshot && lastMetaHref && window.location.href !== lastMetaHref) {
12783
+ navSnapshotInProgress = true;
12784
+ try {
12785
+ recentVisibilityChanges = 0;
12786
+ incrementalSnapshotCount = 0;
12787
+ navTriggeredFS = true;
12788
+ takeFullSnapshot$1(true);
12789
+ } finally {
12790
+ navSnapshotInProgress = false;
12791
+ }
12792
+ }
12779
12793
  if (inEmittingFrame) {
12780
12794
  emit == null ? void 0 : emit(eventProcessor(e2), isCheckout);
12781
12795
  } else if (passEmitsToParent) {
@@ -12787,6 +12801,9 @@ function record(options = {}) {
12787
12801
  };
12788
12802
  window.parent.postMessage(message, "*");
12789
12803
  }
12804
+ if (e2.type === EventType.Meta) {
12805
+ lastMetaHref = ((_b = e2.data) == null ? void 0 : _b.href) || window.location.href;
12806
+ }
12790
12807
  if (e2.type === EventType.FullSnapshot) {
12791
12808
  lastFullSnapshotEvent = e2;
12792
12809
  incrementalSnapshotCount = 0;
@@ -12795,14 +12812,16 @@ function record(options = {}) {
12795
12812
  return;
12796
12813
  }
12797
12814
  incrementalSnapshotCount++;
12798
- const exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;
12799
- const exceedTime = checkoutEveryNms && e2.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;
12800
- const exceedVisibility = checkoutEveryNvm && recentVisibilityChanges >= checkoutEveryNvm;
12801
- if (exceedCount || exceedTime || exceedVisibility) {
12802
- if (exceedVisibility) {
12803
- recentVisibilityChanges = 0;
12815
+ if (!navTriggeredFS) {
12816
+ const exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;
12817
+ const exceedTime = checkoutEveryNms && e2.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;
12818
+ const exceedVisibility = checkoutEveryNvm && recentVisibilityChanges >= checkoutEveryNvm;
12819
+ if (exceedCount || exceedTime || exceedVisibility) {
12820
+ if (exceedVisibility) {
12821
+ recentVisibilityChanges = 0;
12822
+ }
12823
+ takeFullSnapshot$1(true);
12804
12824
  }
12805
- takeFullSnapshot$1(true);
12806
12825
  }
12807
12826
  }
12808
12827
  };