@openreplay/tracker 12.0.9-beta.2 → 12.0.9-beta.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.
- package/cjs/app/index.js +7 -1
- package/cjs/app/observer/top_observer.js +1 -0
- package/cjs/index.js +1 -1
- package/lib/app/index.js +7 -1
- package/lib/app/observer/top_observer.js +1 -0
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/cjs/app/index.js
CHANGED
|
@@ -80,7 +80,7 @@ class App {
|
|
|
80
80
|
this.stopCallbacks = [];
|
|
81
81
|
this.commitCallbacks = [];
|
|
82
82
|
this.activityState = ActivityState.NotActive;
|
|
83
|
-
this.version = '12.0.9-beta.
|
|
83
|
+
this.version = '12.0.9-beta.4'; // TODO: version compatability check inside each plugin.
|
|
84
84
|
this.compressionThreshold = 24 * 1000;
|
|
85
85
|
this.restartAttempts = 0;
|
|
86
86
|
this.bc = null;
|
|
@@ -956,6 +956,12 @@ class App {
|
|
|
956
956
|
* and here we just apply 10ms delay just in case
|
|
957
957
|
* */
|
|
958
958
|
start(...args) {
|
|
959
|
+
if (this.activityState === ActivityState.Active ||
|
|
960
|
+
this.activityState === ActivityState.Starting) {
|
|
961
|
+
const reason = 'OpenReplay: trying to call `start()` on the instance that has been started already.';
|
|
962
|
+
return Promise.resolve(UnsuccessfulStart(reason));
|
|
963
|
+
}
|
|
964
|
+
this.activityState = ActivityState.Starting;
|
|
959
965
|
if (!document.hidden) {
|
|
960
966
|
return new Promise((resolve) => {
|
|
961
967
|
setTimeout(() => {
|
|
@@ -94,6 +94,7 @@ class TopObserver extends observer_js_1.default {
|
|
|
94
94
|
observer.handleShadowRoot(shadow);
|
|
95
95
|
return shadow;
|
|
96
96
|
};
|
|
97
|
+
this.app.nodes.clear();
|
|
97
98
|
// Can observe documentElement (<html>) here, because it is not supposed to be changing.
|
|
98
99
|
// However, it is possible in some exotic cases and may cause an ignorance of the newly created <html>
|
|
99
100
|
// In this case context.document have to be observed, but this will cause
|
package/cjs/index.js
CHANGED
|
@@ -97,7 +97,7 @@ class API {
|
|
|
97
97
|
const orig = this.options.ingestPoint || index_js_1.DEFAULT_INGEST_POINT;
|
|
98
98
|
req.open('POST', orig + '/v1/web/not-started');
|
|
99
99
|
req.send(JSON.stringify({
|
|
100
|
-
trackerVersion: '12.0.9-beta.
|
|
100
|
+
trackerVersion: '12.0.9-beta.4',
|
|
101
101
|
projectKey: this.options.projectKey,
|
|
102
102
|
doNotTrack,
|
|
103
103
|
reason: missingApi.length ? `missing api: ${missingApi.join(',')}` : reason,
|
package/lib/app/index.js
CHANGED
|
@@ -51,7 +51,7 @@ export default class App {
|
|
|
51
51
|
this.stopCallbacks = [];
|
|
52
52
|
this.commitCallbacks = [];
|
|
53
53
|
this.activityState = ActivityState.NotActive;
|
|
54
|
-
this.version = '12.0.9-beta.
|
|
54
|
+
this.version = '12.0.9-beta.4'; // TODO: version compatability check inside each plugin.
|
|
55
55
|
this.compressionThreshold = 24 * 1000;
|
|
56
56
|
this.restartAttempts = 0;
|
|
57
57
|
this.bc = null;
|
|
@@ -927,6 +927,12 @@ export default class App {
|
|
|
927
927
|
* and here we just apply 10ms delay just in case
|
|
928
928
|
* */
|
|
929
929
|
start(...args) {
|
|
930
|
+
if (this.activityState === ActivityState.Active ||
|
|
931
|
+
this.activityState === ActivityState.Starting) {
|
|
932
|
+
const reason = 'OpenReplay: trying to call `start()` on the instance that has been started already.';
|
|
933
|
+
return Promise.resolve(UnsuccessfulStart(reason));
|
|
934
|
+
}
|
|
935
|
+
this.activityState = ActivityState.Starting;
|
|
930
936
|
if (!document.hidden) {
|
|
931
937
|
return new Promise((resolve) => {
|
|
932
938
|
setTimeout(() => {
|
|
@@ -89,6 +89,7 @@ export default class TopObserver extends Observer {
|
|
|
89
89
|
observer.handleShadowRoot(shadow);
|
|
90
90
|
return shadow;
|
|
91
91
|
};
|
|
92
|
+
this.app.nodes.clear();
|
|
92
93
|
// Can observe documentElement (<html>) here, because it is not supposed to be changing.
|
|
93
94
|
// However, it is possible in some exotic cases and may cause an ignorance of the newly created <html>
|
|
94
95
|
// In this case context.document have to be observed, but this will cause
|
package/lib/index.js
CHANGED
|
@@ -66,7 +66,7 @@ export default class API {
|
|
|
66
66
|
const orig = this.options.ingestPoint || DEFAULT_INGEST_POINT;
|
|
67
67
|
req.open('POST', orig + '/v1/web/not-started');
|
|
68
68
|
req.send(JSON.stringify({
|
|
69
|
-
trackerVersion: '12.0.9-beta.
|
|
69
|
+
trackerVersion: '12.0.9-beta.4',
|
|
70
70
|
projectKey: this.options.projectKey,
|
|
71
71
|
doNotTrack,
|
|
72
72
|
reason: missingApi.length ? `missing api: ${missingApi.join(',')}` : reason,
|