@openreplay/tracker 5.0.2-beta → 5.0.2
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/guards.d.ts +21 -0
- package/cjs/app/guards.js +37 -0
- package/cjs/app/index.d.ts +118 -0
- package/cjs/app/index.js +438 -0
- package/cjs/app/logger.d.ts +26 -0
- package/cjs/app/logger.js +45 -0
- package/cjs/app/messages.gen.d.ts +63 -0
- package/cjs/app/messages.gen.js +551 -0
- package/cjs/app/nodes.d.ts +18 -0
- package/cjs/app/nodes.js +82 -0
- package/cjs/app/observer/iframe_observer.d.ts +4 -0
- package/cjs/app/observer/iframe_observer.js +23 -0
- package/cjs/app/observer/iframe_offsets.d.ts +8 -0
- package/cjs/app/observer/iframe_offsets.js +59 -0
- package/cjs/app/observer/observer.d.ts +23 -0
- package/cjs/app/observer/observer.js +340 -0
- package/cjs/app/observer/shadow_root_observer.d.ts +4 -0
- package/cjs/app/observer/shadow_root_observer.js +21 -0
- package/cjs/app/observer/top_observer.d.ts +24 -0
- package/cjs/app/observer/top_observer.js +113 -0
- package/cjs/app/sanitizer.d.ts +24 -0
- package/cjs/app/sanitizer.js +76 -0
- package/cjs/app/session.d.ts +38 -0
- package/cjs/app/session.js +114 -0
- package/cjs/app/ticker.d.ts +12 -0
- package/cjs/app/ticker.js +42 -0
- package/cjs/common/interaction.d.ts +24 -0
- package/cjs/common/interaction.js +2 -0
- package/cjs/common/messages.gen.d.ts +427 -0
- package/cjs/common/messages.gen.js +4 -0
- package/cjs/index.d.ts +47 -0
- package/cjs/index.js +254 -0
- package/cjs/modules/connection.d.ts +2 -0
- package/cjs/modules/connection.js +15 -0
- package/cjs/modules/console.d.ts +6 -0
- package/cjs/modules/console.js +119 -0
- package/cjs/modules/constructedStyleSheets.d.ts +4 -0
- package/cjs/modules/constructedStyleSheets.js +131 -0
- package/cjs/modules/cssrules.d.ts +2 -0
- package/cjs/modules/cssrules.js +99 -0
- package/cjs/modules/exception.d.ts +16 -0
- package/cjs/modules/exception.js +77 -0
- package/cjs/modules/focus.d.ts +2 -0
- package/cjs/modules/focus.js +45 -0
- package/cjs/modules/fonts.d.ts +2 -0
- package/cjs/modules/fonts.js +57 -0
- package/cjs/modules/img.d.ts +2 -0
- package/cjs/modules/img.js +110 -0
- package/cjs/modules/input.d.ts +16 -0
- package/cjs/modules/input.js +163 -0
- package/cjs/modules/mouse.d.ts +2 -0
- package/cjs/modules/mouse.js +148 -0
- package/cjs/modules/network.d.ts +28 -0
- package/cjs/modules/network.js +203 -0
- package/cjs/modules/performance.d.ts +7 -0
- package/cjs/modules/performance.js +53 -0
- package/cjs/modules/scroll.d.ts +2 -0
- package/cjs/modules/scroll.js +79 -0
- package/cjs/modules/timing.d.ts +7 -0
- package/cjs/modules/timing.js +160 -0
- package/cjs/modules/viewport.d.ts +2 -0
- package/cjs/modules/viewport.js +43 -0
- package/cjs/package.json +1 -0
- package/cjs/utils.d.ts +13 -0
- package/cjs/utils.js +71 -0
- package/cjs/vendors/finder/finder.d.ts +12 -0
- package/cjs/vendors/finder/finder.js +352 -0
- package/lib/app/guards.d.ts +21 -0
- package/lib/app/guards.js +26 -0
- package/lib/app/index.d.ts +118 -0
- package/lib/app/index.js +434 -0
- package/lib/app/logger.d.ts +26 -0
- package/lib/app/logger.js +41 -0
- package/lib/app/messages.gen.d.ts +63 -0
- package/lib/app/messages.gen.js +486 -0
- package/lib/app/nodes.d.ts +18 -0
- package/lib/app/nodes.js +79 -0
- package/lib/app/observer/iframe_observer.d.ts +4 -0
- package/lib/app/observer/iframe_observer.js +20 -0
- package/lib/app/observer/iframe_offsets.d.ts +8 -0
- package/lib/app/observer/iframe_offsets.js +56 -0
- package/lib/app/observer/observer.d.ts +23 -0
- package/lib/app/observer/observer.js +337 -0
- package/lib/app/observer/shadow_root_observer.d.ts +4 -0
- package/lib/app/observer/shadow_root_observer.js +18 -0
- package/lib/app/observer/top_observer.d.ts +24 -0
- package/lib/app/observer/top_observer.js +110 -0
- package/lib/app/sanitizer.d.ts +24 -0
- package/lib/app/sanitizer.js +72 -0
- package/lib/app/session.d.ts +38 -0
- package/lib/app/session.js +111 -0
- package/lib/app/ticker.d.ts +12 -0
- package/lib/app/ticker.js +39 -0
- package/lib/common/interaction.d.ts +24 -0
- package/lib/common/interaction.js +1 -0
- package/lib/common/messages.gen.d.ts +427 -0
- package/lib/common/messages.gen.js +3 -0
- package/lib/common/tsconfig.tsbuildinfo +1 -0
- package/lib/index.d.ts +47 -0
- package/lib/index.js +248 -0
- package/lib/modules/connection.d.ts +2 -0
- package/lib/modules/connection.js +12 -0
- package/lib/modules/console.d.ts +6 -0
- package/lib/modules/console.js +116 -0
- package/lib/modules/constructedStyleSheets.d.ts +4 -0
- package/lib/modules/constructedStyleSheets.js +126 -0
- package/lib/modules/cssrules.d.ts +2 -0
- package/lib/modules/cssrules.js +97 -0
- package/lib/modules/exception.d.ts +16 -0
- package/lib/modules/exception.js +71 -0
- package/lib/modules/focus.d.ts +2 -0
- package/lib/modules/focus.js +42 -0
- package/lib/modules/fonts.d.ts +2 -0
- package/lib/modules/fonts.js +54 -0
- package/lib/modules/img.d.ts +2 -0
- package/lib/modules/img.js +107 -0
- package/lib/modules/input.d.ts +16 -0
- package/lib/modules/input.js +158 -0
- package/lib/modules/mouse.d.ts +2 -0
- package/lib/modules/mouse.js +145 -0
- package/lib/modules/network.d.ts +28 -0
- package/lib/modules/network.js +200 -0
- package/lib/modules/performance.d.ts +7 -0
- package/lib/modules/performance.js +49 -0
- package/lib/modules/scroll.d.ts +2 -0
- package/lib/modules/scroll.js +76 -0
- package/lib/modules/timing.d.ts +7 -0
- package/lib/modules/timing.js +157 -0
- package/lib/modules/viewport.d.ts +2 -0
- package/lib/modules/viewport.js +40 -0
- package/lib/utils.d.ts +13 -0
- package/lib/utils.js +61 -0
- package/lib/vendors/finder/finder.d.ts +12 -0
- package/lib/vendors/finder/finder.js +348 -0
- package/package.json +1 -1
package/lib/app/index.js
ADDED
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
import { Timestamp, Metadata, UserID } from './messages.gen.js';
|
|
2
|
+
import { now, adjustTimeOrigin, deprecationWarn } from '../utils.js';
|
|
3
|
+
import Nodes from './nodes.js';
|
|
4
|
+
import Observer from './observer/top_observer.js';
|
|
5
|
+
import Sanitizer from './sanitizer.js';
|
|
6
|
+
import Ticker from './ticker.js';
|
|
7
|
+
import Logger, { LogLevel } from './logger.js';
|
|
8
|
+
import Session from './session.js';
|
|
9
|
+
import { deviceMemory, jsHeapSizeLimit } from '../modules/performance.js';
|
|
10
|
+
const CANCELED = 'canceled';
|
|
11
|
+
const START_ERROR = ':(';
|
|
12
|
+
const UnsuccessfulStart = (reason) => ({ reason, success: false });
|
|
13
|
+
const SuccessfulStart = (body) => (Object.assign(Object.assign({}, body), { success: true }));
|
|
14
|
+
var ActivityState;
|
|
15
|
+
(function (ActivityState) {
|
|
16
|
+
ActivityState[ActivityState["NotActive"] = 0] = "NotActive";
|
|
17
|
+
ActivityState[ActivityState["Starting"] = 1] = "Starting";
|
|
18
|
+
ActivityState[ActivityState["Active"] = 2] = "Active";
|
|
19
|
+
})(ActivityState || (ActivityState = {}));
|
|
20
|
+
// TODO: use backendHost only
|
|
21
|
+
export const DEFAULT_INGEST_POINT = 'https://api.openreplay.com/ingest';
|
|
22
|
+
export default class App {
|
|
23
|
+
constructor(projectKey, sessionToken, options) {
|
|
24
|
+
// if (options.onStart !== undefined) {
|
|
25
|
+
// deprecationWarn("'onStart' option", "tracker.start().then(/* handle session info */)")
|
|
26
|
+
// } ?? maybe onStart is good
|
|
27
|
+
var _a, _b;
|
|
28
|
+
this.messages = [];
|
|
29
|
+
this.startCallbacks = [];
|
|
30
|
+
this.stopCallbacks = [];
|
|
31
|
+
this.commitCallbacks = [];
|
|
32
|
+
this.activityState = ActivityState.NotActive;
|
|
33
|
+
this.version = '5.0.2'; // TODO: version compatability check inside each plugin.
|
|
34
|
+
this._usingOldFetchPlugin = false;
|
|
35
|
+
this.delay = 0;
|
|
36
|
+
this.projectKey = projectKey;
|
|
37
|
+
this.options = Object.assign({
|
|
38
|
+
revID: '',
|
|
39
|
+
node_id: '__openreplay_id',
|
|
40
|
+
session_token_key: '__openreplay_token',
|
|
41
|
+
session_pageno_key: '__openreplay_pageno',
|
|
42
|
+
session_reset_key: '__openreplay_reset',
|
|
43
|
+
local_uuid_key: '__openreplay_uuid',
|
|
44
|
+
ingestPoint: DEFAULT_INGEST_POINT,
|
|
45
|
+
resourceBaseHref: null,
|
|
46
|
+
verbose: false,
|
|
47
|
+
__is_snippet: false,
|
|
48
|
+
__debug_report_edp: null,
|
|
49
|
+
localStorage: null,
|
|
50
|
+
sessionStorage: null,
|
|
51
|
+
}, options);
|
|
52
|
+
this.revID = this.options.revID;
|
|
53
|
+
this.localStorage = (_a = this.options.localStorage) !== null && _a !== void 0 ? _a : window.localStorage;
|
|
54
|
+
this.sessionStorage = (_b = this.options.sessionStorage) !== null && _b !== void 0 ? _b : window.sessionStorage;
|
|
55
|
+
this.sanitizer = new Sanitizer(this, options);
|
|
56
|
+
this.nodes = new Nodes(this.options.node_id);
|
|
57
|
+
this.observer = new Observer(this, options);
|
|
58
|
+
this.ticker = new Ticker(this);
|
|
59
|
+
this.ticker.attach(() => this.commit());
|
|
60
|
+
this.debug = new Logger(this.options.__debug__);
|
|
61
|
+
this.notify = new Logger(this.options.verbose ? LogLevel.Warnings : LogLevel.Silent);
|
|
62
|
+
this.session = new Session(this, this.options);
|
|
63
|
+
this.session.attachUpdateCallback(({ userID, metadata }) => {
|
|
64
|
+
if (userID != null) {
|
|
65
|
+
// TODO: nullable userID
|
|
66
|
+
this.send(UserID(userID));
|
|
67
|
+
}
|
|
68
|
+
if (metadata != null) {
|
|
69
|
+
Object.entries(metadata).forEach(([key, value]) => this.send(Metadata(key, value)));
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
// @depricated (use sessionHash on start instead)
|
|
73
|
+
if (sessionToken != null) {
|
|
74
|
+
this.session.applySessionHash(sessionToken);
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
this.worker = new Worker(URL.createObjectURL(new Blob(['"use strict";class t{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,this.busy||this.sendNext()}push(t){this.busy||!this.token?this.queue.push(t):this.sendBatch(t)}sendNext(){const t=this.queue.shift();t?this.sendBatch(t):this.busy=!1}retry(t){this.attemptsCount>=this.MAX_ATTEMPTS_COUNT?this.onFailure(`Failed to send batch after ${this.attemptsCount} attempts.`):(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();i.status>=400?this.retry(t):(this.attemptsCount=0,this.sendNext())}).catch(i=>{console.warn("OpenReplay:",i),this.retry(t)})}clean(){this.queue.length=0,this.token=null}}const i="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 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}get isEmpty(){return 0===this.offset}skip(t){return this.offset+=t,this.offset<=this.size}set(t,i){this.data.set(t,i)}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 s=i.encode(t),e=s.byteLength;return!(!this.uint(e)||this.offset+e>this.size)&&(this.data.set(s,this.offset),this.offset+=e,!0)}reset(){this.offset=0,this.checkpointOffset=0}flush(){const t=this.data.slice(0,this.checkpointOffset);return this.reset(),t}}{encode(t){switch(t[0]){case 0:return this.uint(t[1]);case 4:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3]);case 5:return this.uint(t[1])&&this.uint(t[2]);case 6:return this.int(t[1])&&this.int(t[2]);case 7:return!0;case 8:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.string(t[4])&&this.boolean(t[5]);case 9:case 10:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3]);case 11:return this.uint(t[1]);case 12:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3]);case 13:case 14:return this.uint(t[1])&&this.string(t[2]);case 16:return this.uint(t[1])&&this.int(t[2])&&this.int(t[3]);case 17:return this.uint(t[1])&&this.string(t[2]);case 18:return this.uint(t[1])&&this.string(t[2])&&this.int(t[3]);case 19:return this.uint(t[1])&&this.boolean(t[2]);case 20:return this.uint(t[1])&&this.uint(t[2]);case 21:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.string(t[5])&&this.uint(t[6])&&this.uint(t[7])&&this.uint(t[8]);case 22:return this.string(t[1])&&this.string(t[2]);case 23:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.uint(t[7])&&this.uint(t[8])&&this.uint(t[9]);case 24:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3]);case 27:return this.string(t[1])&&this.string(t[2]);case 28:case 29:return this.string(t[1]);case 30:return this.string(t[1])&&this.string(t[2]);case 37:return this.uint(t[1])&&this.string(t[2])&&this.uint(t[3]);case 38:return this.uint(t[1])&&this.uint(t[2]);case 39:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.uint(t[7]);case 40:return this.string(t[1])&&this.uint(t[2])&&this.string(t[3])&&this.string(t[4]);case 41:return this.string(t[1])&&this.string(t[2]);case 42:return this.string(t[1]);case 44:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3]);case 45:case 46:return this.string(t[1])&&this.string(t[2]);case 47:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3]);case 48:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4]);case 49:return this.int(t[1])&&this.int(t[2])&&this.uint(t[3])&&this.uint(t[4]);case 50:return this.uint(t[1])&&this.string(t[2]);case 51:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3]);case 53:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.string(t[7])&&this.string(t[8]);case 54:return this.uint(t[1])&&this.string(t[2]);case 55:return this.boolean(t[1]);case 57:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4]);case 58:return this.int(t[1]);case 59:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.string(t[5])&&this.string(t[6])&&this.string(t[7]);case 60:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4]);case 61:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3]);case 63:case 64:return this.string(t[1])&&this.string(t[2]);case 67:return this.uint(t[1])&&this.string(t[2])&&this.uint(t[3])&&this.string(t[4]);case 69:return this.uint(t[1])&&this.uint(t[2])&&this.string(t[3])&&this.string(t[4]);case 70:return this.uint(t[1])&&this.uint(t[2]);case 71:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3]);case 73:return this.uint(t[1])&&this.string(t[2])&&this.uint(t[3])&&this.string(t[4]);case 75:case 76:case 77:return this.uint(t[1])&&this.uint(t[2]);case 78:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4]);case 79:return this.string(t[1])&&this.string(t[2]);case 81:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.int(t[4])&&this.string(t[5]);case 82:return this.uint(t[1])&&this.uint(t[2])}}}class e{constructor(){this.idx=1,this.backDict={}}getKey(t){let i=!1;return this.backDict[t]||(i=!0,this.backDict[t]=this.idx++),[this.backDict[t],i]}}class n{constructor(t,i,n,r){this.pageNo=t,this.timestamp=i,this.url=n,this.onBatch=r,this.nextIndex=0,this.beaconSize=2e5,this.encoder=new s(this.beaconSize),this.strDict=new e,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,i){for(let i=0;i<3;i++)this.sizeBuffer[i]=t>>8*i;this.encoder.set(this.sizeBuffer,i)}prepare(){if(!this.encoder.isEmpty)return;const t=[81,1,this.pageNo,this.nextIndex,this.timestamp,this.url];this.writeType(t),this.writeFields(t),this.isEmpty=!0}writeWithSize(t){const i=this.encoder;if(!this.writeType(t)||!i.skip(3))return!1;const s=i.getCurrentOffset(),e=this.writeFields(t);if(e){const e=i.getCurrentOffset()-s;if(e>16777215)return console.warn("OpenReplay: max message size overflow."),!1;this.writeSizeAt(e,s-3),i.checkpoint(),this.isEmpty=this.isEmpty&&0===t[0],this.nextIndex++}return e}setBeaconSizeLimit(t){this.beaconSizeLimit=t}applyDict(t){const[i,s]=this.strDict.getKey(t);return s&&this.writeMessage([50,i,t]),i}writeMessage(t){0===t[0]&&(this.timestamp=t[1]),4===t[0]&&(this.url=t[1]),12===t[0]&&(t=[51,t[1],this.applyDict(t[2]),this.applyDict(t[3])]),this.writeWithSize(t)||(this.finaliseBatch(),this.writeWithSize(t)||(this.encoder=new s(this.beaconSizeLimit),this.prepare(),this.writeWithSize(t)?this.finaliseBatch():console.warn("OpenReplay: beacon size overflow. Skipping large message.",t,this),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,u=null;r.NotActive;let a=0;function c(){u&&u.finaliseBatch()}function o(){r.Stopping,null!==f&&(clearInterval(f),f=null),u&&(u.clean(),u=null),h&&(h.clean(),h=null),r.NotActive}function g(){postMessage("restart"),o()}let l,f=null;self.onmessage=({data:i})=>{if(null!=i){if("stop"===i)return c(),void o();if(!Array.isArray(i))return"start"===i.type?(r.Starting,h=new t(i.ingestPoint,()=>{g()},t=>{!function(t){postMessage({type:"failure",reason:t}),o()}(t)},i.connAttemptCount,i.connAttemptGap),u=new n(i.pageNo,i.timestamp,i.url,t=>h&&h.push(t)),null===f&&(f=setInterval(c,1e4)),r.Active):"auth"===i.type?h?u?(h.authorise(i.token),void(i.beaconSizeLimit&&u.setBeaconSizeLimit(i.beaconSizeLimit))):(console.debug("WebWorker: writer not initialised. Received auth."),void g()):(console.debug("WebWorker: sender not initialised. Received auth."),void g()):void 0;if(null!==u){const t=u;i.forEach(i=>{55===i[0]&&(i[1]?l=setTimeout(()=>g(),18e5):clearTimeout(l)),t.writeMessage(i)})}u||(postMessage("not_init"),0===a&&(a+=1,g()))}else c()};'], { type: 'text/javascript' })));
|
|
78
|
+
this.worker.onerror = (e) => {
|
|
79
|
+
this._debug('webworker_error', e);
|
|
80
|
+
};
|
|
81
|
+
this.worker.onmessage = ({ data }) => {
|
|
82
|
+
if (data === 'restart') {
|
|
83
|
+
this.stop(false);
|
|
84
|
+
this.start({}, true);
|
|
85
|
+
}
|
|
86
|
+
else if (data === 'not_init') {
|
|
87
|
+
console.warn('WebWorker: writer not initialised. Restarting tracker');
|
|
88
|
+
}
|
|
89
|
+
else if (data.type === 'failure') {
|
|
90
|
+
this.stop(false);
|
|
91
|
+
this._debug('worker_failed', data.reason);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
const alertWorker = () => {
|
|
95
|
+
if (this.worker) {
|
|
96
|
+
this.worker.postMessage(null);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
// keep better tactics, discard others?
|
|
100
|
+
this.attachEventListener(window, 'beforeunload', alertWorker, false);
|
|
101
|
+
this.attachEventListener(document.body, 'mouseleave', alertWorker, false, false);
|
|
102
|
+
// TODO: stop session after inactivity timeout (make configurable)
|
|
103
|
+
this.attachEventListener(document, 'visibilitychange', alertWorker, false);
|
|
104
|
+
}
|
|
105
|
+
catch (e) {
|
|
106
|
+
this._debug('worker_start', e);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
_debug(context, e) {
|
|
110
|
+
if (this.options.__debug_report_edp !== null) {
|
|
111
|
+
void fetch(this.options.__debug_report_edp, {
|
|
112
|
+
method: 'POST',
|
|
113
|
+
headers: { 'Content-Type': 'application/json' },
|
|
114
|
+
body: JSON.stringify({
|
|
115
|
+
context,
|
|
116
|
+
error: `${e}`,
|
|
117
|
+
}),
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
this.debug.error('OpenReplay error: ', context, e);
|
|
121
|
+
}
|
|
122
|
+
send(message, urgent = false) {
|
|
123
|
+
if (this.activityState === ActivityState.NotActive) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
// === Back compatibility with Fetch/Axios plugins ===
|
|
127
|
+
if (message[0] === 39 /* MType.Fetch */) {
|
|
128
|
+
this._usingOldFetchPlugin = true;
|
|
129
|
+
deprecationWarn('Fetch plugin', "'network' init option", '/installation/network-options');
|
|
130
|
+
deprecationWarn('Axios plugin', "'network' init option", '/installation/network-options');
|
|
131
|
+
}
|
|
132
|
+
if (this._usingOldFetchPlugin && message[0] === 21 /* MType.NetworkRequest */) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
// ====================================================
|
|
136
|
+
this.messages.push(message);
|
|
137
|
+
// TODO: commit on start if there were `urgent` sends;
|
|
138
|
+
// Clarify where urgent can be used for;
|
|
139
|
+
// Clarify workflow for each type of message in case it was sent before start
|
|
140
|
+
// (like Fetch before start; maybe add an option "preCapture: boolean" or sth alike)
|
|
141
|
+
// Careful: `this.delay` is equal to zero before start hense all Timestamp-s will have to be updated on start
|
|
142
|
+
if (this.activityState === ActivityState.Active && urgent) {
|
|
143
|
+
this.commit();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
commit() {
|
|
147
|
+
if (this.worker && this.messages.length) {
|
|
148
|
+
this.messages.unshift(Timestamp(this.timestamp()));
|
|
149
|
+
this.worker.postMessage(this.messages);
|
|
150
|
+
this.commitCallbacks.forEach((cb) => cb(this.messages));
|
|
151
|
+
this.messages.length = 0;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
timestamp() {
|
|
155
|
+
return now() + this.delay;
|
|
156
|
+
}
|
|
157
|
+
safe(fn) {
|
|
158
|
+
const app = this;
|
|
159
|
+
return function (...args) {
|
|
160
|
+
try {
|
|
161
|
+
fn.apply(this, args);
|
|
162
|
+
}
|
|
163
|
+
catch (e) {
|
|
164
|
+
app._debug('safe_fn_call', e);
|
|
165
|
+
// time: this.timestamp(),
|
|
166
|
+
// name: e.name,
|
|
167
|
+
// message: e.message,
|
|
168
|
+
// stack: e.stack
|
|
169
|
+
}
|
|
170
|
+
}; // TODO: correct typing
|
|
171
|
+
}
|
|
172
|
+
attachCommitCallback(cb) {
|
|
173
|
+
this.commitCallbacks.push(cb);
|
|
174
|
+
}
|
|
175
|
+
attachStartCallback(cb, useSafe = false) {
|
|
176
|
+
if (useSafe) {
|
|
177
|
+
cb = this.safe(cb);
|
|
178
|
+
}
|
|
179
|
+
this.startCallbacks.push(cb);
|
|
180
|
+
}
|
|
181
|
+
attachStopCallback(cb, useSafe = false) {
|
|
182
|
+
if (useSafe) {
|
|
183
|
+
cb = this.safe(cb);
|
|
184
|
+
}
|
|
185
|
+
this.stopCallbacks.push(cb);
|
|
186
|
+
}
|
|
187
|
+
// Use app.nodes.attachNodeListener for registered nodes instead
|
|
188
|
+
attachEventListener(target, type, listener, useSafe = true, useCapture = true) {
|
|
189
|
+
if (useSafe) {
|
|
190
|
+
listener = this.safe(listener);
|
|
191
|
+
}
|
|
192
|
+
this.attachStartCallback(() => target === null || target === void 0 ? void 0 : target.addEventListener(type, listener, useCapture), useSafe);
|
|
193
|
+
this.attachStopCallback(() => target === null || target === void 0 ? void 0 : target.removeEventListener(type, listener, useCapture), useSafe);
|
|
194
|
+
}
|
|
195
|
+
// TODO: full correct semantic
|
|
196
|
+
checkRequiredVersion(version) {
|
|
197
|
+
const reqVer = version.split(/[.-]/);
|
|
198
|
+
const ver = this.version.split(/[.-]/);
|
|
199
|
+
for (let i = 0; i < 3; i++) {
|
|
200
|
+
if (isNaN(Number(ver[i])) || isNaN(Number(reqVer[i]))) {
|
|
201
|
+
return false;
|
|
202
|
+
}
|
|
203
|
+
if (Number(ver[i]) > Number(reqVer[i])) {
|
|
204
|
+
return true;
|
|
205
|
+
}
|
|
206
|
+
if (Number(ver[i]) < Number(reqVer[i])) {
|
|
207
|
+
return false;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return true;
|
|
211
|
+
}
|
|
212
|
+
getTrackerInfo() {
|
|
213
|
+
return {
|
|
214
|
+
userUUID: this.localStorage.getItem(this.options.local_uuid_key),
|
|
215
|
+
projectKey: this.projectKey,
|
|
216
|
+
revID: this.revID,
|
|
217
|
+
trackerVersion: this.version,
|
|
218
|
+
isSnippet: this.options.__is_snippet,
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
getSessionInfo() {
|
|
222
|
+
return Object.assign(Object.assign({}, this.session.getInfo()), this.getTrackerInfo());
|
|
223
|
+
}
|
|
224
|
+
getSessionToken() {
|
|
225
|
+
return this.session.getSessionToken();
|
|
226
|
+
}
|
|
227
|
+
getSessionID() {
|
|
228
|
+
return this.session.getInfo().sessionID || undefined;
|
|
229
|
+
}
|
|
230
|
+
getSessionURL(options) {
|
|
231
|
+
const { projectID, sessionID, timestamp } = this.session.getInfo();
|
|
232
|
+
if (!projectID || !sessionID) {
|
|
233
|
+
this.debug.error('OpenReplay error: Unable to build session URL');
|
|
234
|
+
return undefined;
|
|
235
|
+
}
|
|
236
|
+
const ingest = this.options.ingestPoint;
|
|
237
|
+
const isSaas = /api\.openreplay\.com/.test(ingest);
|
|
238
|
+
const projectPath = isSaas ? 'https://openreplay.com/ingest' : ingest;
|
|
239
|
+
const url = projectPath.replace(/ingest$/, `${projectID}/session/${sessionID}`);
|
|
240
|
+
if (options === null || options === void 0 ? void 0 : options.withCurrentTime) {
|
|
241
|
+
const jumpTo = now() - timestamp;
|
|
242
|
+
return `${url}?jumpto=${jumpTo}`;
|
|
243
|
+
}
|
|
244
|
+
return url;
|
|
245
|
+
}
|
|
246
|
+
getHost() {
|
|
247
|
+
return new URL(this.options.ingestPoint).host;
|
|
248
|
+
}
|
|
249
|
+
getProjectKey() {
|
|
250
|
+
return this.projectKey;
|
|
251
|
+
}
|
|
252
|
+
getBaseHref() {
|
|
253
|
+
var _a, _b;
|
|
254
|
+
if (typeof this.options.resourceBaseHref === 'string') {
|
|
255
|
+
return this.options.resourceBaseHref;
|
|
256
|
+
}
|
|
257
|
+
else if (typeof this.options.resourceBaseHref === 'object') {
|
|
258
|
+
//TODO: switch between types
|
|
259
|
+
}
|
|
260
|
+
if (document.baseURI) {
|
|
261
|
+
return document.baseURI;
|
|
262
|
+
}
|
|
263
|
+
// IE only
|
|
264
|
+
return (((_b = (_a = document.head) === null || _a === void 0 ? void 0 : _a.getElementsByTagName('base')[0]) === null || _b === void 0 ? void 0 : _b.getAttribute('href')) ||
|
|
265
|
+
location.origin + location.pathname);
|
|
266
|
+
}
|
|
267
|
+
resolveResourceURL(resourceURL) {
|
|
268
|
+
const base = new URL(this.getBaseHref());
|
|
269
|
+
base.pathname += '/' + new URL(resourceURL).pathname;
|
|
270
|
+
base.pathname.replace(/\/+/g, '/');
|
|
271
|
+
return base.toString();
|
|
272
|
+
}
|
|
273
|
+
isServiceURL(url) {
|
|
274
|
+
return url.startsWith(this.options.ingestPoint);
|
|
275
|
+
}
|
|
276
|
+
active() {
|
|
277
|
+
return this.activityState === ActivityState.Active;
|
|
278
|
+
}
|
|
279
|
+
resetNextPageSession(flag) {
|
|
280
|
+
if (flag) {
|
|
281
|
+
this.sessionStorage.setItem(this.options.session_reset_key, 't');
|
|
282
|
+
}
|
|
283
|
+
else {
|
|
284
|
+
this.sessionStorage.removeItem(this.options.session_reset_key);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
_start(startOpts = {}, resetByWorker = false) {
|
|
288
|
+
if (!this.worker) {
|
|
289
|
+
return Promise.resolve(UnsuccessfulStart('No worker found: perhaps, CSP is not set.'));
|
|
290
|
+
}
|
|
291
|
+
if (this.activityState !== ActivityState.NotActive) {
|
|
292
|
+
return Promise.resolve(UnsuccessfulStart('OpenReplay: trying to call `start()` on the instance that has been started already.'));
|
|
293
|
+
}
|
|
294
|
+
this.activityState = ActivityState.Starting;
|
|
295
|
+
adjustTimeOrigin();
|
|
296
|
+
if (startOpts.sessionHash) {
|
|
297
|
+
this.session.applySessionHash(startOpts.sessionHash);
|
|
298
|
+
}
|
|
299
|
+
if (startOpts.forceNew) {
|
|
300
|
+
// Reset session metadata only if requested directly
|
|
301
|
+
this.session.reset();
|
|
302
|
+
}
|
|
303
|
+
this.session.assign({
|
|
304
|
+
// MBTODO: maybe it would make sense to `forceNew` if the `userID` was changed
|
|
305
|
+
userID: startOpts.userID,
|
|
306
|
+
metadata: startOpts.metadata,
|
|
307
|
+
});
|
|
308
|
+
const timestamp = now();
|
|
309
|
+
this.worker.postMessage({
|
|
310
|
+
type: 'start',
|
|
311
|
+
pageNo: this.session.incPageNo(),
|
|
312
|
+
ingestPoint: this.options.ingestPoint,
|
|
313
|
+
timestamp,
|
|
314
|
+
url: document.URL,
|
|
315
|
+
connAttemptCount: this.options.connAttemptCount,
|
|
316
|
+
connAttemptGap: this.options.connAttemptGap,
|
|
317
|
+
});
|
|
318
|
+
const lsReset = this.sessionStorage.getItem(this.options.session_reset_key) !== null;
|
|
319
|
+
this.sessionStorage.removeItem(this.options.session_reset_key);
|
|
320
|
+
const needNewSessionID = startOpts.forceNew || lsReset || resetByWorker;
|
|
321
|
+
return window
|
|
322
|
+
.fetch(this.options.ingestPoint + '/v1/web/start', {
|
|
323
|
+
method: 'POST',
|
|
324
|
+
headers: {
|
|
325
|
+
'Content-Type': 'application/json',
|
|
326
|
+
},
|
|
327
|
+
body: JSON.stringify(Object.assign(Object.assign({}, this.getTrackerInfo()), { timestamp, userID: this.session.getInfo().userID, token: needNewSessionID ? undefined : this.session.getSessionToken(), deviceMemory,
|
|
328
|
+
jsHeapSizeLimit })),
|
|
329
|
+
})
|
|
330
|
+
.then((r) => {
|
|
331
|
+
if (r.status === 200) {
|
|
332
|
+
return r.json();
|
|
333
|
+
}
|
|
334
|
+
else {
|
|
335
|
+
return r
|
|
336
|
+
.text()
|
|
337
|
+
.then((text) => text === CANCELED
|
|
338
|
+
? Promise.reject(CANCELED)
|
|
339
|
+
: Promise.reject(`Server error: ${r.status}. ${text}`));
|
|
340
|
+
}
|
|
341
|
+
})
|
|
342
|
+
.then((r) => {
|
|
343
|
+
if (!this.worker) {
|
|
344
|
+
return Promise.reject('no worker found after start request (this might not happen)');
|
|
345
|
+
}
|
|
346
|
+
if (this.activityState === ActivityState.NotActive) {
|
|
347
|
+
return Promise.reject('Tracker stopped during authorization');
|
|
348
|
+
}
|
|
349
|
+
const { token, userUUID, projectID, beaconSizeLimit, delay, // derived from token
|
|
350
|
+
sessionID, // derived from token
|
|
351
|
+
startTimestamp, // real startTS (server time), derived from sessionID
|
|
352
|
+
} = r;
|
|
353
|
+
if (typeof token !== 'string' ||
|
|
354
|
+
typeof userUUID !== 'string' ||
|
|
355
|
+
(typeof startTimestamp !== 'number' && typeof startTimestamp !== 'undefined') ||
|
|
356
|
+
typeof sessionID !== 'string' ||
|
|
357
|
+
typeof delay !== 'number' ||
|
|
358
|
+
(typeof beaconSizeLimit !== 'number' && typeof beaconSizeLimit !== 'undefined')) {
|
|
359
|
+
return Promise.reject(`Incorrect server response: ${JSON.stringify(r)}`);
|
|
360
|
+
}
|
|
361
|
+
this.delay = delay;
|
|
362
|
+
this.session.setSessionToken(token);
|
|
363
|
+
this.session.assign({
|
|
364
|
+
sessionID,
|
|
365
|
+
timestamp: startTimestamp || timestamp,
|
|
366
|
+
projectID,
|
|
367
|
+
});
|
|
368
|
+
// (Re)send Metadata for the case of a new session
|
|
369
|
+
Object.entries(this.session.getInfo().metadata).forEach(([key, value]) => this.send(Metadata(key, value)));
|
|
370
|
+
this.localStorage.setItem(this.options.local_uuid_key, userUUID);
|
|
371
|
+
this.worker.postMessage({
|
|
372
|
+
type: 'auth',
|
|
373
|
+
token,
|
|
374
|
+
beaconSizeLimit,
|
|
375
|
+
});
|
|
376
|
+
const onStartInfo = { sessionToken: token, userUUID, sessionID };
|
|
377
|
+
// TODO: start as early as possible (before receiving the token)
|
|
378
|
+
this.startCallbacks.forEach((cb) => cb(onStartInfo)); // MBTODO: callbacks after DOM "mounted" (observed)
|
|
379
|
+
this.observer.observe();
|
|
380
|
+
this.ticker.start();
|
|
381
|
+
this.activityState = ActivityState.Active;
|
|
382
|
+
this.notify.log('OpenReplay tracking started.');
|
|
383
|
+
// get rid of onStart ?
|
|
384
|
+
if (typeof this.options.onStart === 'function') {
|
|
385
|
+
this.options.onStart(onStartInfo);
|
|
386
|
+
}
|
|
387
|
+
return SuccessfulStart(onStartInfo);
|
|
388
|
+
})
|
|
389
|
+
.catch((reason) => {
|
|
390
|
+
this.stop();
|
|
391
|
+
this.session.reset();
|
|
392
|
+
if (reason === CANCELED) {
|
|
393
|
+
return UnsuccessfulStart(CANCELED);
|
|
394
|
+
}
|
|
395
|
+
this.notify.log('OpenReplay was unable to start. ', reason);
|
|
396
|
+
this._debug('session_start', reason);
|
|
397
|
+
return UnsuccessfulStart(START_ERROR);
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
start(...args) {
|
|
401
|
+
if (!document.hidden) {
|
|
402
|
+
return this._start(...args);
|
|
403
|
+
}
|
|
404
|
+
else {
|
|
405
|
+
return new Promise((resolve) => {
|
|
406
|
+
const onVisibilityChange = () => {
|
|
407
|
+
if (!document.hidden) {
|
|
408
|
+
document.removeEventListener('visibilitychange', onVisibilityChange);
|
|
409
|
+
resolve(this._start(...args));
|
|
410
|
+
}
|
|
411
|
+
};
|
|
412
|
+
document.addEventListener('visibilitychange', onVisibilityChange);
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
stop(stopWorker = true) {
|
|
417
|
+
if (this.activityState !== ActivityState.NotActive) {
|
|
418
|
+
try {
|
|
419
|
+
this.sanitizer.clear();
|
|
420
|
+
this.observer.disconnect();
|
|
421
|
+
this.nodes.clear();
|
|
422
|
+
this.ticker.stop();
|
|
423
|
+
this.stopCallbacks.forEach((cb) => cb());
|
|
424
|
+
this.notify.log('OpenReplay tracking stopped.');
|
|
425
|
+
if (this.worker && stopWorker) {
|
|
426
|
+
this.worker.postMessage('stop');
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
finally {
|
|
430
|
+
this.activityState = ActivityState.NotActive;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const LogLevel: {
|
|
2
|
+
readonly Verbose: 5;
|
|
3
|
+
readonly Log: 4;
|
|
4
|
+
readonly Warnings: 3;
|
|
5
|
+
readonly Errors: 2;
|
|
6
|
+
readonly Silent: 0;
|
|
7
|
+
};
|
|
8
|
+
type LogLevel = typeof LogLevel[keyof typeof LogLevel];
|
|
9
|
+
type CustomLevel = {
|
|
10
|
+
error: boolean;
|
|
11
|
+
warn: boolean;
|
|
12
|
+
log: boolean;
|
|
13
|
+
};
|
|
14
|
+
interface _Options {
|
|
15
|
+
level: LogLevel | CustomLevel;
|
|
16
|
+
messages?: number[];
|
|
17
|
+
}
|
|
18
|
+
export type Options = true | _Options | LogLevel;
|
|
19
|
+
export default class Logger {
|
|
20
|
+
private readonly options;
|
|
21
|
+
constructor(options?: Options);
|
|
22
|
+
log(...args: any): void;
|
|
23
|
+
warn(...args: any): void;
|
|
24
|
+
error(...args: any): void;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export const LogLevel = {
|
|
2
|
+
Verbose: 5,
|
|
3
|
+
Log: 4,
|
|
4
|
+
Warnings: 3,
|
|
5
|
+
Errors: 2,
|
|
6
|
+
Silent: 0,
|
|
7
|
+
};
|
|
8
|
+
function IsCustomLevel(l) {
|
|
9
|
+
return typeof l === 'object';
|
|
10
|
+
}
|
|
11
|
+
export default class Logger {
|
|
12
|
+
constructor(options = LogLevel.Silent) {
|
|
13
|
+
this.options =
|
|
14
|
+
options === true
|
|
15
|
+
? { level: LogLevel.Verbose }
|
|
16
|
+
: typeof options === 'number'
|
|
17
|
+
? { level: options }
|
|
18
|
+
: options;
|
|
19
|
+
}
|
|
20
|
+
log(...args) {
|
|
21
|
+
if (IsCustomLevel(this.options.level)
|
|
22
|
+
? this.options.level.log
|
|
23
|
+
: this.options.level >= LogLevel.Log) {
|
|
24
|
+
console.log(...args);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
warn(...args) {
|
|
28
|
+
if (IsCustomLevel(this.options.level)
|
|
29
|
+
? this.options.level.warn
|
|
30
|
+
: this.options.level >= LogLevel.Warnings) {
|
|
31
|
+
console.warn(...args);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
error(...args) {
|
|
35
|
+
if (IsCustomLevel(this.options.level)
|
|
36
|
+
? this.options.level.error
|
|
37
|
+
: this.options.level >= LogLevel.Errors) {
|
|
38
|
+
console.error(...args);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as Messages from '../common/messages.gen.js';
|
|
2
|
+
export { default, Type } from '../common/messages.gen.js';
|
|
3
|
+
export declare function Timestamp(timestamp: number): Messages.Timestamp;
|
|
4
|
+
export declare function SetPageLocation(url: string, referrer: string, navigationStart: number): Messages.SetPageLocation;
|
|
5
|
+
export declare function SetViewportSize(width: number, height: number): Messages.SetViewportSize;
|
|
6
|
+
export declare function SetViewportScroll(x: number, y: number): Messages.SetViewportScroll;
|
|
7
|
+
export declare function CreateDocument(): Messages.CreateDocument;
|
|
8
|
+
export declare function CreateElementNode(id: number, parentID: number, index: number, tag: string, svg: boolean): Messages.CreateElementNode;
|
|
9
|
+
export declare function CreateTextNode(id: number, parentID: number, index: number): Messages.CreateTextNode;
|
|
10
|
+
export declare function MoveNode(id: number, parentID: number, index: number): Messages.MoveNode;
|
|
11
|
+
export declare function RemoveNode(id: number): Messages.RemoveNode;
|
|
12
|
+
export declare function SetNodeAttribute(id: number, name: string, value: string): Messages.SetNodeAttribute;
|
|
13
|
+
export declare function RemoveNodeAttribute(id: number, name: string): Messages.RemoveNodeAttribute;
|
|
14
|
+
export declare function SetNodeData(id: number, data: string): Messages.SetNodeData;
|
|
15
|
+
export declare function SetNodeScroll(id: number, x: number, y: number): Messages.SetNodeScroll;
|
|
16
|
+
export declare function SetInputTarget(id: number, label: string): Messages.SetInputTarget;
|
|
17
|
+
export declare function SetInputValue(id: number, value: string, mask: number): Messages.SetInputValue;
|
|
18
|
+
export declare function SetInputChecked(id: number, checked: boolean): Messages.SetInputChecked;
|
|
19
|
+
export declare function MouseMove(x: number, y: number): Messages.MouseMove;
|
|
20
|
+
export declare function NetworkRequest(type: string, method: string, url: string, request: string, response: string, status: number, timestamp: number, duration: number): Messages.NetworkRequest;
|
|
21
|
+
export declare function ConsoleLog(level: string, value: string): Messages.ConsoleLog;
|
|
22
|
+
export declare function PageLoadTiming(requestStart: number, responseStart: number, responseEnd: number, domContentLoadedEventStart: number, domContentLoadedEventEnd: number, loadEventStart: number, loadEventEnd: number, firstPaint: number, firstContentfulPaint: number): Messages.PageLoadTiming;
|
|
23
|
+
export declare function PageRenderTiming(speedIndex: number, visuallyComplete: number, timeToInteractive: number): Messages.PageRenderTiming;
|
|
24
|
+
export declare function CustomEvent(name: string, payload: string): Messages.CustomEvent;
|
|
25
|
+
export declare function UserID(id: string): Messages.UserID;
|
|
26
|
+
export declare function UserAnonymousID(id: string): Messages.UserAnonymousID;
|
|
27
|
+
export declare function Metadata(key: string, value: string): Messages.Metadata;
|
|
28
|
+
export declare function CSSInsertRule(id: number, rule: string, index: number): Messages.CSSInsertRule;
|
|
29
|
+
export declare function CSSDeleteRule(id: number, index: number): Messages.CSSDeleteRule;
|
|
30
|
+
export declare function Fetch(method: string, url: string, request: string, response: string, status: number, timestamp: number, duration: number): Messages.Fetch;
|
|
31
|
+
export declare function Profiler(name: string, duration: number, args: string, result: string): Messages.Profiler;
|
|
32
|
+
export declare function OTable(key: string, value: string): Messages.OTable;
|
|
33
|
+
export declare function StateAction(type: string): Messages.StateAction;
|
|
34
|
+
export declare function Redux(action: string, state: string, duration: number): Messages.Redux;
|
|
35
|
+
export declare function Vuex(mutation: string, state: string): Messages.Vuex;
|
|
36
|
+
export declare function MobX(type: string, payload: string): Messages.MobX;
|
|
37
|
+
export declare function NgRx(action: string, state: string, duration: number): Messages.NgRx;
|
|
38
|
+
export declare function GraphQL(operationKind: string, operationName: string, variables: string, response: string): Messages.GraphQL;
|
|
39
|
+
export declare function PerformanceTrack(frames: number, ticks: number, totalJSHeapSize: number, usedJSHeapSize: number): Messages.PerformanceTrack;
|
|
40
|
+
export declare function StringDict(key: number, value: string): Messages.StringDict;
|
|
41
|
+
export declare function SetNodeAttributeDict(id: number, nameKey: number, valueKey: number): Messages.SetNodeAttributeDict;
|
|
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 LoadFontFace(parentID: number, family: string, source: string, descriptors: string): Messages.LoadFontFace;
|
|
46
|
+
export declare function SetNodeFocus(id: number): Messages.SetNodeFocus;
|
|
47
|
+
export declare function LongTask(timestamp: number, duration: number, context: number, containerType: number, containerSrc: string, containerId: string, containerName: string): Messages.LongTask;
|
|
48
|
+
export declare function SetNodeAttributeURLBased(id: number, name: string, value: string, baseURL: string): Messages.SetNodeAttributeURLBased;
|
|
49
|
+
export declare function SetCSSDataURLBased(id: number, data: string, baseURL: string): Messages.SetCSSDataURLBased;
|
|
50
|
+
export declare function TechnicalInfo(type: string, value: string): Messages.TechnicalInfo;
|
|
51
|
+
export declare function CustomIssue(name: string, payload: string): Messages.CustomIssue;
|
|
52
|
+
export declare function CSSInsertRuleURLBased(id: number, rule: string, index: number, baseURL: string): Messages.CSSInsertRuleURLBased;
|
|
53
|
+
export declare function MouseClick(id: number, hesitationTime: number, label: string, selector: string): Messages.MouseClick;
|
|
54
|
+
export declare function CreateIFrameDocument(frameID: number, id: number): Messages.CreateIFrameDocument;
|
|
55
|
+
export declare function AdoptedSSReplaceURLBased(sheetID: number, text: string, baseURL: string): Messages.AdoptedSSReplaceURLBased;
|
|
56
|
+
export declare function AdoptedSSInsertRuleURLBased(sheetID: number, rule: string, index: number, baseURL: string): Messages.AdoptedSSInsertRuleURLBased;
|
|
57
|
+
export declare function AdoptedSSDeleteRule(sheetID: number, index: number): Messages.AdoptedSSDeleteRule;
|
|
58
|
+
export declare function AdoptedSSAddOwner(sheetID: number, id: number): Messages.AdoptedSSAddOwner;
|
|
59
|
+
export declare function AdoptedSSRemoveOwner(sheetID: number, id: number): Messages.AdoptedSSRemoveOwner;
|
|
60
|
+
export declare function JSException(name: string, message: string, payload: string, metadata: string): Messages.JSException;
|
|
61
|
+
export declare function Zustand(mutation: string, state: string): Messages.Zustand;
|
|
62
|
+
export declare function BatchMetadata(version: number, pageNo: number, firstIndex: number, timestamp: number, location: string): Messages.BatchMetadata;
|
|
63
|
+
export declare function PartitionedMessage(partNo: number, partTotal: number): Messages.PartitionedMessage;
|