@openreplay/tracker 16.4.7 → 16.4.9
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 +41 -22
- package/dist/cjs/entry.js.map +1 -1
- package/dist/cjs/index.js +41 -22
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/main/app/session.d.ts +2 -2
- package/dist/lib/entry.js +41 -22
- package/dist/lib/entry.js.map +1 -1
- package/dist/lib/index.js +41 -22
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/main/app/session.d.ts +2 -2
- package/dist/types/main/app/session.d.ts +2 -2
- package/package.json +1 -1
package/dist/lib/index.js
CHANGED
|
@@ -5047,6 +5047,23 @@ class Session {
|
|
|
5047
5047
|
this.app.sessionStorage.setItem(this.options.session_pageno_key, pageNo.toString());
|
|
5048
5048
|
return pageNo;
|
|
5049
5049
|
};
|
|
5050
|
+
this.getSessionToken = (projectKey) => {
|
|
5051
|
+
const tokenWithProject = this.token || this.app.sessionStorage.getItem(this.options.session_token_key);
|
|
5052
|
+
if (projectKey && tokenWithProject) {
|
|
5053
|
+
const savedProject = tokenWithProject.split('_&_')[1];
|
|
5054
|
+
if (!savedProject || savedProject !== projectKey) {
|
|
5055
|
+
this.app.sessionStorage.removeItem(this.options.session_token_key);
|
|
5056
|
+
this.token = undefined;
|
|
5057
|
+
return undefined;
|
|
5058
|
+
}
|
|
5059
|
+
}
|
|
5060
|
+
const token = tokenWithProject ? tokenWithProject.split('_&_')[0] : null;
|
|
5061
|
+
return token || undefined;
|
|
5062
|
+
};
|
|
5063
|
+
this.setSessionToken = (token, projectKey) => {
|
|
5064
|
+
this.token = `${token}_&_${projectKey}`;
|
|
5065
|
+
this.app.sessionStorage.setItem(this.options.session_token_key, `${token}_&_${projectKey}`);
|
|
5066
|
+
};
|
|
5050
5067
|
this.app = params.app;
|
|
5051
5068
|
this.options = params.options;
|
|
5052
5069
|
this.createTabId();
|
|
@@ -5093,23 +5110,6 @@ class Session {
|
|
|
5093
5110
|
setUserInfo(userInfo) {
|
|
5094
5111
|
this.userInfo = userInfo;
|
|
5095
5112
|
}
|
|
5096
|
-
getSessionToken(projectKey) {
|
|
5097
|
-
const tokenWithProject = this.token || this.app.sessionStorage.getItem(this.options.session_token_key);
|
|
5098
|
-
if (projectKey && tokenWithProject) {
|
|
5099
|
-
const savedProject = tokenWithProject.split('_&_')[1];
|
|
5100
|
-
if (!savedProject || savedProject !== projectKey) {
|
|
5101
|
-
this.app.sessionStorage.removeItem(this.options.session_token_key);
|
|
5102
|
-
this.token = undefined;
|
|
5103
|
-
return undefined;
|
|
5104
|
-
}
|
|
5105
|
-
}
|
|
5106
|
-
const token = tokenWithProject ? tokenWithProject.split('_&_')[0] : null;
|
|
5107
|
-
return token || undefined;
|
|
5108
|
-
}
|
|
5109
|
-
setSessionToken(token, projectKey) {
|
|
5110
|
-
this.token = token;
|
|
5111
|
-
this.app.sessionStorage.setItem(this.options.session_token_key, `${token}_&_${projectKey}`);
|
|
5112
|
-
}
|
|
5113
5113
|
applySessionHash(hash) {
|
|
5114
5114
|
const hashParts = decodeURI(hash).split('&');
|
|
5115
5115
|
let token = hash;
|
|
@@ -5272,7 +5272,7 @@ class App {
|
|
|
5272
5272
|
this.stopCallbacks = [];
|
|
5273
5273
|
this.commitCallbacks = [];
|
|
5274
5274
|
this.activityState = ActivityState.NotActive;
|
|
5275
|
-
this.version = '16.4.
|
|
5275
|
+
this.version = '16.4.9'; // TODO: version compatability check inside each plugin.
|
|
5276
5276
|
this.socketMode = false;
|
|
5277
5277
|
this.compressionThreshold = 24 * 1000;
|
|
5278
5278
|
this.bc = null;
|
|
@@ -5376,6 +5376,13 @@ class App {
|
|
|
5376
5376
|
}
|
|
5377
5377
|
};
|
|
5378
5378
|
void signalId();
|
|
5379
|
+
if (this.active()) {
|
|
5380
|
+
// @ts-ignore
|
|
5381
|
+
event.source?.postMessage({ line: proto.startIframe }, '*');
|
|
5382
|
+
}
|
|
5383
|
+
else {
|
|
5384
|
+
this.addCommand(proto.startIframe);
|
|
5385
|
+
}
|
|
5379
5386
|
}
|
|
5380
5387
|
/**
|
|
5381
5388
|
* proxying messages from iframe to main body, so they can be in one batch (same indexes, etc)
|
|
@@ -5875,6 +5882,7 @@ class App {
|
|
|
5875
5882
|
}, 250);
|
|
5876
5883
|
this.bc.onmessage = (ev) => {
|
|
5877
5884
|
if (ev.data.context === this.contextId || this.projectKey !== ev.data.projectKey) {
|
|
5885
|
+
this.debug.log('same ctx event', ev);
|
|
5878
5886
|
return;
|
|
5879
5887
|
}
|
|
5880
5888
|
this.debug.log(ev);
|
|
@@ -6428,7 +6436,12 @@ class App {
|
|
|
6428
6436
|
startOpts.startCallback(SuccessfulStart(onStartInfo));
|
|
6429
6437
|
}
|
|
6430
6438
|
if (this.features['feature-flags']) {
|
|
6431
|
-
|
|
6439
|
+
try {
|
|
6440
|
+
void this.featureFlags.reloadFlags();
|
|
6441
|
+
}
|
|
6442
|
+
catch (e) {
|
|
6443
|
+
this.debug.log("Error getting feature flags", e);
|
|
6444
|
+
}
|
|
6432
6445
|
}
|
|
6433
6446
|
await this.tagWatcher.fetchTags(this.options.ingestPoint, token);
|
|
6434
6447
|
this.activityState = ActivityState.Active;
|
|
@@ -7676,9 +7689,15 @@ function Timing (app, opts) {
|
|
|
7676
7689
|
const entryName = options.resourceNameSanitizer
|
|
7677
7690
|
? options.resourceNameSanitizer(entry.name)
|
|
7678
7691
|
: entry.name;
|
|
7679
|
-
|
|
7692
|
+
const cached =
|
|
7680
7693
|
// @ts-ignore
|
|
7681
|
-
(entry.responseStatus && entry.responseStatus === 304) ||
|
|
7694
|
+
(entry.responseStatus && entry.responseStatus === 304) ||
|
|
7695
|
+
// @ts-ignore
|
|
7696
|
+
(entry.deliveryType && entry.deliveryType === 'cache') ||
|
|
7697
|
+
(entry.transferSize === 0 && entry.decodedBodySize > 0);
|
|
7698
|
+
const requestFailed = entry.responseStatus && entry.responseStatus >= 400;
|
|
7699
|
+
const decodedBodySize = requestFailed ? -111 : entry.decodedBodySize || 0;
|
|
7700
|
+
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));
|
|
7682
7701
|
}
|
|
7683
7702
|
const observer = new PerformanceObserver((list) => list.getEntries().forEach(resourceTiming));
|
|
7684
7703
|
function onVitalsSignal(msg) {
|
|
@@ -9652,7 +9671,7 @@ class API {
|
|
|
9652
9671
|
this.signalStartIssue = (reason, missingApi) => {
|
|
9653
9672
|
const doNotTrack = this.checkDoNotTrack();
|
|
9654
9673
|
console.log("Tracker couldn't start due to:", JSON.stringify({
|
|
9655
|
-
trackerVersion: '16.4.
|
|
9674
|
+
trackerVersion: '16.4.9',
|
|
9656
9675
|
projectKey: this.options.projectKey,
|
|
9657
9676
|
doNotTrack,
|
|
9658
9677
|
reason: missingApi.length ? `missing api: ${missingApi.join(',')}` : reason,
|