@appsurify-testmap/rrweb 2.0.0-alpha.31 → 2.0.0-alpha.35

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 CHANGED
@@ -666,7 +666,6 @@ EventTarget.prototype.addEventListener = function(type, listener, options) {
666
666
  originalAddEventListener$1.call(this, type, listener, options);
667
667
  if (this instanceof Element) {
668
668
  const eventType = type.toLowerCase();
669
- console.info("Event type: ", eventType);
670
669
  if (interactiveEvents$1.includes(eventType)) {
671
670
  interactiveElementsRegistry$1.add(this);
672
671
  }
@@ -5715,7 +5714,6 @@ EventTarget.prototype.addEventListener = function(type, listener, options) {
5715
5714
  originalAddEventListener.call(this, type, listener, options);
5716
5715
  if (this instanceof Element) {
5717
5716
  const eventType = type.toLowerCase();
5718
- console.info("Event type: ", eventType);
5719
5717
  if (interactiveEvents.includes(eventType)) {
5720
5718
  interactiveElementsRegistry.add(this);
5721
5719
  }
@@ -13965,6 +13963,7 @@ try {
13965
13963
  }
13966
13964
  const mirror = createMirror$2();
13967
13965
  function record(options = {}) {
13966
+ var _a2;
13968
13967
  const {
13969
13968
  emit,
13970
13969
  checkoutEveryNms,
@@ -13999,12 +13998,24 @@ function record(options = {}) {
13999
13998
  ignoreCSSAttributes = /* @__PURE__ */ new Set([]),
14000
13999
  errorHandler: errorHandler2
14001
14000
  } = options;
14001
+ const win = options.customWindow || window;
14002
+ const doc = options.customDocument || document;
14003
+ try {
14004
+ if (Array.from([1], (x2) => x2 * 2)[0] !== 2) {
14005
+ const cleanFrame = doc.createElement("iframe");
14006
+ doc.body.appendChild(cleanFrame);
14007
+ Array.from = ((_a2 = cleanFrame.contentWindow) == null ? void 0 : _a2.Array.from) || Array.from;
14008
+ doc.body.removeChild(cleanFrame);
14009
+ }
14010
+ } catch (err) {
14011
+ console.debug("Unable to override Array.from", err);
14012
+ }
14002
14013
  registerErrorHandler(errorHandler2);
14003
- const inEmittingFrame = recordCrossOriginIframes ? window.parent === window : true;
14014
+ const inEmittingFrame = recordCrossOriginIframes ? win.parent === win : true;
14004
14015
  let passEmitsToParent = false;
14005
14016
  if (!inEmittingFrame) {
14006
14017
  try {
14007
- if (window.parent.document) {
14018
+ if (win.parent.document) {
14008
14019
  passEmitsToParent = false;
14009
14020
  }
14010
14021
  } catch (e2) {
@@ -14071,10 +14082,10 @@ function record(options = {}) {
14071
14082
  return e2;
14072
14083
  };
14073
14084
  wrappedEmit = (r2, isCheckout) => {
14074
- var _a2;
14085
+ var _a3;
14075
14086
  const e2 = r2;
14076
14087
  e2.timestamp = nowTimestamp();
14077
- if (((_a2 = mutationBuffers[0]) == null ? void 0 : _a2.isFrozen()) && e2.type !== EventType.FullSnapshot && !(e2.type === EventType.IncrementalSnapshot && e2.data.source === IncrementalSource.Mutation)) {
14088
+ if (((_a3 = mutationBuffers[0]) == null ? void 0 : _a3.isFrozen()) && e2.type !== EventType.FullSnapshot && !(e2.type === EventType.IncrementalSnapshot && e2.data.source === IncrementalSource.Mutation)) {
14078
14089
  mutationBuffers.forEach((buf) => buf.unfreeze());
14079
14090
  }
14080
14091
  if (inEmittingFrame) {
@@ -14083,10 +14094,10 @@ function record(options = {}) {
14083
14094
  const message = {
14084
14095
  type: "rrweb",
14085
14096
  event: eventProcessor(e2),
14086
- origin: window.location.origin,
14097
+ origin: win.location.origin,
14087
14098
  isCheckout
14088
14099
  };
14089
- window.parent.postMessage(message, "*");
14100
+ win.parent.postMessage(message, "*");
14090
14101
  }
14091
14102
  if (e2.type === EventType.FullSnapshot) {
14092
14103
  lastFullSnapshotEvent = e2;
@@ -14197,7 +14208,7 @@ function record(options = {}) {
14197
14208
  {
14198
14209
  type: EventType.Meta,
14199
14210
  data: {
14200
- href: window.location.href,
14211
+ href: win.location.href,
14201
14212
  width: getWindowWidth(),
14202
14213
  height: getWindowHeight()
14203
14214
  }
@@ -14255,16 +14266,16 @@ function record(options = {}) {
14255
14266
  isCheckout
14256
14267
  );
14257
14268
  mutationBuffers.forEach((buf) => buf.unlock());
14258
- if (document.adoptedStyleSheets && document.adoptedStyleSheets.length > 0)
14269
+ if (doc.adoptedStyleSheets && doc.adoptedStyleSheets.length > 0)
14259
14270
  stylesheetManager.adoptStyleSheets(
14260
- document.adoptedStyleSheets,
14261
- mirror.getId(document)
14271
+ doc.adoptedStyleSheets,
14272
+ mirror.getId(doc)
14262
14273
  );
14263
14274
  };
14264
14275
  try {
14265
14276
  const handlers = [];
14266
- const observe = (doc) => {
14267
- var _a2;
14277
+ const observe = (doc2) => {
14278
+ var _a3;
14268
14279
  return callbackWrapper(initObservers)(
14269
14280
  {
14270
14281
  mutationCb: wrappedMutationEmit,
@@ -14366,7 +14377,7 @@ function record(options = {}) {
14366
14377
  inlineImages,
14367
14378
  userTriggeredOnInput,
14368
14379
  collectFonts,
14369
- doc,
14380
+ doc: doc2,
14370
14381
  maskInputFn,
14371
14382
  maskTextFn,
14372
14383
  keepIframeSrcFn,
@@ -14380,7 +14391,7 @@ function record(options = {}) {
14380
14391
  processedNodeManager,
14381
14392
  canvasManager,
14382
14393
  ignoreCSSAttributes,
14383
- plugins: ((_a2 = plugins == null ? void 0 : plugins.filter((p) => p.observer)) == null ? void 0 : _a2.map((p) => ({
14394
+ plugins: ((_a3 = plugins == null ? void 0 : plugins.filter((p) => p.observer)) == null ? void 0 : _a3.map((p) => ({
14384
14395
  observer: p.observer,
14385
14396
  options: p.options,
14386
14397
  callback: (payload) => wrappedEmit({
@@ -14407,7 +14418,7 @@ function record(options = {}) {
14407
14418
  handlers.push(observe(document));
14408
14419
  recording = true;
14409
14420
  };
14410
- if (document.readyState === "interactive" || document.readyState === "complete") {
14421
+ if (doc.readyState === "interactive" || doc.readyState === "complete") {
14411
14422
  init();
14412
14423
  } else {
14413
14424
  handlers.push(