@openreplay/tracker 3.5.17-beta.0 → 3.6.0-beta.0
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/.eslintignore +1 -1
- package/.prettierignore +1 -0
- package/cjs/app/guards.d.ts +2 -1
- package/cjs/app/guards.js +5 -1
- package/cjs/app/index.d.ts +12 -10
- package/cjs/app/index.js +38 -44
- package/cjs/app/messages.d.ts +52 -0
- package/cjs/app/messages.gen.d.ts +57 -0
- package/cjs/app/messages.gen.js +494 -0
- package/cjs/app/messages.js +235 -0
- package/cjs/app/nodes.js +2 -0
- package/cjs/app/observer/iframe_observer.js +2 -2
- package/cjs/app/observer/observer.d.ts +1 -2
- package/cjs/app/observer/observer.js +40 -39
- package/cjs/app/observer/shadow_root_observer.js +2 -2
- package/cjs/app/observer/top_observer.d.ts +9 -0
- package/cjs/app/observer/top_observer.js +40 -12
- package/cjs/app/session.d.ts +17 -1
- package/cjs/app/session.js +51 -3
- package/cjs/common/{webworker.d.ts → interaction.d.ts} +3 -3
- package/cjs/common/{types.js → interaction.js} +0 -0
- package/cjs/common/messages.gen.d.ts +382 -0
- package/cjs/common/messages.gen.js +62 -0
- package/cjs/index.d.ts +3 -3
- package/cjs/index.js +15 -10
- package/cjs/modules/adoptedStyleSheets.d.ts +2 -0
- package/cjs/modules/adoptedStyleSheets.js +127 -0
- package/cjs/modules/connection.js +2 -2
- package/cjs/modules/console.js +6 -20
- package/cjs/modules/cssrules.js +16 -12
- package/cjs/modules/exception.d.ts +2 -2
- package/cjs/modules/exception.js +18 -14
- package/cjs/modules/img.js +31 -21
- package/cjs/modules/input.js +6 -6
- package/cjs/modules/mouse.js +42 -33
- package/cjs/modules/performance.js +2 -2
- package/cjs/modules/scroll.js +16 -7
- package/cjs/modules/timing.js +4 -4
- package/cjs/modules/viewport.js +4 -4
- package/lib/app/guards.d.ts +2 -1
- package/lib/app/guards.js +3 -0
- package/lib/app/index.d.ts +12 -10
- package/lib/app/index.js +39 -45
- package/lib/app/messages.d.ts +52 -0
- package/lib/app/messages.gen.d.ts +57 -0
- package/lib/app/messages.gen.js +435 -0
- package/lib/app/messages.js +182 -0
- package/lib/app/nodes.js +2 -0
- package/lib/app/observer/iframe_observer.js +1 -1
- package/lib/app/observer/observer.d.ts +1 -2
- package/lib/app/observer/observer.js +40 -39
- package/lib/app/observer/shadow_root_observer.js +1 -1
- package/lib/app/observer/top_observer.d.ts +9 -0
- package/lib/app/observer/top_observer.js +40 -12
- package/lib/app/session.d.ts +17 -1
- package/lib/app/session.js +51 -3
- package/lib/common/{webworker.d.ts → interaction.d.ts} +3 -3
- package/lib/common/{types.js → interaction.js} +0 -0
- package/lib/common/messages.gen.d.ts +382 -0
- package/lib/common/messages.gen.js +59 -0
- package/lib/common/tsconfig.tsbuildinfo +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.js +15 -10
- package/lib/modules/adoptedStyleSheets.d.ts +2 -0
- package/lib/modules/adoptedStyleSheets.js +124 -0
- package/lib/modules/connection.js +2 -2
- package/lib/modules/console.js +6 -20
- package/lib/modules/cssrules.js +16 -12
- package/lib/modules/exception.d.ts +2 -2
- package/lib/modules/exception.js +18 -14
- package/lib/modules/img.js +31 -21
- package/lib/modules/input.js +6 -6
- package/lib/modules/mouse.js +43 -34
- package/lib/modules/performance.js +2 -2
- package/lib/modules/scroll.js +17 -8
- package/lib/modules/timing.js +4 -4
- package/lib/modules/viewport.js +4 -4
- package/package.json +1 -1
- package/cjs/common/messages.d.ts +0 -444
- package/cjs/common/messages.js +0 -794
- package/cjs/common/types.d.ts +0 -9
- package/cjs/common/webworker.js +0 -2
- package/cjs/modules/longtasks.d.ts +0 -2
- package/cjs/modules/longtasks.js +0 -34
- package/lib/common/messages.d.ts +0 -444
- package/lib/common/messages.js +0 -790
- package/lib/common/types.d.ts +0 -9
- package/lib/common/webworker.js +0 -1
- package/lib/modules/longtasks.d.ts +0 -2
- package/lib/modules/longtasks.js +0 -31
package/cjs/modules/scroll.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
3
|
+
const messages_gen_js_1 = require("../app/messages.gen.js");
|
|
4
4
|
const guards_js_1 = require("../app/guards.js");
|
|
5
5
|
function default_1(app) {
|
|
6
6
|
let documentScroll = false;
|
|
7
7
|
const nodeScroll = new Map();
|
|
8
|
-
|
|
8
|
+
function setNodeScroll(target) {
|
|
9
|
+
if (target instanceof Element) {
|
|
10
|
+
nodeScroll.set(target, [target.scrollLeft, target.scrollTop]);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
const sendSetViewportScroll = app.safe(() => app.send((0, messages_gen_js_1.SetViewportScroll)(window.pageXOffset ||
|
|
9
14
|
(document.documentElement && document.documentElement.scrollLeft) ||
|
|
10
15
|
(document.body && document.body.scrollLeft) ||
|
|
11
16
|
0, window.pageYOffset ||
|
|
@@ -15,7 +20,7 @@ function default_1(app) {
|
|
|
15
20
|
const sendSetNodeScroll = app.safe((s, node) => {
|
|
16
21
|
const id = app.nodes.getID(node);
|
|
17
22
|
if (id !== undefined) {
|
|
18
|
-
app.send(
|
|
23
|
+
app.send((0, messages_gen_js_1.SetNodeScroll)(id, s[0], s[1]));
|
|
19
24
|
}
|
|
20
25
|
});
|
|
21
26
|
app.attachStartCallback(sendSetViewportScroll);
|
|
@@ -27,16 +32,20 @@ function default_1(app) {
|
|
|
27
32
|
if (isStart && (0, guards_js_1.isElementNode)(node) && node.scrollLeft + node.scrollTop > 0) {
|
|
28
33
|
nodeScroll.set(node, [node.scrollLeft, node.scrollTop]);
|
|
29
34
|
}
|
|
35
|
+
else if ((0, guards_js_1.isRootNode)(node)) {
|
|
36
|
+
// scroll is not-composed event (https://javascript.info/shadow-dom-events)
|
|
37
|
+
app.attachEventListener(node, 'scroll', (e) => {
|
|
38
|
+
setNodeScroll(e.target);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
30
41
|
});
|
|
31
|
-
app.attachEventListener(
|
|
42
|
+
app.attachEventListener(document, 'scroll', (e) => {
|
|
32
43
|
const target = e.target;
|
|
33
44
|
if (target === document) {
|
|
34
45
|
documentScroll = true;
|
|
35
46
|
return;
|
|
36
47
|
}
|
|
37
|
-
|
|
38
|
-
nodeScroll.set(target, [target.scrollLeft, target.scrollTop]);
|
|
39
|
-
}
|
|
48
|
+
setNodeScroll(target);
|
|
40
49
|
});
|
|
41
50
|
app.ticker.attach(() => {
|
|
42
51
|
if (documentScroll) {
|
package/cjs/modules/timing.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const guards_js_1 = require("../app/guards.js");
|
|
4
4
|
const utils_js_1 = require("../utils.js");
|
|
5
|
-
const
|
|
5
|
+
const messages_gen_js_1 = require("../app/messages.gen.js");
|
|
6
6
|
function getPaintBlocks(resources) {
|
|
7
7
|
const paintBlocks = [];
|
|
8
8
|
const elements = document.getElementsByTagName('*');
|
|
@@ -75,7 +75,7 @@ function default_1(app, opts) {
|
|
|
75
75
|
if (resources !== null) {
|
|
76
76
|
resources[entry.name] = entry.startTime + entry.duration;
|
|
77
77
|
}
|
|
78
|
-
app.send(
|
|
78
|
+
app.send((0, messages_gen_js_1.ResourceTiming)(entry.startTime + performance.timing.navigationStart, 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, entry.name, entry.initiatorType));
|
|
79
79
|
}
|
|
80
80
|
const observer = new PerformanceObserver((list) => list.getEntries().forEach(resourceTiming));
|
|
81
81
|
let prevSessionID;
|
|
@@ -113,7 +113,7 @@ function default_1(app, opts) {
|
|
|
113
113
|
if (performance.timing.loadEventEnd || performance.now() > 30000) {
|
|
114
114
|
pageLoadTimingSent = true;
|
|
115
115
|
const { navigationStart, requestStart, responseStart, responseEnd, domContentLoadedEventStart, domContentLoadedEventEnd, loadEventStart, loadEventEnd, } = performance.timing;
|
|
116
|
-
app.send(
|
|
116
|
+
app.send((0, messages_gen_js_1.PageLoadTiming)(requestStart - navigationStart || 0, responseStart - navigationStart || 0, responseEnd - navigationStart || 0, domContentLoadedEventStart - navigationStart || 0, domContentLoadedEventEnd - navigationStart || 0, loadEventStart - navigationStart || 0, loadEventEnd - navigationStart || 0, firstPaint, firstContentfulPaint));
|
|
117
117
|
}
|
|
118
118
|
}, 30);
|
|
119
119
|
}
|
|
@@ -148,7 +148,7 @@ function default_1(app, opts) {
|
|
|
148
148
|
? Math.max(interactiveWindowStartTime, firstContentfulPaint, performance.timing.domContentLoadedEventEnd - performance.timing.navigationStart ||
|
|
149
149
|
0)
|
|
150
150
|
: 0;
|
|
151
|
-
app.send(
|
|
151
|
+
app.send((0, messages_gen_js_1.PageRenderTiming)(speedIndex, firstContentfulPaint > visuallyComplete ? firstContentfulPaint : visuallyComplete, timeToInteractive));
|
|
152
152
|
}
|
|
153
153
|
});
|
|
154
154
|
}
|
package/cjs/modules/viewport.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
3
|
+
const messages_gen_js_1 = require("../app/messages.gen.js");
|
|
4
4
|
function default_1(app) {
|
|
5
5
|
let url, width, height;
|
|
6
6
|
let navigationStart = performance.timing.navigationStart;
|
|
@@ -8,7 +8,7 @@ function default_1(app) {
|
|
|
8
8
|
const { URL } = document;
|
|
9
9
|
if (URL !== url) {
|
|
10
10
|
url = URL;
|
|
11
|
-
app.send(
|
|
11
|
+
app.send((0, messages_gen_js_1.SetPageLocation)(url, document.referrer, navigationStart));
|
|
12
12
|
navigationStart = 0;
|
|
13
13
|
}
|
|
14
14
|
});
|
|
@@ -17,12 +17,12 @@ function default_1(app) {
|
|
|
17
17
|
if (innerWidth !== width || innerHeight !== height) {
|
|
18
18
|
width = innerWidth;
|
|
19
19
|
height = innerHeight;
|
|
20
|
-
app.send(
|
|
20
|
+
app.send((0, messages_gen_js_1.SetViewportSize)(width, height));
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
const sendSetPageVisibility = document.hidden === undefined
|
|
24
24
|
? Function.prototype
|
|
25
|
-
: app.safe(() => app.send(
|
|
25
|
+
: app.safe(() => app.send((0, messages_gen_js_1.SetPageVisibility)(document.hidden)));
|
|
26
26
|
app.attachStartCallback(() => {
|
|
27
27
|
url = '';
|
|
28
28
|
width = height = -1;
|
package/lib/app/guards.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export declare function isSVGElement(node: Element): node is SVGElement;
|
|
2
2
|
export declare function isElementNode(node: Node): node is Element;
|
|
3
3
|
export declare function isTextNode(node: Node): node is Text;
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function isDocument(node: Node): node is Document;
|
|
5
|
+
export declare function isRootNode(node: Node): node is Document | DocumentFragment;
|
|
5
6
|
declare type TagTypeMap = {
|
|
6
7
|
HTML: HTMLHtmlElement;
|
|
7
8
|
IMG: HTMLImageElement;
|
package/lib/app/guards.js
CHANGED
|
@@ -7,6 +7,9 @@ export function isElementNode(node) {
|
|
|
7
7
|
export function isTextNode(node) {
|
|
8
8
|
return node.nodeType === Node.TEXT_NODE;
|
|
9
9
|
}
|
|
10
|
+
export function isDocument(node) {
|
|
11
|
+
return node.nodeType === Node.DOCUMENT_NODE;
|
|
12
|
+
}
|
|
10
13
|
export function isRootNode(node) {
|
|
11
14
|
return node.nodeType === Node.DOCUMENT_NODE || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
|
|
12
15
|
}
|
package/lib/app/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type Message from '
|
|
1
|
+
import type Message from './messages.gen.js';
|
|
2
2
|
import Nodes from './nodes.js';
|
|
3
|
+
import Observer from './observer/top_observer.js';
|
|
3
4
|
import Sanitizer from './sanitizer.js';
|
|
4
5
|
import Ticker from './ticker.js';
|
|
5
6
|
import Logger from './logger.js';
|
|
@@ -7,7 +8,8 @@ import Session from './session.js';
|
|
|
7
8
|
import type { Options as ObserverOptions } from './observer/top_observer.js';
|
|
8
9
|
import type { Options as SanitizerOptions } from './sanitizer.js';
|
|
9
10
|
import type { Options as LoggerOptions } from './logger.js';
|
|
10
|
-
import type { Options as
|
|
11
|
+
import type { Options as SessOptions } from './session.js';
|
|
12
|
+
import type { Options as WebworkerOptions } from '../common/interaction.js';
|
|
11
13
|
export interface StartOptions {
|
|
12
14
|
userID?: string;
|
|
13
15
|
metadata?: Record<string, string>;
|
|
@@ -34,9 +36,9 @@ declare type CommitCallback = (messages: Array<Message>) => void;
|
|
|
34
36
|
declare type AppOptions = {
|
|
35
37
|
revID: string;
|
|
36
38
|
node_id: string;
|
|
39
|
+
session_reset_key: string;
|
|
37
40
|
session_token_key: string;
|
|
38
41
|
session_pageno_key: string;
|
|
39
|
-
session_reset_key: string;
|
|
40
42
|
local_uuid_key: string;
|
|
41
43
|
ingestPoint: string;
|
|
42
44
|
resourceBaseHref: string | null;
|
|
@@ -47,7 +49,7 @@ declare type AppOptions = {
|
|
|
47
49
|
localStorage: Storage | null;
|
|
48
50
|
sessionStorage: Storage | null;
|
|
49
51
|
onStart?: StartCallback;
|
|
50
|
-
} & WebworkerOptions;
|
|
52
|
+
} & WebworkerOptions & SessOptions;
|
|
51
53
|
export declare type Options = AppOptions & ObserverOptions & SanitizerOptions;
|
|
52
54
|
export declare const DEFAULT_INGEST_POINT = "https://api.openreplay.com/ingest";
|
|
53
55
|
export default class App {
|
|
@@ -61,7 +63,7 @@ export default class App {
|
|
|
61
63
|
readonly localStorage: Storage;
|
|
62
64
|
readonly sessionStorage: Storage;
|
|
63
65
|
private readonly messages;
|
|
64
|
-
|
|
66
|
+
readonly observer: Observer;
|
|
65
67
|
private readonly startCallbacks;
|
|
66
68
|
private readonly stopCallbacks;
|
|
67
69
|
private readonly commitCallbacks;
|
|
@@ -70,7 +72,7 @@ export default class App {
|
|
|
70
72
|
private activityState;
|
|
71
73
|
private readonly version;
|
|
72
74
|
private readonly worker?;
|
|
73
|
-
constructor(projectKey: string,
|
|
75
|
+
constructor(projectKey: string, sessionHash: string | undefined, options: Partial<Options>);
|
|
74
76
|
private _debug;
|
|
75
77
|
send(message: Message, urgent?: boolean): void;
|
|
76
78
|
private commit;
|
|
@@ -80,17 +82,17 @@ export default class App {
|
|
|
80
82
|
attachStopCallback(cb: () => any): void;
|
|
81
83
|
attachEventListener(target: EventTarget, type: string, listener: EventListener, useSafe?: boolean, useCapture?: boolean): void;
|
|
82
84
|
checkRequiredVersion(version: string): boolean;
|
|
83
|
-
private
|
|
85
|
+
private getTrackerInfo;
|
|
84
86
|
getSessionInfo(): {
|
|
85
87
|
userUUID: string | null;
|
|
86
88
|
projectKey: string;
|
|
87
89
|
revID: string;
|
|
88
|
-
timestamp: number;
|
|
89
90
|
trackerVersion: string;
|
|
90
91
|
isSnippet: boolean;
|
|
91
|
-
sessionID: string |
|
|
92
|
+
sessionID: string | undefined;
|
|
92
93
|
metadata: Record<string, string>;
|
|
93
94
|
userID: string | null;
|
|
95
|
+
timestamp: number;
|
|
94
96
|
};
|
|
95
97
|
getSessionToken(): string | undefined;
|
|
96
98
|
getSessionID(): string | undefined;
|
|
@@ -103,7 +105,7 @@ export default class App {
|
|
|
103
105
|
resetNextPageSession(flag: boolean): void;
|
|
104
106
|
private _start;
|
|
105
107
|
start(options?: StartOptions): Promise<StartPromiseReturn>;
|
|
106
|
-
stop(
|
|
108
|
+
stop(stopWorker?: boolean): void;
|
|
107
109
|
restart(): void;
|
|
108
110
|
}
|
|
109
111
|
export {};
|
package/lib/app/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Timestamp, Metadata, UserID } from '
|
|
2
|
-
import { timestamp } from '../utils.js';
|
|
1
|
+
import { Timestamp, Metadata, UserID } from './messages.gen.js';
|
|
2
|
+
import { timestamp as now } from '../utils.js';
|
|
3
3
|
import Nodes from './nodes.js';
|
|
4
4
|
import Observer from './observer/top_observer.js';
|
|
5
5
|
import Sanitizer from './sanitizer.js';
|
|
@@ -20,11 +20,10 @@ var ActivityState;
|
|
|
20
20
|
// TODO: use backendHost only
|
|
21
21
|
export const DEFAULT_INGEST_POINT = 'https://api.openreplay.com/ingest';
|
|
22
22
|
export default class App {
|
|
23
|
-
constructor(projectKey,
|
|
23
|
+
constructor(projectKey, sessionHash, options) {
|
|
24
24
|
// if (options.onStart !== undefined) {
|
|
25
25
|
// deprecationWarn("'onStart' option", "tracker.start().then(/* handle session info */)")
|
|
26
26
|
// } ?? maybe onStart is good
|
|
27
|
-
var _a, _b;
|
|
28
27
|
this.messages = [];
|
|
29
28
|
this.startCallbacks = [];
|
|
30
29
|
this.stopCallbacks = [];
|
|
@@ -55,24 +54,23 @@ export default class App {
|
|
|
55
54
|
this.ticker.attach(() => this.commit());
|
|
56
55
|
this.debug = new Logger(this.options.__debug__);
|
|
57
56
|
this.notify = new Logger(this.options.verbose ? LogLevel.Warnings : LogLevel.Silent);
|
|
58
|
-
this.
|
|
57
|
+
this.localStorage = this.options.localStorage || window.localStorage;
|
|
58
|
+
this.sessionStorage = this.options.sessionStorage || window.sessionStorage;
|
|
59
|
+
this.session = new Session(this, this.options);
|
|
59
60
|
this.session.attachUpdateCallback(({ userID, metadata }) => {
|
|
60
61
|
if (userID != null) {
|
|
61
62
|
// TODO: nullable userID
|
|
62
|
-
this.send(
|
|
63
|
+
this.send(UserID(userID));
|
|
63
64
|
}
|
|
64
65
|
if (metadata != null) {
|
|
65
|
-
Object.entries(metadata).forEach(([key, value]) => this.send(
|
|
66
|
+
Object.entries(metadata).forEach(([key, value]) => this.send(Metadata(key, value)));
|
|
66
67
|
}
|
|
67
68
|
});
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
this.sessionStorage = (_b = this.options.sessionStorage) !== null && _b !== void 0 ? _b : window.sessionStorage;
|
|
71
|
-
if (sessionToken != null) {
|
|
72
|
-
this.sessionStorage.setItem(this.options.session_token_key, sessionToken);
|
|
69
|
+
if (sessionHash != null) {
|
|
70
|
+
this.session.applySessionHash(sessionHash);
|
|
73
71
|
}
|
|
74
72
|
try {
|
|
75
|
-
this.worker = new Worker(URL.createObjectURL(new Blob(['"use strict";function t(t){function i(...i){return new t(...i)}return i.prototype=t.prototype,i}const i=new Map;const s=t(class{constructor(t,i,s){this.pageNo=t,this.firstIndex=i,this.timestamp=s,this._id=80}encode(t){return t.uint(80)&&t.uint(this.pageNo)&&t.uint(this.firstIndex)&&t.int(this.timestamp)}});i.set(80,s);const e=t(class{constructor(t){this.timestamp=t,this._id=0}encode(t){return t.uint(0)&&t.uint(this.timestamp)}});i.set(0,e);const n=t(class{constructor(t,i,s){this.url=t,this.referrer=i,this.navigationStart=s,this._id=4}encode(t){return t.uint(4)&&t.string(this.url)&&t.string(this.referrer)&&t.uint(this.navigationStart)}});i.set(4,n);const r=t(class{constructor(t,i){this.width=t,this.height=i,this._id=5}encode(t){return t.uint(5)&&t.uint(this.width)&&t.uint(this.height)}});i.set(5,r);const h=t(class{constructor(t,i){this.x=t,this.y=i,this._id=6}encode(t){return t.uint(6)&&t.int(this.x)&&t.int(this.y)}});i.set(6,h);const o=t(class{constructor(){this._id=7}encode(t){return t.uint(7)}});i.set(7,o);const c=t(class{constructor(t,i,s,e,n){this.id=t,this.parentID=i,this.index=s,this.tag=e,this.svg=n,this._id=8}encode(t){return t.uint(8)&&t.uint(this.id)&&t.uint(this.parentID)&&t.uint(this.index)&&t.string(this.tag)&&t.boolean(this.svg)}});i.set(8,c);const a=t(class{constructor(t,i,s){this.id=t,this.parentID=i,this.index=s,this._id=9}encode(t){return t.uint(9)&&t.uint(this.id)&&t.uint(this.parentID)&&t.uint(this.index)}});i.set(9,a);const u=t(class{constructor(t,i,s){this.id=t,this.parentID=i,this.index=s,this._id=10}encode(t){return t.uint(10)&&t.uint(this.id)&&t.uint(this.parentID)&&t.uint(this.index)}});i.set(10,u);const d=t(class{constructor(t){this.id=t,this._id=11}encode(t){return t.uint(11)&&t.uint(this.id)}});i.set(11,d);const l=t(class{constructor(t,i,s){this.id=t,this.name=i,this.value=s,this._id=12}encode(t){return t.uint(12)&&t.uint(this.id)&&t.string(this.name)&&t.string(this.value)}});i.set(12,l);const p=t(class{constructor(t,i){this.id=t,this.name=i,this._id=13}encode(t){return t.uint(13)&&t.uint(this.id)&&t.string(this.name)}});i.set(13,p);const g=t(class{constructor(t,i){this.id=t,this.data=i,this._id=14}encode(t){return t.uint(14)&&t.uint(this.id)&&t.string(this.data)}});i.set(14,g);const m=t(class{constructor(t,i,s){this.id=t,this.x=i,this.y=s,this._id=16}encode(t){return t.uint(16)&&t.uint(this.id)&&t.int(this.x)&&t.int(this.y)}});i.set(16,m);const f=t(class{constructor(t,i){this.id=t,this.label=i,this._id=17}encode(t){return t.uint(17)&&t.uint(this.id)&&t.string(this.label)}});i.set(17,f);const y=t(class{constructor(t,i,s){this.id=t,this.value=i,this.mask=s,this._id=18}encode(t){return t.uint(18)&&t.uint(this.id)&&t.string(this.value)&&t.int(this.mask)}});i.set(18,y);const _=t(class{constructor(t,i){this.id=t,this.checked=i,this._id=19}encode(t){return t.uint(19)&&t.uint(this.id)&&t.boolean(this.checked)}});i.set(19,_);const v=t(class{constructor(t,i){this.x=t,this.y=i,this._id=20}encode(t){return t.uint(20)&&t.uint(this.x)&&t.uint(this.y)}});i.set(20,v);const S=t(class{constructor(t,i){this.level=t,this.value=i,this._id=22}encode(t){return t.uint(22)&&t.string(this.level)&&t.string(this.value)}});i.set(22,S);const b=t(class{constructor(t,i,s,e,n,r,h,o,c){this.requestStart=t,this.responseStart=i,this.responseEnd=s,this.domContentLoadedEventStart=e,this.domContentLoadedEventEnd=n,this.loadEventStart=r,this.loadEventEnd=h,this.firstPaint=o,this.firstContentfulPaint=c,this._id=23}encode(t){return t.uint(23)&&t.uint(this.requestStart)&&t.uint(this.responseStart)&&t.uint(this.responseEnd)&&t.uint(this.domContentLoadedEventStart)&&t.uint(this.domContentLoadedEventEnd)&&t.uint(this.loadEventStart)&&t.uint(this.loadEventEnd)&&t.uint(this.firstPaint)&&t.uint(this.firstContentfulPaint)}});i.set(23,b);const w=t(class{constructor(t,i,s){this.speedIndex=t,this.visuallyComplete=i,this.timeToInteractive=s,this._id=24}encode(t){return t.uint(24)&&t.uint(this.speedIndex)&&t.uint(this.visuallyComplete)&&t.uint(this.timeToInteractive)}});i.set(24,w);const E=t(class{constructor(t,i,s){this.name=t,this.message=i,this.payload=s,this._id=25}encode(t){return t.uint(25)&&t.string(this.name)&&t.string(this.message)&&t.string(this.payload)}});i.set(25,E);const x=t(class{constructor(t,i){this.name=t,this.payload=i,this._id=27}encode(t){return t.uint(27)&&t.string(this.name)&&t.string(this.payload)}});i.set(27,x);const T=t(class{constructor(t){this.id=t,this._id=28}encode(t){return t.uint(28)&&t.string(this.id)}});i.set(28,T);const z=t(class{constructor(t){this.id=t,this._id=29}encode(t){return t.uint(29)&&t.string(this.id)}});i.set(29,z);const k=t(class{constructor(t,i){this.key=t,this.value=i,this._id=30}encode(t){return t.uint(30)&&t.string(this.key)&&t.string(this.value)}});i.set(30,k);const A=t(class{constructor(t,i,s){this.id=t,this.rule=i,this.index=s,this._id=37}encode(t){return t.uint(37)&&t.uint(this.id)&&t.string(this.rule)&&t.uint(this.index)}});i.set(37,A);const I=t(class{constructor(t,i){this.id=t,this.index=i,this._id=38}encode(t){return t.uint(38)&&t.uint(this.id)&&t.uint(this.index)}});i.set(38,I);const L=t(class{constructor(t,i,s,e,n,r,h){this.method=t,this.url=i,this.request=s,this.response=e,this.status=n,this.timestamp=r,this.duration=h,this._id=39}encode(t){return t.uint(39)&&t.string(this.method)&&t.string(this.url)&&t.string(this.request)&&t.string(this.response)&&t.uint(this.status)&&t.uint(this.timestamp)&&t.uint(this.duration)}});i.set(39,L);const C=t(class{constructor(t,i,s,e){this.name=t,this.duration=i,this.args=s,this.result=e,this._id=40}encode(t){return t.uint(40)&&t.string(this.name)&&t.uint(this.duration)&&t.string(this.args)&&t.string(this.result)}});i.set(40,C);const M=t(class{constructor(t,i){this.key=t,this.value=i,this._id=41}encode(t){return t.uint(41)&&t.string(this.key)&&t.string(this.value)}});i.set(41,M);const N=t(class{constructor(t){this.type=t,this._id=42}encode(t){return t.uint(42)&&t.string(this.type)}});i.set(42,N);const B=t(class{constructor(t,i,s){this.action=t,this.state=i,this.duration=s,this._id=44}encode(t){return t.uint(44)&&t.string(this.action)&&t.string(this.state)&&t.uint(this.duration)}});i.set(44,B);const U=t(class{constructor(t,i){this.mutation=t,this.state=i,this._id=45}encode(t){return t.uint(45)&&t.string(this.mutation)&&t.string(this.state)}});i.set(45,U);const R=t(class{constructor(t,i){this.type=t,this.payload=i,this._id=46}encode(t){return t.uint(46)&&t.string(this.type)&&t.string(this.payload)}});i.set(46,R);const O=t(class{constructor(t,i,s){this.action=t,this.state=i,this.duration=s,this._id=47}encode(t){return t.uint(47)&&t.string(this.action)&&t.string(this.state)&&t.uint(this.duration)}});i.set(47,O);const P=t(class{constructor(t,i,s,e){this.operationKind=t,this.operationName=i,this.variables=s,this.response=e,this._id=48}encode(t){return t.uint(48)&&t.string(this.operationKind)&&t.string(this.operationName)&&t.string(this.variables)&&t.string(this.response)}});i.set(48,P);const q=t(class{constructor(t,i,s,e){this.frames=t,this.ticks=i,this.totalJSHeapSize=s,this.usedJSHeapSize=e,this._id=49}encode(t){return t.uint(49)&&t.int(this.frames)&&t.int(this.ticks)&&t.uint(this.totalJSHeapSize)&&t.uint(this.usedJSHeapSize)}});i.set(49,q);const D=t(class{constructor(t,i,s,e,n,r,h,o){this.timestamp=t,this.duration=i,this.ttfb=s,this.headerSize=e,this.encodedBodySize=n,this.decodedBodySize=r,this.url=h,this.initiator=o,this._id=53}encode(t){return t.uint(53)&&t.uint(this.timestamp)&&t.uint(this.duration)&&t.uint(this.ttfb)&&t.uint(this.headerSize)&&t.uint(this.encodedBodySize)&&t.uint(this.decodedBodySize)&&t.string(this.url)&&t.string(this.initiator)}});i.set(53,D);const W=t(class{constructor(t,i){this.downlink=t,this.type=i,this._id=54}encode(t){return t.uint(54)&&t.uint(this.downlink)&&t.string(this.type)}});i.set(54,W);const H=t(class{constructor(t){this.hidden=t,this._id=55}encode(t){return t.uint(55)&&t.boolean(this.hidden)}});i.set(55,H);const J=t(class{constructor(t,i,s,e,n,r,h){this.timestamp=t,this.duration=i,this.context=s,this.containerType=e,this.containerSrc=n,this.containerId=r,this.containerName=h,this._id=59}encode(t){return t.uint(59)&&t.uint(this.timestamp)&&t.uint(this.duration)&&t.uint(this.context)&&t.uint(this.containerType)&&t.string(this.containerSrc)&&t.string(this.containerId)&&t.string(this.containerName)}});i.set(59,J);const F=t(class{constructor(t,i,s,e){this.id=t,this.name=i,this.value=s,this.baseURL=e,this._id=60}encode(t){return t.uint(60)&&t.uint(this.id)&&t.string(this.name)&&t.string(this.value)&&t.string(this.baseURL)}});i.set(60,F);const X=t(class{constructor(t,i,s){this.id=t,this.data=i,this.baseURL=s,this._id=61}encode(t){return t.uint(61)&&t.uint(this.id)&&t.string(this.data)&&t.string(this.baseURL)}});i.set(61,X);const G=t(class{constructor(t,i){this.type=t,this.value=i,this._id=63}encode(t){return t.uint(63)&&t.string(this.type)&&t.string(this.value)}});i.set(63,G);const K=t(class{constructor(t,i){this.name=t,this.payload=i,this._id=64}encode(t){return t.uint(64)&&t.string(this.name)&&t.string(this.payload)}});i.set(64,K);const j=t(class{constructor(){this._id=65}encode(t){return t.uint(65)}});i.set(65,j);const Q=t(class{constructor(t,i,s,e){this.id=t,this.rule=i,this.index=s,this.baseURL=e,this._id=67}encode(t){return t.uint(67)&&t.uint(this.id)&&t.string(this.rule)&&t.uint(this.index)&&t.string(this.baseURL)}});i.set(67,Q);const V=t(class{constructor(t,i,s,e){this.id=t,this.hesitationTime=i,this.label=s,this.selector=e,this._id=69}encode(t){return t.uint(69)&&t.uint(this.id)&&t.uint(this.hesitationTime)&&t.string(this.label)&&t.string(this.selector)}});i.set(69,V);const Y=t(class{constructor(t,i){this.frameID=t,this.id=i,this._id=70}encode(t){return t.uint(70)&&t.uint(this.frameID)&&t.uint(this.id)}});i.set(70,Y);class Z{constructor(t,i,s,e=10,n=1e3){this.onUnauthorised=i,this.onFailure=s,this.MAX_ATTEMPTS_COUNT=e,this.ATTEMPT_TIMEOUT=n,this.attemptsCount=0,this.busy=!1,this.queue=[],this.token=null,this.ingestURL=t+"/v1/web/i"}authorise(t){this.token=t}push(t){this.busy||!this.token?this.queue.push(t):this.sendBatch(t)}retry(t){this.attemptsCount>=this.MAX_ATTEMPTS_COUNT?this.onFailure():(this.attemptsCount++,setTimeout(()=>this.sendBatch(t),this.ATTEMPT_TIMEOUT*this.attemptsCount))}sendBatch(t){this.busy=!0,fetch(this.ingestURL,{body:t,method:"POST",headers:{Authorization:"Bearer "+this.token},keepalive:t.length<65536}).then(i=>{if(401===i.status)return this.busy=!1,void this.onUnauthorised();if(i.status>=400)return void this.retry(t);this.attemptsCount=0;const s=this.queue.shift();s?this.sendBatch(s):this.busy=!1}).catch(i=>{console.warn("OpenReplay:",i),this.retry(t)})}clean(){this.queue.length=0}}const tt="function"==typeof TextEncoder?new TextEncoder:{encode(t){const i=t.length,s=new Uint8Array(3*i);let e=-1;for(let n=0,r=0,h=0;h!==i;){if(n=t.charCodeAt(h),h+=1,n>=55296&&n<=56319){if(h===i){s[e+=1]=239,s[e+=1]=191,s[e+=1]=189;break}if(r=t.charCodeAt(h),!(r>=56320&&r<=57343)){s[e+=1]=239,s[e+=1]=191,s[e+=1]=189;continue}if(n=1024*(n-55296)+r-56320+65536,h+=1,n>65535){s[e+=1]=240|n>>>18,s[e+=1]=128|n>>>12&63,s[e+=1]=128|n>>>6&63,s[e+=1]=128|63&n;continue}}n<=127?s[e+=1]=0|n:n<=2047?(s[e+=1]=192|n>>>6,s[e+=1]=128|63&n):(s[e+=1]=224|n>>>12,s[e+=1]=128|n>>>6&63,s[e+=1]=128|63&n)}return s.subarray(0,e+1)}};class it{constructor(t){this.size=t,this.offset=0,this.checkpointOffset=0,this.data=new Uint8Array(t)}checkpoint(){this.checkpointOffset=this.offset}isEmpty(){return 0===this.offset}boolean(t){return this.data[this.offset++]=+t,this.offset<=this.size}uint(t){for((t<0||t>Number.MAX_SAFE_INTEGER)&&(t=0);t>=128;)this.data[this.offset++]=t%256|128,t=Math.floor(t/128);return this.data[this.offset++]=t,this.offset<=this.size}int(t){return t=Math.round(t),this.uint(t>=0?2*t:-2*t-1)}string(t){const i=tt.encode(t),s=i.byteLength;return!(!this.uint(s)||this.offset+s>this.size)&&(this.data.set(i,this.offset),this.offset+=s,!0)}reset(){this.offset=0,this.checkpointOffset=0}flush(){const t=this.data.slice(0,this.checkpointOffset);return this.reset(),t}}class st{constructor(t,i,s){this.pageNo=t,this.timestamp=i,this.onBatch=s,this.nextIndex=0,this.beaconSize=2e5,this.writer=new it(this.beaconSize),this.isEmpty=!0,this.beaconSizeLimit=1e6,this.prepare()}prepare(){this.writer.isEmpty()&&new s(this.pageNo,this.nextIndex,this.timestamp).encode(this.writer)}write(t){const i=t.encode(this.writer);return i&&(this.isEmpty=!1,this.writer.checkpoint(),this.nextIndex++),i}setBeaconSizeLimit(t){this.beaconSizeLimit=t}writeMessage(t){if(t instanceof e&&(this.timestamp=t.timestamp),!this.write(t))for(this.finaliseBatch();!this.write(t);){if(this.beaconSize===this.beaconSizeLimit)return console.warn("OpenReplay: beacon size overflow. Skipping large message."),this.writer.reset(),this.prepare(),void(this.isEmpty=!0);this.beaconSize=Math.min(2*this.beaconSize,this.beaconSizeLimit),this.writer=new it(this.beaconSize),this.prepare(),this.isEmpty=!0}}finaliseBatch(){this.isEmpty||(this.onBatch(this.writer.flush()),this.prepare(),this.isEmpty=!0)}clean(){this.writer.reset()}}var et;!function(t){t[t.NotActive=0]="NotActive",t[t.Starting=1]="Starting",t[t.Stopping=2]="Stopping",t[t.Active=3]="Active"}(et||(et={}));let nt=null,rt=null;function ht(){rt&&rt.finaliseBatch()}function ot(){et.Stopping,null!==at&&(clearInterval(at),at=null),rt&&(rt.clean(),rt=null),et.NotActive}et.NotActive;let ct,at=null;self.onmessage=({data:t})=>{if(null!=t){if("stop"===t)return ht(),void ot();if(Array.isArray(t)){if(!rt)throw new Error("WebWorker: writer not initialised. Service Should be Started.");const s=rt;t.forEach(t=>{const e=new(i.get(t._id));Object.assign(e,t),e instanceof H&&(e.hidden?ct=setTimeout(()=>self.postMessage("restart"),18e5):clearTimeout(ct)),s.writeMessage(e)})}else{if("start"===t.type)return et.Starting,nt=new Z(t.ingestPoint,()=>{self.postMessage("restart")},()=>{nt&&(nt.clean(),nt=null),ot(),self.postMessage("failed")},t.connAttemptCount,t.connAttemptGap),rt=new st(t.pageNo,t.timestamp,t=>nt&&nt.push(t)),null===at&&(at=setInterval(ht,1e4)),et.Active;if("auth"===t.type){if(!nt)throw new Error("WebWorker: sender not initialised. Received auth.");if(!rt)throw new Error("WebWorker: writer not initialised. Received auth.");return nt.authorise(t.token),void(t.beaconSizeLimit&&rt.setBeaconSizeLimit(t.beaconSizeLimit))}}}else ht()};'], { type: 'text/javascript' })));
|
|
73
|
+
this.worker = new Worker(URL.createObjectURL(new Blob(['"use strict";var t;!function(t){t[t.BatchMetadata=81]="BatchMetadata",t[t.PartitionedMessage=82]="PartitionedMessage",t[t.Timestamp=0]="Timestamp",t[t.SetPageLocation=4]="SetPageLocation",t[t.SetViewportSize=5]="SetViewportSize",t[t.SetViewportScroll=6]="SetViewportScroll",t[t.CreateDocument=7]="CreateDocument",t[t.CreateElementNode=8]="CreateElementNode",t[t.CreateTextNode=9]="CreateTextNode",t[t.MoveNode=10]="MoveNode",t[t.RemoveNode=11]="RemoveNode",t[t.SetNodeAttribute=12]="SetNodeAttribute",t[t.RemoveNodeAttribute=13]="RemoveNodeAttribute",t[t.SetNodeData=14]="SetNodeData",t[t.SetNodeScroll=16]="SetNodeScroll",t[t.SetInputTarget=17]="SetInputTarget",t[t.SetInputValue=18]="SetInputValue",t[t.SetInputChecked=19]="SetInputChecked",t[t.MouseMove=20]="MouseMove",t[t.ConsoleLog=22]="ConsoleLog",t[t.PageLoadTiming=23]="PageLoadTiming",t[t.PageRenderTiming=24]="PageRenderTiming",t[t.JSException=25]="JSException",t[t.RawCustomEvent=27]="RawCustomEvent",t[t.UserID=28]="UserID",t[t.UserAnonymousID=29]="UserAnonymousID",t[t.Metadata=30]="Metadata",t[t.CSSInsertRule=37]="CSSInsertRule",t[t.CSSDeleteRule=38]="CSSDeleteRule",t[t.Fetch=39]="Fetch",t[t.Profiler=40]="Profiler",t[t.OTable=41]="OTable",t[t.StateAction=42]="StateAction",t[t.Redux=44]="Redux",t[t.Vuex=45]="Vuex",t[t.MobX=46]="MobX",t[t.NgRx=47]="NgRx",t[t.GraphQL=48]="GraphQL",t[t.PerformanceTrack=49]="PerformanceTrack",t[t.ResourceTiming=53]="ResourceTiming",t[t.ConnectionInformation=54]="ConnectionInformation",t[t.SetPageVisibility=55]="SetPageVisibility",t[t.LongTask=59]="LongTask",t[t.SetNodeAttributeURLBased=60]="SetNodeAttributeURLBased",t[t.SetCSSDataURLBased=61]="SetCSSDataURLBased",t[t.TechnicalInfo=63]="TechnicalInfo",t[t.CustomIssue=64]="CustomIssue",t[t.CSSInsertRuleURLBased=67]="CSSInsertRuleURLBased",t[t.MouseClick=69]="MouseClick",t[t.CreateIFrameDocument=70]="CreateIFrameDocument",t[t.AdoptedSSReplaceURLBased=71]="AdoptedSSReplaceURLBased",t[t.AdoptedSSInsertRuleURLBased=73]="AdoptedSSInsertRuleURLBased",t[t.AdoptedSSDeleteRule=75]="AdoptedSSDeleteRule",t[t.AdoptedSSAddOwner=76]="AdoptedSSAddOwner",t[t.AdoptedSSRemoveOwner=77]="AdoptedSSRemoveOwner"}(t||(t={}));class e{constructor(t,e,i,s=10,n=1e3){this.onUnauthorised=e,this.onFailure=i,this.MAX_ATTEMPTS_COUNT=s,this.ATTEMPT_TIMEOUT=n,this.attemptsCount=0,this.busy=!1,this.queue=[],this.token=null,this.ingestURL=t+"/v1/web/i"}authorise(t){this.token=t}push(t){this.busy||!this.token?this.queue.push(t):this.sendBatch(t)}retry(t){this.attemptsCount>=this.MAX_ATTEMPTS_COUNT?this.onFailure():(this.attemptsCount++,setTimeout(()=>this.sendBatch(t),this.ATTEMPT_TIMEOUT*this.attemptsCount))}sendBatch(t){this.busy=!0,fetch(this.ingestURL,{body:t,method:"POST",headers:{Authorization:"Bearer "+this.token},keepalive:t.length<65536}).then(e=>{if(401===e.status)return this.busy=!1,void this.onUnauthorised();if(e.status>=400)return void this.retry(t);this.attemptsCount=0;const i=this.queue.shift();i?this.sendBatch(i):this.busy=!1}).catch(e=>{console.warn("OpenReplay:",e),this.retry(t)})}clean(){this.queue.length=0}}const i="function"==typeof TextEncoder?new TextEncoder:{encode(t){const e=t.length,i=new Uint8Array(3*e);let s=-1;for(let n=0,r=0,h=0;h!==e;){if(n=t.charCodeAt(h),h+=1,n>=55296&&n<=56319){if(h===e){i[s+=1]=239,i[s+=1]=191,i[s+=1]=189;break}if(r=t.charCodeAt(h),!(r>=56320&&r<=57343)){i[s+=1]=239,i[s+=1]=191,i[s+=1]=189;continue}if(n=1024*(n-55296)+r-56320+65536,h+=1,n>65535){i[s+=1]=240|n>>>18,i[s+=1]=128|n>>>12&63,i[s+=1]=128|n>>>6&63,i[s+=1]=128|63&n;continue}}n<=127?i[s+=1]=0|n:n<=2047?(i[s+=1]=192|n>>>6,i[s+=1]=128|63&n):(i[s+=1]=224|n>>>12,i[s+=1]=128|n>>>6&63,i[s+=1]=128|63&n)}return i.subarray(0,s+1)}};class s extends class{constructor(t){this.size=t,this.offset=0,this.checkpointOffset=0,this.data=new Uint8Array(t)}getCurrentOffset(){return this.offset}checkpoint(){this.checkpointOffset=this.offset}isEmpty(){return 0===this.offset}skip(t){return this.offset+=t,this.offset<=this.size}set(t,e){this.data.set(t,e)}boolean(t){return this.data[this.offset++]=+t,this.offset<=this.size}uint(t){for((t<0||t>Number.MAX_SAFE_INTEGER)&&(t=0);t>=128;)this.data[this.offset++]=t%256|128,t=Math.floor(t/128);return this.data[this.offset++]=t,this.offset<=this.size}int(t){return t=Math.round(t),this.uint(t>=0?2*t:-2*t-1)}string(t){const e=i.encode(t),s=e.byteLength;return!(!this.uint(s)||this.offset+s>this.size)&&(this.data.set(e,this.offset),this.offset+=s,!0)}reset(){this.offset=0,this.checkpointOffset=0}flush(){const t=this.data.slice(0,this.checkpointOffset);return this.reset(),t}}{encode(e){switch(e[0]){case t.BatchMetadata:return this.uint(e[1])&&this.uint(e[2])&&this.uint(e[3])&&this.int(e[4])&&this.string(e[5]);case t.PartitionedMessage:return this.uint(e[1])&&this.uint(e[2]);case t.Timestamp:return this.uint(e[1]);case t.SetPageLocation:return this.string(e[1])&&this.string(e[2])&&this.uint(e[3]);case t.SetViewportSize:return this.uint(e[1])&&this.uint(e[2]);case t.SetViewportScroll:return this.int(e[1])&&this.int(e[2]);case t.CreateDocument:return!0;case t.CreateElementNode:return this.uint(e[1])&&this.uint(e[2])&&this.uint(e[3])&&this.string(e[4])&&this.boolean(e[5]);case t.CreateTextNode:case t.MoveNode:return this.uint(e[1])&&this.uint(e[2])&&this.uint(e[3]);case t.RemoveNode:return this.uint(e[1]);case t.SetNodeAttribute:return this.uint(e[1])&&this.string(e[2])&&this.string(e[3]);case t.RemoveNodeAttribute:case t.SetNodeData:return this.uint(e[1])&&this.string(e[2]);case t.SetNodeScroll:return this.uint(e[1])&&this.int(e[2])&&this.int(e[3]);case t.SetInputTarget:return this.uint(e[1])&&this.string(e[2]);case t.SetInputValue:return this.uint(e[1])&&this.string(e[2])&&this.int(e[3]);case t.SetInputChecked:return this.uint(e[1])&&this.boolean(e[2]);case t.MouseMove:return this.uint(e[1])&&this.uint(e[2]);case t.ConsoleLog:return this.string(e[1])&&this.string(e[2]);case t.PageLoadTiming:return this.uint(e[1])&&this.uint(e[2])&&this.uint(e[3])&&this.uint(e[4])&&this.uint(e[5])&&this.uint(e[6])&&this.uint(e[7])&&this.uint(e[8])&&this.uint(e[9]);case t.PageRenderTiming:return this.uint(e[1])&&this.uint(e[2])&&this.uint(e[3]);case t.JSException:return this.string(e[1])&&this.string(e[2])&&this.string(e[3]);case t.RawCustomEvent:return this.string(e[1])&&this.string(e[2]);case t.UserID:case t.UserAnonymousID:return this.string(e[1]);case t.Metadata:return this.string(e[1])&&this.string(e[2]);case t.CSSInsertRule:return this.uint(e[1])&&this.string(e[2])&&this.uint(e[3]);case t.CSSDeleteRule:return this.uint(e[1])&&this.uint(e[2]);case t.Fetch:return this.string(e[1])&&this.string(e[2])&&this.string(e[3])&&this.string(e[4])&&this.uint(e[5])&&this.uint(e[6])&&this.uint(e[7]);case t.Profiler:return this.string(e[1])&&this.uint(e[2])&&this.string(e[3])&&this.string(e[4]);case t.OTable:return this.string(e[1])&&this.string(e[2]);case t.StateAction:return this.string(e[1]);case t.Redux:return this.string(e[1])&&this.string(e[2])&&this.uint(e[3]);case t.Vuex:case t.MobX:return this.string(e[1])&&this.string(e[2]);case t.NgRx:return this.string(e[1])&&this.string(e[2])&&this.uint(e[3]);case t.GraphQL:return this.string(e[1])&&this.string(e[2])&&this.string(e[3])&&this.string(e[4]);case t.PerformanceTrack:return this.int(e[1])&&this.int(e[2])&&this.uint(e[3])&&this.uint(e[4]);case t.ResourceTiming:return this.uint(e[1])&&this.uint(e[2])&&this.uint(e[3])&&this.uint(e[4])&&this.uint(e[5])&&this.uint(e[6])&&this.string(e[7])&&this.string(e[8]);case t.ConnectionInformation:return this.uint(e[1])&&this.string(e[2]);case t.SetPageVisibility:return this.boolean(e[1]);case t.LongTask:return this.uint(e[1])&&this.uint(e[2])&&this.uint(e[3])&&this.uint(e[4])&&this.string(e[5])&&this.string(e[6])&&this.string(e[7]);case t.SetNodeAttributeURLBased:return this.uint(e[1])&&this.string(e[2])&&this.string(e[3])&&this.string(e[4]);case t.SetCSSDataURLBased:return this.uint(e[1])&&this.string(e[2])&&this.string(e[3]);case t.TechnicalInfo:case t.CustomIssue:return this.string(e[1])&&this.string(e[2]);case t.CSSInsertRuleURLBased:return this.uint(e[1])&&this.string(e[2])&&this.uint(e[3])&&this.string(e[4]);case t.MouseClick:return this.uint(e[1])&&this.uint(e[2])&&this.string(e[3])&&this.string(e[4]);case t.CreateIFrameDocument:return this.uint(e[1])&&this.uint(e[2]);case t.AdoptedSSReplaceURLBased:return this.uint(e[1])&&this.string(e[2])&&this.string(e[3]);case t.AdoptedSSInsertRuleURLBased:return this.uint(e[1])&&this.string(e[2])&&this.uint(e[3])&&this.string(e[4]);case t.AdoptedSSDeleteRule:case t.AdoptedSSAddOwner:case t.AdoptedSSRemoveOwner:return this.uint(e[1])&&this.uint(e[2])}}}class n{constructor(t,e,i,n){this.pageNo=t,this.timestamp=e,this.url=i,this.onBatch=n,this.nextIndex=0,this.beaconSize=2e5,this.encoder=new s(this.beaconSize),this.sizeBuffer=new Uint8Array(3),this.isEmpty=!0,this.beaconSizeLimit=1e6,this.prepare()}writeType(t){return this.encoder.uint(t[0])}writeFields(t){return this.encoder.encode(t)}writeSizeAt(t,e){for(let e=0;e<3;e++)this.sizeBuffer[e]=t>>8*e;this.encoder.set(this.sizeBuffer,e)}prepare(){if(!this.encoder.isEmpty())return;const e=[t.BatchMetadata,1,this.pageNo,this.nextIndex,this.timestamp,this.url];this.writeType(e),this.writeFields(e),this.isEmpty=!0}writeWithSize(e){const i=this.encoder;if(!this.writeType(e)||!i.skip(3))return!1;const s=i.getCurrentOffset(),n=this.writeFields(e);if(n){const n=i.getCurrentOffset()-s;if(n>16777215)return console.warn("OpenReplay: max message size overflow."),!1;this.writeSizeAt(n,s-3),i.checkpoint(),this.isEmpty=this.isEmpty&&e[0]===t.Timestamp,this.nextIndex++}return n}setBeaconSizeLimit(t){this.beaconSizeLimit=t}writeMessage(e){if(e[0]===t.Timestamp&&(this.timestamp=e[1]),e[0]===t.SetPageLocation&&(this.url=e[1]),!this.writeWithSize(e))for(this.finaliseBatch();!this.writeWithSize(e);){if(this.beaconSize===this.beaconSizeLimit)return console.warn("OpenReplay: beacon size overflow. Skipping large message.",e),this.encoder.reset(),void this.prepare();this.beaconSize=Math.min(2*this.beaconSize,this.beaconSizeLimit),this.encoder=new s(this.beaconSize),this.prepare()}}finaliseBatch(){this.isEmpty||(this.onBatch(this.encoder.flush()),this.prepare())}clean(){this.encoder.reset()}}var r;!function(t){t[t.NotActive=0]="NotActive",t[t.Starting=1]="Starting",t[t.Stopping=2]="Stopping",t[t.Active=3]="Active"}(r||(r={}));let h=null,a=null;function o(){a&&a.finaliseBatch()}function u(){r.Stopping,null!==d&&(clearInterval(d),d=null),a&&(a.clean(),a=null),r.NotActive}r.NotActive;let c,d=null;self.onmessage=({data:i})=>{if(null!=i){if("stop"===i)return o(),void u();if(Array.isArray(i)){if(!a)throw new Error("WebWorker: writer not initialised. Service Should be Started.");const e=a;i.forEach(i=>{i[0]===t.SetPageVisibility&&(i[1]?c=setTimeout(()=>self.postMessage("restart"),18e5):clearTimeout(c)),e.writeMessage(i)})}else{if("start"===i.type)return r.Starting,h=new e(i.ingestPoint,()=>{self.postMessage("restart")},()=>{h&&(h.clean(),h=null),u(),self.postMessage("failed")},i.connAttemptCount,i.connAttemptGap),a=new n(i.pageNo,i.timestamp,i.url,t=>h&&h.push(t)),null===d&&(d=setInterval(o,1e4)),r.Active;if("auth"===i.type){if(!h)throw new Error("WebWorker: sender not initialised. Received auth.");if(!a)throw new Error("WebWorker: writer not initialised. Received auth.");return h.authorise(i.token),void(i.beaconSizeLimit&&a.setBeaconSizeLimit(i.beaconSizeLimit))}}}else o()};'], { type: 'text/javascript' })));
|
|
76
74
|
this.worker.onerror = (e) => {
|
|
77
75
|
this._debug('webworker_error', e);
|
|
78
76
|
};
|
|
@@ -129,7 +127,7 @@ export default class App {
|
|
|
129
127
|
}
|
|
130
128
|
commit() {
|
|
131
129
|
if (this.worker && this.messages.length) {
|
|
132
|
-
this.messages.unshift(
|
|
130
|
+
this.messages.unshift(Timestamp(now()));
|
|
133
131
|
this.worker.postMessage(this.messages);
|
|
134
132
|
this.commitCallbacks.forEach((cb) => cb(this.messages));
|
|
135
133
|
this.messages.length = 0;
|
|
@@ -143,7 +141,7 @@ export default class App {
|
|
|
143
141
|
}
|
|
144
142
|
catch (e) {
|
|
145
143
|
app._debug('safe_fn_call', e);
|
|
146
|
-
// time:
|
|
144
|
+
// time: now(),
|
|
147
145
|
// name: e.name,
|
|
148
146
|
// message: e.message,
|
|
149
147
|
// stack: e.stack
|
|
@@ -171,30 +169,32 @@ export default class App {
|
|
|
171
169
|
const reqVer = version.split(/[.-]/);
|
|
172
170
|
const ver = this.version.split(/[.-]/);
|
|
173
171
|
for (let i = 0; i < 3; i++) {
|
|
174
|
-
if (
|
|
172
|
+
if (isNaN(Number(ver[i])) || isNaN(Number(reqVer[i]))) {
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
if (Number(ver[i]) > Number(reqVer[i])) {
|
|
176
|
+
return true;
|
|
177
|
+
}
|
|
178
|
+
if (Number(ver[i]) < Number(reqVer[i])) {
|
|
175
179
|
return false;
|
|
176
180
|
}
|
|
177
181
|
}
|
|
178
182
|
return true;
|
|
179
183
|
}
|
|
180
|
-
|
|
184
|
+
getTrackerInfo() {
|
|
181
185
|
return {
|
|
182
186
|
userUUID: this.localStorage.getItem(this.options.local_uuid_key),
|
|
183
187
|
projectKey: this.projectKey,
|
|
184
188
|
revID: this.revID,
|
|
185
|
-
timestamp: timestamp(),
|
|
186
189
|
trackerVersion: this.version,
|
|
187
190
|
isSnippet: this.options.__is_snippet,
|
|
188
191
|
};
|
|
189
192
|
}
|
|
190
193
|
getSessionInfo() {
|
|
191
|
-
return Object.assign(Object.assign({}, this.session.getInfo()), this.
|
|
194
|
+
return Object.assign(Object.assign({}, this.session.getInfo()), this.getTrackerInfo());
|
|
192
195
|
}
|
|
193
196
|
getSessionToken() {
|
|
194
|
-
|
|
195
|
-
if (token !== null) {
|
|
196
|
-
return token;
|
|
197
|
-
}
|
|
197
|
+
return this.session.getSessionToken();
|
|
198
198
|
}
|
|
199
199
|
getSessionID() {
|
|
200
200
|
return this.session.getInfo().sessionID || undefined;
|
|
@@ -211,7 +211,7 @@ export default class App {
|
|
|
211
211
|
return this.options.resourceBaseHref;
|
|
212
212
|
}
|
|
213
213
|
else if (typeof this.options.resourceBaseHref === 'object') {
|
|
214
|
-
//switch between
|
|
214
|
+
//TODO: switch between types
|
|
215
215
|
}
|
|
216
216
|
if (document.baseURI) {
|
|
217
217
|
return document.baseURI;
|
|
@@ -248,19 +248,13 @@ export default class App {
|
|
|
248
248
|
return Promise.resolve(UnsuccessfulStart('OpenReplay: trying to call `start()` on the instance that has been started already.'));
|
|
249
249
|
}
|
|
250
250
|
this.activityState = ActivityState.Starting;
|
|
251
|
-
|
|
252
|
-
const pageNoStr = this.sessionStorage.getItem(this.options.session_pageno_key);
|
|
253
|
-
if (pageNoStr != null) {
|
|
254
|
-
pageNo = parseInt(pageNoStr);
|
|
255
|
-
pageNo++;
|
|
256
|
-
}
|
|
257
|
-
this.sessionStorage.setItem(this.options.session_pageno_key, pageNo.toString());
|
|
258
|
-
const startInfo = this.getStartInfo();
|
|
251
|
+
const timestamp = now();
|
|
259
252
|
const startWorkerMsg = {
|
|
260
253
|
type: 'start',
|
|
261
|
-
pageNo,
|
|
254
|
+
pageNo: this.session.incPageNo(),
|
|
262
255
|
ingestPoint: this.options.ingestPoint,
|
|
263
|
-
timestamp
|
|
256
|
+
timestamp,
|
|
257
|
+
url: document.URL,
|
|
264
258
|
connAttemptCount: this.options.connAttemptCount,
|
|
265
259
|
connAttemptGap: this.options.connAttemptGap,
|
|
266
260
|
};
|
|
@@ -280,7 +274,7 @@ export default class App {
|
|
|
280
274
|
headers: {
|
|
281
275
|
'Content-Type': 'application/json',
|
|
282
276
|
},
|
|
283
|
-
body: JSON.stringify(Object.assign(Object.assign({},
|
|
277
|
+
body: JSON.stringify(Object.assign(Object.assign({}, this.getTrackerInfo()), { timestamp, userID: this.session.getInfo().userID, token: this.session.getSessionToken(), deviceMemory,
|
|
284
278
|
jsHeapSizeLimit, reset: startOpts.forceNew || sReset !== null })),
|
|
285
279
|
})
|
|
286
280
|
.then((r) => {
|
|
@@ -299,15 +293,18 @@ export default class App {
|
|
|
299
293
|
if (!this.worker) {
|
|
300
294
|
return Promise.reject('no worker found after start request (this might not happen)');
|
|
301
295
|
}
|
|
302
|
-
const { token, userUUID, sessionID, beaconSizeLimit
|
|
296
|
+
const { token, userUUID, sessionID, beaconSizeLimit, startTimestamp, // real startTS, derived from sessionID
|
|
297
|
+
} = r;
|
|
303
298
|
if (typeof token !== 'string' ||
|
|
304
299
|
typeof userUUID !== 'string' ||
|
|
300
|
+
//typeof startTimestamp !== 'number' ||
|
|
301
|
+
//typeof sessionID !== 'string' ||
|
|
305
302
|
(typeof beaconSizeLimit !== 'number' && typeof beaconSizeLimit !== 'undefined')) {
|
|
306
303
|
return Promise.reject(`Incorrect server response: ${JSON.stringify(r)}`);
|
|
307
304
|
}
|
|
308
|
-
this.
|
|
305
|
+
this.session.setSessionToken(token);
|
|
309
306
|
this.localStorage.setItem(this.options.local_uuid_key, userUUID);
|
|
310
|
-
this.session.update({ sessionID }); // TODO: no no-explicit 'any'
|
|
307
|
+
this.session.update({ sessionID, timestamp: startTimestamp || timestamp }); // TODO: no no-explicit 'any'
|
|
311
308
|
const startWorkerMsg = {
|
|
312
309
|
type: 'auth',
|
|
313
310
|
token,
|
|
@@ -327,8 +324,8 @@ export default class App {
|
|
|
327
324
|
return SuccessfulStart(onStartInfo);
|
|
328
325
|
})
|
|
329
326
|
.catch((reason) => {
|
|
330
|
-
this.sessionStorage.removeItem(this.options.session_token_key);
|
|
331
327
|
this.stop();
|
|
328
|
+
this.session.reset();
|
|
332
329
|
if (reason === CANCELED) {
|
|
333
330
|
return UnsuccessfulStart(CANCELED);
|
|
334
331
|
}
|
|
@@ -353,7 +350,7 @@ export default class App {
|
|
|
353
350
|
});
|
|
354
351
|
}
|
|
355
352
|
}
|
|
356
|
-
stop(
|
|
353
|
+
stop(stopWorker = true) {
|
|
357
354
|
if (this.activityState !== ActivityState.NotActive) {
|
|
358
355
|
try {
|
|
359
356
|
this.sanitizer.clear();
|
|
@@ -361,11 +358,8 @@ export default class App {
|
|
|
361
358
|
this.nodes.clear();
|
|
362
359
|
this.ticker.stop();
|
|
363
360
|
this.stopCallbacks.forEach((cb) => cb());
|
|
364
|
-
if (calledFromAPI) {
|
|
365
|
-
this.session.reset();
|
|
366
|
-
}
|
|
367
361
|
this.notify.log('OpenReplay tracking stopped.');
|
|
368
|
-
if (this.worker &&
|
|
362
|
+
if (this.worker && stopWorker) {
|
|
369
363
|
this.worker.postMessage('stop');
|
|
370
364
|
}
|
|
371
365
|
}
|
|
@@ -375,7 +369,7 @@ export default class App {
|
|
|
375
369
|
}
|
|
376
370
|
}
|
|
377
371
|
restart() {
|
|
378
|
-
this.stop(false
|
|
372
|
+
this.stop(false);
|
|
379
373
|
this.start({ forceNew: false });
|
|
380
374
|
}
|
|
381
375
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as Messages from '../common/messages.gen.js';
|
|
2
|
+
export { default } from '../common/messages.gen.js';
|
|
3
|
+
export declare function BatchMetadata(version: number, pageNo: number, firstIndex: number, timestamp: number, location: string): Messages.BatchMetadata;
|
|
4
|
+
export declare function PartitionedMessage(partNo: number, partTotal: number): Messages.PartitionedMessage;
|
|
5
|
+
export declare function Timestamp(timestamp: number): Messages.Timestamp;
|
|
6
|
+
export declare function SetPageLocation(url: string, referrer: string, navigationStart: number): Messages.SetPageLocation;
|
|
7
|
+
export declare function SetViewportSize(width: number, height: number): Messages.SetViewportSize;
|
|
8
|
+
export declare function SetViewportScroll(x: number, y: number): Messages.SetViewportScroll;
|
|
9
|
+
export declare function CreateDocument(): Messages.CreateDocument;
|
|
10
|
+
export declare function CreateElementNode(id: number, parentID: number, index: number, tag: string, svg: boolean): Messages.CreateElementNode;
|
|
11
|
+
export declare function CreateTextNode(id: number, parentID: number, index: number): Messages.CreateTextNode;
|
|
12
|
+
export declare function MoveNode(id: number, parentID: number, index: number): Messages.MoveNode;
|
|
13
|
+
export declare function RemoveNode(id: number): Messages.RemoveNode;
|
|
14
|
+
export declare function SetNodeAttribute(id: number, name: string, value: string): Messages.SetNodeAttribute;
|
|
15
|
+
export declare function RemoveNodeAttribute(id: number, name: string): Messages.RemoveNodeAttribute;
|
|
16
|
+
export declare function SetNodeData(id: number, data: string): Messages.SetNodeData;
|
|
17
|
+
export declare function SetNodeScroll(id: number, x: number, y: number): Messages.SetNodeScroll;
|
|
18
|
+
export declare function SetInputTarget(id: number, label: string): Messages.SetInputTarget;
|
|
19
|
+
export declare function SetInputValue(id: number, value: string, mask: number): Messages.SetInputValue;
|
|
20
|
+
export declare function SetInputChecked(id: number, checked: boolean): Messages.SetInputChecked;
|
|
21
|
+
export declare function MouseMove(x: number, y: number): Messages.MouseMove;
|
|
22
|
+
export declare function ConsoleLog(level: string, value: string): Messages.ConsoleLog;
|
|
23
|
+
export declare function PageLoadTiming(requestStart: number, responseStart: number, responseEnd: number, domContentLoadedEventStart: number, domContentLoadedEventEnd: number, loadEventStart: number, loadEventEnd: number, firstPaint: number, firstContentfulPaint: number): Messages.PageLoadTiming;
|
|
24
|
+
export declare function PageRenderTiming(speedIndex: number, visuallyComplete: number, timeToInteractive: number): Messages.PageRenderTiming;
|
|
25
|
+
export declare function JSException(name: string, message: string, payload: string): Messages.JSException;
|
|
26
|
+
export declare function RawCustomEvent(name: string, payload: string): Messages.RawCustomEvent;
|
|
27
|
+
export declare function UserID(id: string): Messages.UserID;
|
|
28
|
+
export declare function UserAnonymousID(id: string): Messages.UserAnonymousID;
|
|
29
|
+
export declare function Metadata(key: string, value: string): Messages.Metadata;
|
|
30
|
+
export declare function CSSInsertRule(id: number, rule: string, index: number): Messages.CSSInsertRule;
|
|
31
|
+
export declare function CSSDeleteRule(id: number, index: number): Messages.CSSDeleteRule;
|
|
32
|
+
export declare function Fetch(method: string, url: string, request: string, response: string, status: number, timestamp: number, duration: number): Messages.Fetch;
|
|
33
|
+
export declare function Profiler(name: string, duration: number, args: string, result: string): Messages.Profiler;
|
|
34
|
+
export declare function OTable(key: string, value: string): Messages.OTable;
|
|
35
|
+
export declare function StateAction(type: string): Messages.StateAction;
|
|
36
|
+
export declare function Redux(action: string, state: string, duration: number): Messages.Redux;
|
|
37
|
+
export declare function Vuex(mutation: string, state: string): Messages.Vuex;
|
|
38
|
+
export declare function MobX(type: string, payload: string): Messages.MobX;
|
|
39
|
+
export declare function NgRx(action: string, state: string, duration: number): Messages.NgRx;
|
|
40
|
+
export declare function GraphQL(operationKind: string, operationName: string, variables: string, response: string): Messages.GraphQL;
|
|
41
|
+
export declare function PerformanceTrack(frames: number, ticks: number, totalJSHeapSize: number, usedJSHeapSize: number): Messages.PerformanceTrack;
|
|
42
|
+
export declare function ResourceTiming(timestamp: number, duration: number, ttfb: number, headerSize: number, encodedBodySize: number, decodedBodySize: number, url: string, initiator: string): Messages.ResourceTiming;
|
|
43
|
+
export declare function ConnectionInformation(downlink: number, type: string): Messages.ConnectionInformation;
|
|
44
|
+
export declare function SetPageVisibility(hidden: boolean): Messages.SetPageVisibility;
|
|
45
|
+
export declare function LongTask(timestamp: number, duration: number, context: number, containerType: number, containerSrc: string, containerId: string, containerName: string): Messages.LongTask;
|
|
46
|
+
export declare function SetNodeAttributeURLBased(id: number, name: string, value: string, baseURL: string): Messages.SetNodeAttributeURLBased;
|
|
47
|
+
export declare function SetCSSDataURLBased(id: number, data: string, baseURL: string): Messages.SetCSSDataURLBased;
|
|
48
|
+
export declare function TechnicalInfo(type: string, value: string): Messages.TechnicalInfo;
|
|
49
|
+
export declare function CustomIssue(name: string, payload: string): Messages.CustomIssue;
|
|
50
|
+
export declare function CSSInsertRuleURLBased(id: number, rule: string, index: number, baseURL: string): Messages.CSSInsertRuleURLBased;
|
|
51
|
+
export declare function MouseClick(id: number, hesitationTime: number, label: string, selector: string): Messages.MouseClick;
|
|
52
|
+
export declare function CreateIFrameDocument(frameID: number, id: number): Messages.CreateIFrameDocument;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as Messages from '../common/messages.gen.js';
|
|
2
|
+
export { default } from '../common/messages.gen.js';
|
|
3
|
+
export declare function BatchMetadata(version: number, pageNo: number, firstIndex: number, timestamp: number, location: string): Messages.BatchMetadata;
|
|
4
|
+
export declare function PartitionedMessage(partNo: number, partTotal: number): Messages.PartitionedMessage;
|
|
5
|
+
export declare function Timestamp(timestamp: number): Messages.Timestamp;
|
|
6
|
+
export declare function SetPageLocation(url: string, referrer: string, navigationStart: number): Messages.SetPageLocation;
|
|
7
|
+
export declare function SetViewportSize(width: number, height: number): Messages.SetViewportSize;
|
|
8
|
+
export declare function SetViewportScroll(x: number, y: number): Messages.SetViewportScroll;
|
|
9
|
+
export declare function CreateDocument(): Messages.CreateDocument;
|
|
10
|
+
export declare function CreateElementNode(id: number, parentID: number, index: number, tag: string, svg: boolean): Messages.CreateElementNode;
|
|
11
|
+
export declare function CreateTextNode(id: number, parentID: number, index: number): Messages.CreateTextNode;
|
|
12
|
+
export declare function MoveNode(id: number, parentID: number, index: number): Messages.MoveNode;
|
|
13
|
+
export declare function RemoveNode(id: number): Messages.RemoveNode;
|
|
14
|
+
export declare function SetNodeAttribute(id: number, name: string, value: string): Messages.SetNodeAttribute;
|
|
15
|
+
export declare function RemoveNodeAttribute(id: number, name: string): Messages.RemoveNodeAttribute;
|
|
16
|
+
export declare function SetNodeData(id: number, data: string): Messages.SetNodeData;
|
|
17
|
+
export declare function SetNodeScroll(id: number, x: number, y: number): Messages.SetNodeScroll;
|
|
18
|
+
export declare function SetInputTarget(id: number, label: string): Messages.SetInputTarget;
|
|
19
|
+
export declare function SetInputValue(id: number, value: string, mask: number): Messages.SetInputValue;
|
|
20
|
+
export declare function SetInputChecked(id: number, checked: boolean): Messages.SetInputChecked;
|
|
21
|
+
export declare function MouseMove(x: number, y: number): Messages.MouseMove;
|
|
22
|
+
export declare function ConsoleLog(level: string, value: string): Messages.ConsoleLog;
|
|
23
|
+
export declare function PageLoadTiming(requestStart: number, responseStart: number, responseEnd: number, domContentLoadedEventStart: number, domContentLoadedEventEnd: number, loadEventStart: number, loadEventEnd: number, firstPaint: number, firstContentfulPaint: number): Messages.PageLoadTiming;
|
|
24
|
+
export declare function PageRenderTiming(speedIndex: number, visuallyComplete: number, timeToInteractive: number): Messages.PageRenderTiming;
|
|
25
|
+
export declare function JSException(name: string, message: string, payload: string): Messages.JSException;
|
|
26
|
+
export declare function RawCustomEvent(name: string, payload: string): Messages.RawCustomEvent;
|
|
27
|
+
export declare function UserID(id: string): Messages.UserID;
|
|
28
|
+
export declare function UserAnonymousID(id: string): Messages.UserAnonymousID;
|
|
29
|
+
export declare function Metadata(key: string, value: string): Messages.Metadata;
|
|
30
|
+
export declare function CSSInsertRule(id: number, rule: string, index: number): Messages.CSSInsertRule;
|
|
31
|
+
export declare function CSSDeleteRule(id: number, index: number): Messages.CSSDeleteRule;
|
|
32
|
+
export declare function Fetch(method: string, url: string, request: string, response: string, status: number, timestamp: number, duration: number): Messages.Fetch;
|
|
33
|
+
export declare function Profiler(name: string, duration: number, args: string, result: string): Messages.Profiler;
|
|
34
|
+
export declare function OTable(key: string, value: string): Messages.OTable;
|
|
35
|
+
export declare function StateAction(type: string): Messages.StateAction;
|
|
36
|
+
export declare function Redux(action: string, state: string, duration: number): Messages.Redux;
|
|
37
|
+
export declare function Vuex(mutation: string, state: string): Messages.Vuex;
|
|
38
|
+
export declare function MobX(type: string, payload: string): Messages.MobX;
|
|
39
|
+
export declare function NgRx(action: string, state: string, duration: number): Messages.NgRx;
|
|
40
|
+
export declare function GraphQL(operationKind: string, operationName: string, variables: string, response: string): Messages.GraphQL;
|
|
41
|
+
export declare function PerformanceTrack(frames: number, ticks: number, totalJSHeapSize: number, usedJSHeapSize: number): Messages.PerformanceTrack;
|
|
42
|
+
export declare function ResourceTiming(timestamp: number, duration: number, ttfb: number, headerSize: number, encodedBodySize: number, decodedBodySize: number, url: string, initiator: string): Messages.ResourceTiming;
|
|
43
|
+
export declare function ConnectionInformation(downlink: number, type: string): Messages.ConnectionInformation;
|
|
44
|
+
export declare function SetPageVisibility(hidden: boolean): Messages.SetPageVisibility;
|
|
45
|
+
export declare function LongTask(timestamp: number, duration: number, context: number, containerType: number, containerSrc: string, containerId: string, containerName: string): Messages.LongTask;
|
|
46
|
+
export declare function SetNodeAttributeURLBased(id: number, name: string, value: string, baseURL: string): Messages.SetNodeAttributeURLBased;
|
|
47
|
+
export declare function SetCSSDataURLBased(id: number, data: string, baseURL: string): Messages.SetCSSDataURLBased;
|
|
48
|
+
export declare function TechnicalInfo(type: string, value: string): Messages.TechnicalInfo;
|
|
49
|
+
export declare function CustomIssue(name: string, payload: string): Messages.CustomIssue;
|
|
50
|
+
export declare function CSSInsertRuleURLBased(id: number, rule: string, index: number, baseURL: string): Messages.CSSInsertRuleURLBased;
|
|
51
|
+
export declare function MouseClick(id: number, hesitationTime: number, label: string, selector: string): Messages.MouseClick;
|
|
52
|
+
export declare function CreateIFrameDocument(frameID: number, id: number): Messages.CreateIFrameDocument;
|
|
53
|
+
export declare function AdoptedSSReplaceURLBased(sheetID: number, text: string, baseURL: string): Messages.AdoptedSSReplaceURLBased;
|
|
54
|
+
export declare function AdoptedSSInsertRuleURLBased(sheetID: number, rule: string, index: number, baseURL: string): Messages.AdoptedSSInsertRuleURLBased;
|
|
55
|
+
export declare function AdoptedSSDeleteRule(sheetID: number, index: number): Messages.AdoptedSSDeleteRule;
|
|
56
|
+
export declare function AdoptedSSAddOwner(sheetID: number, id: number): Messages.AdoptedSSAddOwner;
|
|
57
|
+
export declare function AdoptedSSRemoveOwner(sheetID: number, id: number): Messages.AdoptedSSRemoveOwner;
|