@openreplay/tracker 16.4.6 → 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.6'; // 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)
@@ -7680,9 +7687,15 @@ function Timing (app, opts) {
7680
7687
  const entryName = options.resourceNameSanitizer
7681
7688
  ? options.resourceNameSanitizer(entry.name)
7682
7689
  : entry.name;
7683
- 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, '*') : entryName, entry.initiatorType, entry.transferSize,
7690
+ const cached =
7684
7691
  // @ts-ignore
7685
- (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));
7686
7699
  }
7687
7700
  const observer = new PerformanceObserver((list) => list.getEntries().forEach(resourceTiming));
7688
7701
  function onVitalsSignal(msg) {
@@ -9606,7 +9619,7 @@ function Tabs (app) {
9606
9619
  }
9607
9620
 
9608
9621
  const Messages = _Messages;
9609
- const DOCS_SETUP = '/en/sdk';
9622
+ const DOCS_SETUP = '/en/sdk/constructor';
9610
9623
  function processOptions(obj) {
9611
9624
  if (obj == null) {
9612
9625
  console.error(`OpenReplay: invalid options argument type. Please, check documentation on ${DOCS_HOST}${DOCS_SETUP}`);
@@ -9656,7 +9669,7 @@ class API {
9656
9669
  this.signalStartIssue = (reason, missingApi) => {
9657
9670
  const doNotTrack = this.checkDoNotTrack();
9658
9671
  console.log("Tracker couldn't start due to:", JSON.stringify({
9659
- trackerVersion: '16.4.6',
9672
+ trackerVersion: '16.4.7-beta.1',
9660
9673
  projectKey: this.options.projectKey,
9661
9674
  doNotTrack,
9662
9675
  reason: missingApi.length ? `missing api: ${missingApi.join(',')}` : reason,