@openreplay/tracker 4.1.11 → 5.0.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 +3 -0
- package/CHANGELOG.md +20 -0
- package/README.md +22 -18
- package/cjs/app/guards.d.ts +11 -12
- package/cjs/app/guards.js +2 -1
- package/cjs/app/index.d.ts +11 -8
- package/cjs/app/index.js +27 -8
- package/cjs/app/logger.d.ts +3 -3
- package/cjs/app/messages.gen.d.ts +8 -6
- package/cjs/app/messages.gen.js +116 -94
- package/cjs/app/nodes.d.ts +1 -1
- package/cjs/app/observer/iframe_offsets.d.ts +1 -1
- package/cjs/app/observer/observer.js +5 -5
- package/cjs/app/observer/top_observer.d.ts +2 -2
- package/cjs/app/observer/top_observer.js +1 -1
- package/cjs/app/session.d.ts +2 -2
- package/cjs/app/ticker.d.ts +1 -1
- package/cjs/common/interaction.d.ts +5 -5
- package/cjs/common/messages.gen.d.ts +104 -86
- package/cjs/index.d.ts +6 -2
- package/cjs/index.js +7 -5
- package/cjs/modules/cssrules.js +1 -1
- package/cjs/modules/focus.js +2 -2
- package/cjs/modules/fonts.js +2 -2
- package/cjs/modules/img.js +6 -5
- package/cjs/modules/input.d.ts +1 -1
- package/cjs/modules/input.js +15 -23
- package/cjs/modules/mouse.js +1 -1
- package/cjs/modules/network.d.ts +28 -0
- package/cjs/modules/network.js +203 -0
- package/cjs/modules/timing.js +7 -3
- package/cjs/modules/viewport.js +3 -1
- package/cjs/vendors/finder/finder.d.ts +1 -1
- package/jest.config.js +11 -0
- package/lib/app/guards.d.ts +11 -12
- package/lib/app/guards.js +2 -1
- package/lib/app/index.d.ts +11 -8
- package/lib/app/index.js +28 -9
- package/lib/app/logger.d.ts +3 -3
- package/lib/app/messages.gen.d.ts +8 -6
- package/lib/app/messages.gen.js +107 -87
- package/lib/app/nodes.d.ts +1 -1
- package/lib/app/observer/iframe_offsets.d.ts +1 -1
- package/lib/app/observer/observer.js +5 -5
- package/lib/app/observer/top_observer.d.ts +2 -2
- package/lib/app/observer/top_observer.js +1 -1
- package/lib/app/session.d.ts +2 -2
- package/lib/app/ticker.d.ts +1 -1
- package/lib/common/interaction.d.ts +5 -5
- package/lib/common/messages.gen.d.ts +104 -86
- package/lib/common/tsconfig.tsbuildinfo +1 -1
- package/lib/index.d.ts +6 -2
- package/lib/index.js +8 -6
- package/lib/modules/cssrules.js +1 -1
- package/lib/modules/focus.js +2 -2
- package/lib/modules/fonts.js +2 -2
- package/lib/modules/img.js +6 -5
- package/lib/modules/input.d.ts +1 -1
- package/lib/modules/input.js +15 -23
- package/lib/modules/mouse.js +1 -1
- package/lib/modules/network.d.ts +28 -0
- package/lib/modules/network.js +200 -0
- package/lib/modules/timing.js +8 -4
- package/lib/modules/viewport.js +3 -1
- package/lib/vendors/finder/finder.d.ts +1 -1
- package/package.json +8 -3
- package/tsconfig-base.json +2 -1
- package/cjs/app/messages.d.ts +0 -52
- package/cjs/app/messages.js +0 -234
- package/lib/app/messages.d.ts +0 -52
- package/lib/app/messages.js +0 -181
|
@@ -3,22 +3,22 @@ export interface Options {
|
|
|
3
3
|
connAttemptCount?: number;
|
|
4
4
|
connAttemptGap?: number;
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
type Start = {
|
|
7
7
|
type: 'start';
|
|
8
8
|
ingestPoint: string;
|
|
9
9
|
pageNo: number;
|
|
10
10
|
timestamp: number;
|
|
11
11
|
url: string;
|
|
12
12
|
} & Options;
|
|
13
|
-
|
|
13
|
+
type Auth = {
|
|
14
14
|
type: 'auth';
|
|
15
15
|
token: string;
|
|
16
16
|
beaconSizeLimit?: number;
|
|
17
17
|
};
|
|
18
|
-
export
|
|
19
|
-
|
|
18
|
+
export type ToWorkerData = null | 'stop' | Start | Auth | Array<Message>;
|
|
19
|
+
type Failure = {
|
|
20
20
|
type: 'failure';
|
|
21
21
|
reason: string;
|
|
22
22
|
};
|
|
23
|
-
export
|
|
23
|
+
export type FromWorkerData = 'restart' | Failure | 'not_init';
|
|
24
24
|
export {};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
export declare const enum Type {
|
|
2
|
-
BatchMetadata = 81,
|
|
3
|
-
PartitionedMessage = 82,
|
|
4
2
|
Timestamp = 0,
|
|
5
3
|
SetPageLocation = 4,
|
|
6
4
|
SetViewportSize = 5,
|
|
@@ -18,11 +16,11 @@ export declare const enum Type {
|
|
|
18
16
|
SetInputValue = 18,
|
|
19
17
|
SetInputChecked = 19,
|
|
20
18
|
MouseMove = 20,
|
|
19
|
+
NetworkRequest = 21,
|
|
21
20
|
ConsoleLog = 22,
|
|
22
21
|
PageLoadTiming = 23,
|
|
23
22
|
PageRenderTiming = 24,
|
|
24
|
-
|
|
25
|
-
RawCustomEvent = 27,
|
|
23
|
+
CustomEvent = 27,
|
|
26
24
|
UserID = 28,
|
|
27
25
|
UserAnonymousID = 29,
|
|
28
26
|
Metadata = 30,
|
|
@@ -38,6 +36,8 @@ export declare const enum Type {
|
|
|
38
36
|
NgRx = 47,
|
|
39
37
|
GraphQL = 48,
|
|
40
38
|
PerformanceTrack = 49,
|
|
39
|
+
StringDict = 50,
|
|
40
|
+
SetNodeAttributeDict = 51,
|
|
41
41
|
ResourceTiming = 53,
|
|
42
42
|
ConnectionInformation = 54,
|
|
43
43
|
SetPageVisibility = 55,
|
|
@@ -56,46 +56,35 @@ export declare const enum Type {
|
|
|
56
56
|
AdoptedSSDeleteRule = 75,
|
|
57
57
|
AdoptedSSAddOwner = 76,
|
|
58
58
|
AdoptedSSRemoveOwner = 77,
|
|
59
|
+
JSException = 78,
|
|
59
60
|
Zustand = 79,
|
|
60
|
-
|
|
61
|
+
BatchMetadata = 81,
|
|
62
|
+
PartitionedMessage = 82
|
|
61
63
|
}
|
|
62
|
-
export
|
|
63
|
-
Type.BatchMetadata,
|
|
64
|
-
number,
|
|
65
|
-
number,
|
|
66
|
-
number,
|
|
67
|
-
number,
|
|
68
|
-
string
|
|
69
|
-
];
|
|
70
|
-
export declare type PartitionedMessage = [
|
|
71
|
-
Type.PartitionedMessage,
|
|
72
|
-
number,
|
|
73
|
-
number
|
|
74
|
-
];
|
|
75
|
-
export declare type Timestamp = [
|
|
64
|
+
export type Timestamp = [
|
|
76
65
|
Type.Timestamp,
|
|
77
66
|
number
|
|
78
67
|
];
|
|
79
|
-
export
|
|
68
|
+
export type SetPageLocation = [
|
|
80
69
|
Type.SetPageLocation,
|
|
81
70
|
string,
|
|
82
71
|
string,
|
|
83
72
|
number
|
|
84
73
|
];
|
|
85
|
-
export
|
|
74
|
+
export type SetViewportSize = [
|
|
86
75
|
Type.SetViewportSize,
|
|
87
76
|
number,
|
|
88
77
|
number
|
|
89
78
|
];
|
|
90
|
-
export
|
|
79
|
+
export type SetViewportScroll = [
|
|
91
80
|
Type.SetViewportScroll,
|
|
92
81
|
number,
|
|
93
82
|
number
|
|
94
83
|
];
|
|
95
|
-
export
|
|
84
|
+
export type CreateDocument = [
|
|
96
85
|
Type.CreateDocument
|
|
97
86
|
];
|
|
98
|
-
export
|
|
87
|
+
export type CreateElementNode = [
|
|
99
88
|
Type.CreateElementNode,
|
|
100
89
|
number,
|
|
101
90
|
number,
|
|
@@ -103,71 +92,82 @@ export declare type CreateElementNode = [
|
|
|
103
92
|
string,
|
|
104
93
|
boolean
|
|
105
94
|
];
|
|
106
|
-
export
|
|
95
|
+
export type CreateTextNode = [
|
|
107
96
|
Type.CreateTextNode,
|
|
108
97
|
number,
|
|
109
98
|
number,
|
|
110
99
|
number
|
|
111
100
|
];
|
|
112
|
-
export
|
|
101
|
+
export type MoveNode = [
|
|
113
102
|
Type.MoveNode,
|
|
114
103
|
number,
|
|
115
104
|
number,
|
|
116
105
|
number
|
|
117
106
|
];
|
|
118
|
-
export
|
|
107
|
+
export type RemoveNode = [
|
|
119
108
|
Type.RemoveNode,
|
|
120
109
|
number
|
|
121
110
|
];
|
|
122
|
-
export
|
|
111
|
+
export type SetNodeAttribute = [
|
|
123
112
|
Type.SetNodeAttribute,
|
|
124
113
|
number,
|
|
125
114
|
string,
|
|
126
115
|
string
|
|
127
116
|
];
|
|
128
|
-
export
|
|
117
|
+
export type RemoveNodeAttribute = [
|
|
129
118
|
Type.RemoveNodeAttribute,
|
|
130
119
|
number,
|
|
131
120
|
string
|
|
132
121
|
];
|
|
133
|
-
export
|
|
122
|
+
export type SetNodeData = [
|
|
134
123
|
Type.SetNodeData,
|
|
135
124
|
number,
|
|
136
125
|
string
|
|
137
126
|
];
|
|
138
|
-
export
|
|
127
|
+
export type SetNodeScroll = [
|
|
139
128
|
Type.SetNodeScroll,
|
|
140
129
|
number,
|
|
141
130
|
number,
|
|
142
131
|
number
|
|
143
132
|
];
|
|
144
|
-
export
|
|
133
|
+
export type SetInputTarget = [
|
|
145
134
|
Type.SetInputTarget,
|
|
146
135
|
number,
|
|
147
136
|
string
|
|
148
137
|
];
|
|
149
|
-
export
|
|
138
|
+
export type SetInputValue = [
|
|
150
139
|
Type.SetInputValue,
|
|
151
140
|
number,
|
|
152
141
|
string,
|
|
153
142
|
number
|
|
154
143
|
];
|
|
155
|
-
export
|
|
144
|
+
export type SetInputChecked = [
|
|
156
145
|
Type.SetInputChecked,
|
|
157
146
|
number,
|
|
158
147
|
boolean
|
|
159
148
|
];
|
|
160
|
-
export
|
|
149
|
+
export type MouseMove = [
|
|
161
150
|
Type.MouseMove,
|
|
162
151
|
number,
|
|
163
152
|
number
|
|
164
153
|
];
|
|
165
|
-
export
|
|
154
|
+
export type NetworkRequest = [
|
|
155
|
+
Type.NetworkRequest,
|
|
156
|
+
string,
|
|
157
|
+
string,
|
|
158
|
+
string,
|
|
159
|
+
string,
|
|
160
|
+
string,
|
|
161
|
+
number,
|
|
162
|
+
number,
|
|
163
|
+
number
|
|
164
|
+
];
|
|
165
|
+
export type ConsoleLog = [
|
|
166
166
|
Type.ConsoleLog,
|
|
167
167
|
string,
|
|
168
168
|
string
|
|
169
169
|
];
|
|
170
|
-
export
|
|
170
|
+
export type PageLoadTiming = [
|
|
171
171
|
Type.PageLoadTiming,
|
|
172
172
|
number,
|
|
173
173
|
number,
|
|
@@ -179,48 +179,42 @@ export declare type PageLoadTiming = [
|
|
|
179
179
|
number,
|
|
180
180
|
number
|
|
181
181
|
];
|
|
182
|
-
export
|
|
182
|
+
export type PageRenderTiming = [
|
|
183
183
|
Type.PageRenderTiming,
|
|
184
184
|
number,
|
|
185
185
|
number,
|
|
186
186
|
number
|
|
187
187
|
];
|
|
188
|
-
export
|
|
189
|
-
Type.
|
|
190
|
-
string,
|
|
191
|
-
string,
|
|
192
|
-
string
|
|
193
|
-
];
|
|
194
|
-
export declare type RawCustomEvent = [
|
|
195
|
-
Type.RawCustomEvent,
|
|
188
|
+
export type CustomEvent = [
|
|
189
|
+
Type.CustomEvent,
|
|
196
190
|
string,
|
|
197
191
|
string
|
|
198
192
|
];
|
|
199
|
-
export
|
|
193
|
+
export type UserID = [
|
|
200
194
|
Type.UserID,
|
|
201
195
|
string
|
|
202
196
|
];
|
|
203
|
-
export
|
|
197
|
+
export type UserAnonymousID = [
|
|
204
198
|
Type.UserAnonymousID,
|
|
205
199
|
string
|
|
206
200
|
];
|
|
207
|
-
export
|
|
201
|
+
export type Metadata = [
|
|
208
202
|
Type.Metadata,
|
|
209
203
|
string,
|
|
210
204
|
string
|
|
211
205
|
];
|
|
212
|
-
export
|
|
206
|
+
export type CSSInsertRule = [
|
|
213
207
|
Type.CSSInsertRule,
|
|
214
208
|
number,
|
|
215
209
|
string,
|
|
216
210
|
number
|
|
217
211
|
];
|
|
218
|
-
export
|
|
212
|
+
export type CSSDeleteRule = [
|
|
219
213
|
Type.CSSDeleteRule,
|
|
220
214
|
number,
|
|
221
215
|
number
|
|
222
216
|
];
|
|
223
|
-
export
|
|
217
|
+
export type Fetch = [
|
|
224
218
|
Type.Fetch,
|
|
225
219
|
string,
|
|
226
220
|
string,
|
|
@@ -230,59 +224,70 @@ export declare type Fetch = [
|
|
|
230
224
|
number,
|
|
231
225
|
number
|
|
232
226
|
];
|
|
233
|
-
export
|
|
227
|
+
export type Profiler = [
|
|
234
228
|
Type.Profiler,
|
|
235
229
|
string,
|
|
236
230
|
number,
|
|
237
231
|
string,
|
|
238
232
|
string
|
|
239
233
|
];
|
|
240
|
-
export
|
|
234
|
+
export type OTable = [
|
|
241
235
|
Type.OTable,
|
|
242
236
|
string,
|
|
243
237
|
string
|
|
244
238
|
];
|
|
245
|
-
export
|
|
239
|
+
export type StateAction = [
|
|
246
240
|
Type.StateAction,
|
|
247
241
|
string
|
|
248
242
|
];
|
|
249
|
-
export
|
|
243
|
+
export type Redux = [
|
|
250
244
|
Type.Redux,
|
|
251
245
|
string,
|
|
252
246
|
string,
|
|
253
247
|
number
|
|
254
248
|
];
|
|
255
|
-
export
|
|
249
|
+
export type Vuex = [
|
|
256
250
|
Type.Vuex,
|
|
257
251
|
string,
|
|
258
252
|
string
|
|
259
253
|
];
|
|
260
|
-
export
|
|
254
|
+
export type MobX = [
|
|
261
255
|
Type.MobX,
|
|
262
256
|
string,
|
|
263
257
|
string
|
|
264
258
|
];
|
|
265
|
-
export
|
|
259
|
+
export type NgRx = [
|
|
266
260
|
Type.NgRx,
|
|
267
261
|
string,
|
|
268
262
|
string,
|
|
269
263
|
number
|
|
270
264
|
];
|
|
271
|
-
export
|
|
265
|
+
export type GraphQL = [
|
|
272
266
|
Type.GraphQL,
|
|
273
267
|
string,
|
|
274
268
|
string,
|
|
275
269
|
string,
|
|
276
270
|
string
|
|
277
271
|
];
|
|
278
|
-
export
|
|
272
|
+
export type PerformanceTrack = [
|
|
279
273
|
Type.PerformanceTrack,
|
|
280
274
|
number,
|
|
281
275
|
number,
|
|
282
276
|
number,
|
|
283
277
|
number
|
|
284
278
|
];
|
|
285
|
-
export
|
|
279
|
+
export type StringDict = [
|
|
280
|
+
Type.StringDict,
|
|
281
|
+
number,
|
|
282
|
+
string
|
|
283
|
+
];
|
|
284
|
+
export type SetNodeAttributeDict = [
|
|
285
|
+
Type.SetNodeAttributeDict,
|
|
286
|
+
number,
|
|
287
|
+
number,
|
|
288
|
+
number
|
|
289
|
+
];
|
|
290
|
+
export type ResourceTiming = [
|
|
286
291
|
Type.ResourceTiming,
|
|
287
292
|
number,
|
|
288
293
|
number,
|
|
@@ -293,27 +298,27 @@ export declare type ResourceTiming = [
|
|
|
293
298
|
string,
|
|
294
299
|
string
|
|
295
300
|
];
|
|
296
|
-
export
|
|
301
|
+
export type ConnectionInformation = [
|
|
297
302
|
Type.ConnectionInformation,
|
|
298
303
|
number,
|
|
299
304
|
string
|
|
300
305
|
];
|
|
301
|
-
export
|
|
306
|
+
export type SetPageVisibility = [
|
|
302
307
|
Type.SetPageVisibility,
|
|
303
308
|
boolean
|
|
304
309
|
];
|
|
305
|
-
export
|
|
310
|
+
export type LoadFontFace = [
|
|
306
311
|
Type.LoadFontFace,
|
|
307
312
|
number,
|
|
308
313
|
string,
|
|
309
314
|
string,
|
|
310
315
|
string
|
|
311
316
|
];
|
|
312
|
-
export
|
|
317
|
+
export type SetNodeFocus = [
|
|
313
318
|
Type.SetNodeFocus,
|
|
314
319
|
number
|
|
315
320
|
];
|
|
316
|
-
export
|
|
321
|
+
export type LongTask = [
|
|
317
322
|
Type.LongTask,
|
|
318
323
|
number,
|
|
319
324
|
number,
|
|
@@ -323,87 +328,100 @@ export declare type LongTask = [
|
|
|
323
328
|
string,
|
|
324
329
|
string
|
|
325
330
|
];
|
|
326
|
-
export
|
|
331
|
+
export type SetNodeAttributeURLBased = [
|
|
327
332
|
Type.SetNodeAttributeURLBased,
|
|
328
333
|
number,
|
|
329
334
|
string,
|
|
330
335
|
string,
|
|
331
336
|
string
|
|
332
337
|
];
|
|
333
|
-
export
|
|
338
|
+
export type SetCSSDataURLBased = [
|
|
334
339
|
Type.SetCSSDataURLBased,
|
|
335
340
|
number,
|
|
336
341
|
string,
|
|
337
342
|
string
|
|
338
343
|
];
|
|
339
|
-
export
|
|
344
|
+
export type TechnicalInfo = [
|
|
340
345
|
Type.TechnicalInfo,
|
|
341
346
|
string,
|
|
342
347
|
string
|
|
343
348
|
];
|
|
344
|
-
export
|
|
349
|
+
export type CustomIssue = [
|
|
345
350
|
Type.CustomIssue,
|
|
346
351
|
string,
|
|
347
352
|
string
|
|
348
353
|
];
|
|
349
|
-
export
|
|
354
|
+
export type CSSInsertRuleURLBased = [
|
|
350
355
|
Type.CSSInsertRuleURLBased,
|
|
351
356
|
number,
|
|
352
357
|
string,
|
|
353
358
|
number,
|
|
354
359
|
string
|
|
355
360
|
];
|
|
356
|
-
export
|
|
361
|
+
export type MouseClick = [
|
|
357
362
|
Type.MouseClick,
|
|
358
363
|
number,
|
|
359
364
|
number,
|
|
360
365
|
string,
|
|
361
366
|
string
|
|
362
367
|
];
|
|
363
|
-
export
|
|
368
|
+
export type CreateIFrameDocument = [
|
|
364
369
|
Type.CreateIFrameDocument,
|
|
365
370
|
number,
|
|
366
371
|
number
|
|
367
372
|
];
|
|
368
|
-
export
|
|
373
|
+
export type AdoptedSSReplaceURLBased = [
|
|
369
374
|
Type.AdoptedSSReplaceURLBased,
|
|
370
375
|
number,
|
|
371
376
|
string,
|
|
372
377
|
string
|
|
373
378
|
];
|
|
374
|
-
export
|
|
379
|
+
export type AdoptedSSInsertRuleURLBased = [
|
|
375
380
|
Type.AdoptedSSInsertRuleURLBased,
|
|
376
381
|
number,
|
|
377
382
|
string,
|
|
378
383
|
number,
|
|
379
384
|
string
|
|
380
385
|
];
|
|
381
|
-
export
|
|
386
|
+
export type AdoptedSSDeleteRule = [
|
|
382
387
|
Type.AdoptedSSDeleteRule,
|
|
383
388
|
number,
|
|
384
389
|
number
|
|
385
390
|
];
|
|
386
|
-
export
|
|
391
|
+
export type AdoptedSSAddOwner = [
|
|
387
392
|
Type.AdoptedSSAddOwner,
|
|
388
393
|
number,
|
|
389
394
|
number
|
|
390
395
|
];
|
|
391
|
-
export
|
|
396
|
+
export type AdoptedSSRemoveOwner = [
|
|
392
397
|
Type.AdoptedSSRemoveOwner,
|
|
393
398
|
number,
|
|
394
399
|
number
|
|
395
400
|
];
|
|
396
|
-
export
|
|
397
|
-
Type.Zustand,
|
|
398
|
-
string,
|
|
399
|
-
string
|
|
400
|
-
];
|
|
401
|
-
export declare type JSException = [
|
|
401
|
+
export type JSException = [
|
|
402
402
|
Type.JSException,
|
|
403
403
|
string,
|
|
404
404
|
string,
|
|
405
405
|
string,
|
|
406
406
|
string
|
|
407
407
|
];
|
|
408
|
-
|
|
408
|
+
export type Zustand = [
|
|
409
|
+
Type.Zustand,
|
|
410
|
+
string,
|
|
411
|
+
string
|
|
412
|
+
];
|
|
413
|
+
export type BatchMetadata = [
|
|
414
|
+
Type.BatchMetadata,
|
|
415
|
+
number,
|
|
416
|
+
number,
|
|
417
|
+
number,
|
|
418
|
+
number,
|
|
419
|
+
string
|
|
420
|
+
];
|
|
421
|
+
export type PartitionedMessage = [
|
|
422
|
+
Type.PartitionedMessage,
|
|
423
|
+
number,
|
|
424
|
+
number
|
|
425
|
+
];
|
|
426
|
+
type Message = Timestamp | SetPageLocation | SetViewportSize | SetViewportScroll | CreateDocument | CreateElementNode | CreateTextNode | MoveNode | RemoveNode | SetNodeAttribute | RemoveNodeAttribute | SetNodeData | SetNodeScroll | SetInputTarget | SetInputValue | SetInputChecked | MouseMove | NetworkRequest | ConsoleLog | PageLoadTiming | PageRenderTiming | CustomEvent | UserID | UserAnonymousID | Metadata | CSSInsertRule | CSSDeleteRule | Fetch | Profiler | OTable | StateAction | Redux | Vuex | MobX | NgRx | GraphQL | PerformanceTrack | StringDict | SetNodeAttributeDict | ResourceTiming | ConnectionInformation | SetPageVisibility | LoadFontFace | SetNodeFocus | LongTask | SetNodeAttributeURLBased | SetCSSDataURLBased | TechnicalInfo | CustomIssue | CSSInsertRuleURLBased | MouseClick | CreateIFrameDocument | AdoptedSSReplaceURLBased | AdoptedSSInsertRuleURLBased | AdoptedSSDeleteRule | AdoptedSSAddOwner | AdoptedSSRemoveOwner | JSException | Zustand | BatchMetadata | PartitionedMessage;
|
|
409
427
|
export default Message;
|
package/cjs/index.d.ts
CHANGED
|
@@ -9,14 +9,16 @@ import type { Options as ExceptionOptions } from './modules/exception.js';
|
|
|
9
9
|
import type { Options as InputOptions } from './modules/input.js';
|
|
10
10
|
import type { Options as PerformanceOptions } from './modules/performance.js';
|
|
11
11
|
import type { Options as TimingOptions } from './modules/timing.js';
|
|
12
|
+
import type { Options as NetworkOptions } from './modules/network.js';
|
|
12
13
|
import type { StartOptions } from './app/index.js';
|
|
13
14
|
import type { StartPromiseReturn } from './app/index.js';
|
|
14
|
-
export
|
|
15
|
+
export type Options = Partial<AppOptions & ConsoleOptions & ExceptionOptions & InputOptions & PerformanceOptions & TimingOptions> & {
|
|
15
16
|
projectID?: number;
|
|
16
17
|
projectKey: string;
|
|
17
18
|
sessionToken?: string;
|
|
18
19
|
respectDoNotTrack?: boolean;
|
|
19
20
|
autoResetOnWindowOpen?: boolean;
|
|
21
|
+
network?: NetworkOptions;
|
|
20
22
|
__DISABLE_SECURE_MODE?: boolean;
|
|
21
23
|
};
|
|
22
24
|
export default class API {
|
|
@@ -30,7 +32,9 @@ export default class API {
|
|
|
30
32
|
getSessionToken(): string | null | undefined;
|
|
31
33
|
getSessionID(): string | null | undefined;
|
|
32
34
|
sessionID(): string | null | undefined;
|
|
33
|
-
getSessionURL(
|
|
35
|
+
getSessionURL(options?: {
|
|
36
|
+
withCurrentTime?: boolean;
|
|
37
|
+
}): string | undefined;
|
|
34
38
|
setUserID(id: string): void;
|
|
35
39
|
userID(id: string): void;
|
|
36
40
|
setUserAnonymousID(id: string): void;
|
package/cjs/index.js
CHANGED
|
@@ -22,9 +22,10 @@ const viewport_js_1 = require("./modules/viewport.js");
|
|
|
22
22
|
const cssrules_js_1 = require("./modules/cssrules.js");
|
|
23
23
|
const focus_js_1 = require("./modules/focus.js");
|
|
24
24
|
const fonts_js_1 = require("./modules/fonts.js");
|
|
25
|
+
const network_js_1 = require("./modules/network.js");
|
|
25
26
|
const constructedStyleSheets_js_1 = require("./modules/constructedStyleSheets.js");
|
|
26
27
|
const utils_js_1 = require("./utils.js");
|
|
27
|
-
const DOCS_SETUP = '/installation/
|
|
28
|
+
const DOCS_SETUP = '/installation/javascript-sdk';
|
|
28
29
|
function processOptions(obj) {
|
|
29
30
|
if (obj == null) {
|
|
30
31
|
console.error(`OpenReplay: invalid options argument type. Please, check documentation on ${utils_js_1.DOCS_HOST}${DOCS_SETUP}`);
|
|
@@ -114,6 +115,7 @@ class API {
|
|
|
114
115
|
(0, scroll_js_1.default)(app);
|
|
115
116
|
(0, focus_js_1.default)(app);
|
|
116
117
|
(0, fonts_js_1.default)(app);
|
|
118
|
+
(0, network_js_1.default)(app, options.network);
|
|
117
119
|
window.__OPENREPLAY__ = this;
|
|
118
120
|
if (options.autoResetOnWindowOpen) {
|
|
119
121
|
const wOpen = window.open;
|
|
@@ -138,7 +140,7 @@ class API {
|
|
|
138
140
|
// no-cors issue only with text/plain or not-set Content-Type
|
|
139
141
|
// req.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
|
|
140
142
|
req.send(JSON.stringify({
|
|
141
|
-
trackerVersion: '
|
|
143
|
+
trackerVersion: '5.0.0',
|
|
142
144
|
projectKey: options.projectKey,
|
|
143
145
|
doNotTrack,
|
|
144
146
|
// TODO: add precise reason (an exact API missing)
|
|
@@ -188,11 +190,11 @@ class API {
|
|
|
188
190
|
(0, utils_js_1.deprecationWarn)("'sessionID' method", "'getSessionID' method", '/');
|
|
189
191
|
return this.getSessionID();
|
|
190
192
|
}
|
|
191
|
-
getSessionURL() {
|
|
193
|
+
getSessionURL(options) {
|
|
192
194
|
if (this.app === null) {
|
|
193
195
|
return undefined;
|
|
194
196
|
}
|
|
195
|
-
return this.app.getSessionURL();
|
|
197
|
+
return this.app.getSessionURL(options);
|
|
196
198
|
}
|
|
197
199
|
setUserID(id) {
|
|
198
200
|
if (typeof id === 'string' && this.app !== null) {
|
|
@@ -233,7 +235,7 @@ class API {
|
|
|
233
235
|
catch (e) {
|
|
234
236
|
return;
|
|
235
237
|
}
|
|
236
|
-
this.app.send((0, messages_gen_js_1.
|
|
238
|
+
this.app.send((0, messages_gen_js_1.CustomEvent)(key, payload));
|
|
237
239
|
}
|
|
238
240
|
}
|
|
239
241
|
}
|
package/cjs/modules/cssrules.js
CHANGED
|
@@ -76,7 +76,7 @@ function default_1(app) {
|
|
|
76
76
|
patchContext(window);
|
|
77
77
|
app.observer.attachContextCallback(patchContext);
|
|
78
78
|
app.nodes.attachNodeCallback((node) => {
|
|
79
|
-
if (!(
|
|
79
|
+
if (!(0, guards_js_1.hasTag)(node, 'style') || !node.sheet) {
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
82
|
if (node.textContent !== null && node.textContent.trim().length > 0) {
|
package/cjs/modules/focus.js
CHANGED
|
@@ -11,7 +11,7 @@ function default_1(app) {
|
|
|
11
11
|
}
|
|
12
12
|
let blurred = false;
|
|
13
13
|
app.nodes.attachNodeCallback((node) => {
|
|
14
|
-
if (!(0, guards_js_1.hasTag)(node, '
|
|
14
|
+
if (!(0, guards_js_1.hasTag)(node, 'body')) {
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
17
17
|
app.nodes.attachNodeListener(node, 'focus', (e) => {
|
|
@@ -34,7 +34,7 @@ function default_1(app) {
|
|
|
34
34
|
});
|
|
35
35
|
app.attachStartCallback(() => {
|
|
36
36
|
let elem = document.activeElement;
|
|
37
|
-
while (elem && (0, guards_js_1.hasTag)(elem, '
|
|
37
|
+
while (elem && (0, guards_js_1.hasTag)(elem, 'iframe') && elem.contentDocument) {
|
|
38
38
|
elem = elem.contentDocument.activeElement;
|
|
39
39
|
}
|
|
40
40
|
if (elem && elem !== elem.ownerDocument.body) {
|
package/cjs/modules/fonts.js
CHANGED
|
@@ -37,7 +37,7 @@ function default_1(app) {
|
|
|
37
37
|
};
|
|
38
38
|
app.observer.attachContextCallback(patchWindow);
|
|
39
39
|
patchWindow(window);
|
|
40
|
-
app.nodes.attachNodeCallback((node) => {
|
|
40
|
+
app.nodes.attachNodeCallback(app.safe((node) => {
|
|
41
41
|
if (!(0, guards_js_1.isDocument)(node)) {
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
@@ -52,6 +52,6 @@ function default_1(app) {
|
|
|
52
52
|
ffDataArr.forEach((ffData) => {
|
|
53
53
|
app.send((0, messages_gen_js_1.LoadFontFace)(parentID, ...ffData));
|
|
54
54
|
});
|
|
55
|
-
});
|
|
55
|
+
}));
|
|
56
56
|
}
|
|
57
57
|
exports.default = default_1;
|
package/cjs/modules/img.js
CHANGED
|
@@ -5,15 +5,16 @@ const messages_gen_js_1 = require("../app/messages.gen.js");
|
|
|
5
5
|
const guards_js_1 = require("../app/guards.js");
|
|
6
6
|
function resolveURL(url, location = document.location) {
|
|
7
7
|
url = url.trim();
|
|
8
|
-
if (url.startsWith('
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
else if (url.startsWith('http://') ||
|
|
8
|
+
if (url.startsWith('//') ||
|
|
9
|
+
url.startsWith('http://') ||
|
|
12
10
|
url.startsWith('https://') ||
|
|
13
11
|
url.startsWith('data:') // any other possible value here? https://bugzilla.mozilla.org/show_bug.cgi?id=1758035
|
|
14
12
|
) {
|
|
15
13
|
return url;
|
|
16
14
|
}
|
|
15
|
+
else if (url.startsWith('/')) {
|
|
16
|
+
return location.origin + url;
|
|
17
|
+
}
|
|
17
18
|
else {
|
|
18
19
|
return location.origin + location.pathname + url;
|
|
19
20
|
}
|
|
@@ -97,7 +98,7 @@ function default_1(app) {
|
|
|
97
98
|
observer.disconnect();
|
|
98
99
|
});
|
|
99
100
|
app.nodes.attachNodeCallback((node) => {
|
|
100
|
-
if (!(0, guards_js_1.hasTag)(node, '
|
|
101
|
+
if (!(0, guards_js_1.hasTag)(node, 'img')) {
|
|
101
102
|
return;
|
|
102
103
|
}
|
|
103
104
|
app.nodes.attachNodeListener(node, 'error', () => sendImgError(node));
|
package/cjs/modules/input.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type App from '../app/index.js';
|
|
2
|
-
|
|
2
|
+
type TextEditableElement = HTMLInputElement | HTMLTextAreaElement;
|
|
3
3
|
export declare function getInputLabel(node: TextEditableElement): string;
|
|
4
4
|
export declare const enum InputMode {
|
|
5
5
|
Plain = 0,
|