@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.
@@ -13031,7 +13031,7 @@ class VisibilityManager {
13031
13031
  }
13032
13032
  }
13033
13033
  }
13034
- const version$1 = "2.1.3-alpha.3";
13034
+ const version$1 = "2.1.3-alpha.4";
13035
13035
  let wrappedEmit;
13036
13036
  let takeFullSnapshot$1;
13037
13037
  let canvasManager;
@@ -13193,13 +13193,27 @@ function record(options = {}) {
13193
13193
  }
13194
13194
  return e2;
13195
13195
  };
13196
+ let lastMetaHref = null;
13197
+ let navSnapshotInProgress = false;
13196
13198
  wrappedEmit = (r2, isCheckout) => {
13197
- var _a2;
13199
+ var _a2, _b;
13198
13200
  const e2 = r2;
13199
13201
  e2.timestamp = nowTimestamp();
13202
+ let navTriggeredFS = false;
13200
13203
  if (((_a2 = mutationBuffers[0]) == null ? void 0 : _a2.isFrozen()) && e2.type !== EventType.FullSnapshot && !(e2.type === EventType.IncrementalSnapshot && e2.data.source === IncrementalSource.Mutation)) {
13201
13204
  mutationBuffers.forEach((buf) => buf.unfreeze());
13202
13205
  }
13206
+ if (!navSnapshotInProgress && e2.type !== EventType.Meta && e2.type !== EventType.FullSnapshot && lastMetaHref && window.location.href !== lastMetaHref) {
13207
+ navSnapshotInProgress = true;
13208
+ try {
13209
+ recentVisibilityChanges = 0;
13210
+ incrementalSnapshotCount = 0;
13211
+ navTriggeredFS = true;
13212
+ takeFullSnapshot$1(true);
13213
+ } finally {
13214
+ navSnapshotInProgress = false;
13215
+ }
13216
+ }
13203
13217
  if (inEmittingFrame) {
13204
13218
  emit == null ? void 0 : emit(eventProcessor(e2), isCheckout);
13205
13219
  } else if (passEmitsToParent) {
@@ -13211,6 +13225,9 @@ function record(options = {}) {
13211
13225
  };
13212
13226
  window.parent.postMessage(message, "*");
13213
13227
  }
13228
+ if (e2.type === EventType.Meta) {
13229
+ lastMetaHref = ((_b = e2.data) == null ? void 0 : _b.href) || window.location.href;
13230
+ }
13214
13231
  if (e2.type === EventType.FullSnapshot) {
13215
13232
  lastFullSnapshotEvent = e2;
13216
13233
  incrementalSnapshotCount = 0;
@@ -13219,14 +13236,16 @@ function record(options = {}) {
13219
13236
  return;
13220
13237
  }
13221
13238
  incrementalSnapshotCount++;
13222
- const exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;
13223
- const exceedTime = checkoutEveryNms && e2.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;
13224
- const exceedVisibility = checkoutEveryNvm && recentVisibilityChanges >= checkoutEveryNvm;
13225
- if (exceedCount || exceedTime || exceedVisibility) {
13226
- if (exceedVisibility) {
13227
- recentVisibilityChanges = 0;
13239
+ if (!navTriggeredFS) {
13240
+ const exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;
13241
+ const exceedTime = checkoutEveryNms && e2.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;
13242
+ const exceedVisibility = checkoutEveryNvm && recentVisibilityChanges >= checkoutEveryNvm;
13243
+ if (exceedCount || exceedTime || exceedVisibility) {
13244
+ if (exceedVisibility) {
13245
+ recentVisibilityChanges = 0;
13246
+ }
13247
+ takeFullSnapshot$1(true);
13228
13248
  }
13229
- takeFullSnapshot$1(true);
13230
13249
  }
13231
13250
  }
13232
13251
  };