@openreplay/tracker 16.4.5 → 16.4.7-beta.1

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/cjs/entry.js CHANGED
@@ -5276,7 +5276,7 @@ class App {
5276
5276
  this.stopCallbacks = [];
5277
5277
  this.commitCallbacks = [];
5278
5278
  this.activityState = ActivityState.NotActive;
5279
- this.version = '16.4.5'; // TODO: version compatability check inside each plugin.
5279
+ this.version = '16.4.7-beta.1'; // TODO: version compatability check inside each plugin.
5280
5280
  this.socketMode = false;
5281
5281
  this.compressionThreshold = 24 * 1000;
5282
5282
  this.bc = null;
@@ -5380,6 +5380,13 @@ class App {
5380
5380
  }
5381
5381
  };
5382
5382
  void signalId();
5383
+ if (this.active()) {
5384
+ // @ts-ignore
5385
+ event.source?.postMessage({ line: proto.startIframe }, '*');
5386
+ }
5387
+ else {
5388
+ this.addCommand(proto.startIframe);
5389
+ }
5383
5390
  }
5384
5391
  /**
5385
5392
  * proxying messages from iframe to main body, so they can be in one batch (same indexes, etc)
@@ -7677,9 +7684,18 @@ function Timing (app, opts) {
7677
7684
  if (shouldSkip) {
7678
7685
  return;
7679
7686
  }
7680
- app.send(ResourceTiming(entry.startTime + getTimeOrigin(), entry.duration, entry.responseStart && entry.startTime ? entry.responseStart - entry.startTime : 0, entry.transferSize > entry.encodedBodySize ? entry.transferSize - entry.encodedBodySize : 0, entry.encodedBodySize || 0, entry.decodedBodySize || 0, app.sanitizer.privateMode ? entry.name.replaceAll(/./g, '*') : entry.name, entry.initiatorType, entry.transferSize,
7687
+ const entryName = options.resourceNameSanitizer
7688
+ ? options.resourceNameSanitizer(entry.name)
7689
+ : entry.name;
7690
+ const cached =
7681
7691
  // @ts-ignore
7682
- (entry.responseStatus && entry.responseStatus === 304) || entry.transferSize === 0));
7692
+ (entry.responseStatus && entry.responseStatus === 304) ||
7693
+ // @ts-ignore
7694
+ (entry.deliveryType && entry.deliveryType === 'cache') ||
7695
+ (entry.transferSize === 0 && entry.decodedBodySize > 0);
7696
+ const requestFailed = entry.responseStatus && entry.responseStatus >= 400;
7697
+ const decodedBodySize = requestFailed ? -111 : entry.decodedBodySize || 0;
7698
+ app.send(ResourceTiming(entry.startTime + getTimeOrigin(), entry.duration, entry.responseStart && entry.startTime ? entry.responseStart - entry.startTime : 0, entry.transferSize > entry.encodedBodySize ? entry.transferSize - entry.encodedBodySize : 0, entry.encodedBodySize || 0, decodedBodySize, app.sanitizer.privateMode ? entry.name.replaceAll(/./g, '*') : entryName, entry.initiatorType, entry.transferSize, cached));
7683
7699
  }
7684
7700
  const observer = new PerformanceObserver((list) => list.getEntries().forEach(resourceTiming));
7685
7701
  function onVitalsSignal(msg) {
@@ -9603,7 +9619,7 @@ function Tabs (app) {
9603
9619
  }
9604
9620
 
9605
9621
  const Messages = _Messages;
9606
- const DOCS_SETUP = '/en/sdk';
9622
+ const DOCS_SETUP = '/en/sdk/constructor';
9607
9623
  function processOptions(obj) {
9608
9624
  if (obj == null) {
9609
9625
  console.error(`OpenReplay: invalid options argument type. Please, check documentation on ${DOCS_HOST}${DOCS_SETUP}`);
@@ -9653,7 +9669,7 @@ class API {
9653
9669
  this.signalStartIssue = (reason, missingApi) => {
9654
9670
  const doNotTrack = this.checkDoNotTrack();
9655
9671
  console.log("Tracker couldn't start due to:", JSON.stringify({
9656
- trackerVersion: '16.4.5',
9672
+ trackerVersion: '16.4.7-beta.1',
9657
9673
  projectKey: this.options.projectKey,
9658
9674
  doNotTrack,
9659
9675
  reason: missingApi.length ? `missing api: ${missingApi.join(',')}` : reason,