@openreplay/tracker 4.1.10 → 4.1.11

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