@openreplay/tracker 3.5.10 → 3.5.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 (65) hide show
  1. package/cjs/app/index.d.ts +2 -2
  2. package/cjs/app/index.js +3 -3
  3. package/cjs/app/observer/iframe_observer.js +2 -2
  4. package/cjs/app/observer/observer.js +13 -13
  5. package/cjs/app/observer/shadow_root_observer.js +2 -2
  6. package/cjs/app/observer/top_observer.js +2 -2
  7. package/cjs/app/session.js +3 -3
  8. package/cjs/{messages/index.d.ts → common/messages.d.ts} +2 -3
  9. package/cjs/{messages/index.js → common/messages.js} +0 -0
  10. package/cjs/common/types.d.ts +9 -0
  11. package/cjs/{messages/message.js → common/types.js} +0 -0
  12. package/cjs/common/webworker.d.ts +19 -0
  13. package/cjs/common/webworker.js +2 -0
  14. package/cjs/index.d.ts +1 -1
  15. package/cjs/index.js +6 -6
  16. package/cjs/modules/connection.js +2 -2
  17. package/cjs/modules/console.js +2 -2
  18. package/cjs/modules/cssrules.js +4 -4
  19. package/cjs/modules/exception.d.ts +1 -1
  20. package/cjs/modules/exception.js +4 -4
  21. package/cjs/modules/img.js +7 -7
  22. package/cjs/modules/input.js +5 -5
  23. package/cjs/modules/longtasks.js +2 -2
  24. package/cjs/modules/mouse.js +3 -3
  25. package/cjs/modules/performance.js +2 -2
  26. package/cjs/modules/scroll.js +3 -3
  27. package/cjs/modules/timing.js +4 -4
  28. package/cjs/modules/viewport.js +4 -4
  29. package/lib/app/index.d.ts +2 -2
  30. package/lib/app/index.js +2 -2
  31. package/lib/app/observer/iframe_observer.js +1 -1
  32. package/lib/app/observer/observer.js +1 -1
  33. package/lib/app/observer/shadow_root_observer.js +1 -1
  34. package/lib/app/observer/top_observer.js +1 -1
  35. package/lib/app/session.js +1 -1
  36. package/lib/{messages/index.d.ts → common/messages.d.ts} +2 -3
  37. package/lib/{messages/index.js → common/messages.js} +0 -0
  38. package/lib/common/tsconfig.tsbuildinfo +1 -0
  39. package/lib/common/types.d.ts +9 -0
  40. package/lib/{messages/message.js → common/types.js} +0 -0
  41. package/lib/common/webworker.d.ts +19 -0
  42. package/lib/common/webworker.js +1 -0
  43. package/lib/index.d.ts +1 -1
  44. package/lib/index.js +3 -3
  45. package/lib/modules/connection.js +1 -1
  46. package/lib/modules/console.js +1 -1
  47. package/lib/modules/cssrules.js +1 -1
  48. package/lib/modules/exception.d.ts +1 -1
  49. package/lib/modules/exception.js +1 -1
  50. package/lib/modules/img.js +1 -1
  51. package/lib/modules/input.js +1 -1
  52. package/lib/modules/longtasks.js +1 -1
  53. package/lib/modules/mouse.js +1 -1
  54. package/lib/modules/performance.js +1 -1
  55. package/lib/modules/scroll.js +1 -1
  56. package/lib/modules/timing.js +1 -1
  57. package/lib/modules/viewport.js +1 -1
  58. package/package.json +1 -1
  59. package/cjs/messages/message.d.ts +0 -4
  60. package/cjs/messages/writer.d.ts +0 -15
  61. package/cjs/messages/writer.js +0 -115
  62. package/lib/messages/message.d.ts +0 -4
  63. package/lib/messages/tsconfig.tsbuildinfo +0 -1
  64. package/lib/messages/writer.d.ts +0 -15
  65. package/lib/messages/writer.js +0 -112
@@ -1,4 +1,4 @@
1
- import Message from "../messages/message.js";
1
+ import type Message from "../common/messages.js";
2
2
  import Nodes from "./nodes.js";
3
3
  import Sanitizer from "./sanitizer.js";
4
4
  import Ticker from "./ticker.js";
@@ -7,7 +7,7 @@ import Session from "./session.js";
7
7
  import type { Options as ObserverOptions } from "./observer/top_observer.js";
8
8
  import type { Options as SanitizerOptions } from "./sanitizer.js";
9
9
  import type { Options as LoggerOptions } from "./logger.js";
10
- import type { Options as WebworkerOptions } from "../../webworker/types.js";
10
+ import type { Options as WebworkerOptions } from "../common/webworker.js";
11
11
  export interface StartOptions {
12
12
  userID?: string;
13
13
  metadata?: Record<string, string>;
package/cjs/app/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DEFAULT_INGEST_POINT = exports.CANCELED = void 0;
4
+ const messages_js_1 = require("../common/messages.js");
4
5
  const utils_js_1 = require("../utils.js");
5
- const index_js_1 = require("../messages/index.js");
6
6
  const nodes_js_1 = require("./nodes.js");
7
7
  const top_observer_js_1 = require("./observer/top_observer.js");
8
8
  const sanitizer_js_1 = require("./sanitizer.js");
@@ -29,7 +29,7 @@ class App {
29
29
  this.stopCallbacks = [];
30
30
  this.commitCallbacks = [];
31
31
  this.activityState = ActivityState.NotActive;
32
- this.version = '3.5.10'; // TODO: version compatability check inside each plugin.
32
+ this.version = '3.5.11'; // TODO: version compatability check inside each plugin.
33
33
  this.projectKey = projectKey;
34
34
  this.options = Object.assign({
35
35
  revID: '',
@@ -113,7 +113,7 @@ class App {
113
113
  }
114
114
  commit() {
115
115
  if (this.worker && this.messages.length) {
116
- this.messages.unshift(new index_js_1.Timestamp((0, utils_js_1.timestamp)()));
116
+ this.messages.unshift(new messages_js_1.Timestamp((0, utils_js_1.timestamp)()));
117
117
  this.worker.postMessage(this.messages);
118
118
  this.commitCallbacks.forEach(cb => cb(this.messages));
119
119
  this.messages.length = 0;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const observer_js_1 = require("./observer.js");
4
- const index_js_1 = require("../../messages/index.js");
4
+ const messages_js_1 = require("../../common/messages.js");
5
5
  class IFrameObserver extends observer_js_1.default {
6
6
  observe(iframe) {
7
7
  const doc = iframe.contentDocument;
@@ -15,7 +15,7 @@ class IFrameObserver extends observer_js_1.default {
15
15
  console.log("OpenReplay: Iframe document not bound");
16
16
  return;
17
17
  }
18
- this.app.send((0, index_js_1.CreateIFrameDocument)(hostID, docID));
18
+ this.app.send((0, messages_js_1.CreateIFrameDocument)(hostID, docID));
19
19
  });
20
20
  }
21
21
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const index_js_1 = require("../../messages/index.js");
3
+ const messages_js_1 = require("../../common/messages.js");
4
4
  const context_js_1 = require("../context.js");
5
5
  function isSVGElement(node) {
6
6
  return node.namespaceURI === 'http://www.w3.org/2000/svg';
@@ -99,16 +99,16 @@ class Observer {
99
99
  name = name.substr(6);
100
100
  }
101
101
  if (value === null) {
102
- this.app.send(new index_js_1.RemoveNodeAttribute(id, name));
102
+ this.app.send(new messages_js_1.RemoveNodeAttribute(id, name));
103
103
  }
104
104
  else if (name === 'href') {
105
105
  if (value.length > 1e5) {
106
106
  value = '';
107
107
  }
108
- this.app.send(new index_js_1.SetNodeAttributeURLBased(id, name, value, this.app.getBaseHref()));
108
+ this.app.send(new messages_js_1.SetNodeAttributeURLBased(id, name, value, this.app.getBaseHref()));
109
109
  }
110
110
  else {
111
- this.app.send(new index_js_1.SetNodeAttribute(id, name, value));
111
+ this.app.send(new messages_js_1.SetNodeAttribute(id, name, value));
112
112
  }
113
113
  return;
114
114
  }
@@ -128,25 +128,25 @@ class Observer {
128
128
  return;
129
129
  }
130
130
  if (value === null) {
131
- this.app.send(new index_js_1.RemoveNodeAttribute(id, name));
131
+ this.app.send(new messages_js_1.RemoveNodeAttribute(id, name));
132
132
  return;
133
133
  }
134
134
  if (name === 'style' || name === 'href' && (0, context_js_1.isInstance)(node, HTMLLinkElement)) {
135
- this.app.send(new index_js_1.SetNodeAttributeURLBased(id, name, value, this.app.getBaseHref()));
135
+ this.app.send(new messages_js_1.SetNodeAttributeURLBased(id, name, value, this.app.getBaseHref()));
136
136
  return;
137
137
  }
138
138
  if (name === 'href' || value.length > 1e5) {
139
139
  value = '';
140
140
  }
141
- this.app.send(new index_js_1.SetNodeAttribute(id, name, value));
141
+ this.app.send(new messages_js_1.SetNodeAttribute(id, name, value));
142
142
  }
143
143
  sendNodeData(id, parentElement, data) {
144
144
  if ((0, context_js_1.isInstance)(parentElement, HTMLStyleElement) || (0, context_js_1.isInstance)(parentElement, SVGStyleElement)) {
145
- this.app.send(new index_js_1.SetCSSDataURLBased(id, data, this.app.getBaseHref()));
145
+ this.app.send(new messages_js_1.SetCSSDataURLBased(id, data, this.app.getBaseHref()));
146
146
  return;
147
147
  }
148
148
  data = this.app.sanitizer.sanitize(id, data);
149
- this.app.send(new index_js_1.SetNodeData(id, data));
149
+ this.app.send(new messages_js_1.SetNodeData(id, data));
150
150
  }
151
151
  bindNode(node) {
152
152
  const r = this.app.nodes.registerNode(node);
@@ -173,7 +173,7 @@ class Observer {
173
173
  unbindNode(node) {
174
174
  const id = this.app.nodes.unregisterNode(node);
175
175
  if (id !== undefined && this.recents[id] === false) {
176
- this.app.send(new index_js_1.RemoveNode(id));
176
+ this.app.send(new messages_js_1.RemoveNode(id));
177
177
  }
178
178
  }
179
179
  _commitNode(id, node) {
@@ -222,7 +222,7 @@ class Observer {
222
222
  if (isNew === true) {
223
223
  if ((0, context_js_1.isInstance)(node, Element)) {
224
224
  if (parentID !== undefined) {
225
- this.app.send(new index_js_1.CreateElementNode(id, parentID, index, node.tagName, isSVGElement(node)));
225
+ this.app.send(new messages_js_1.CreateElementNode(id, parentID, index, node.tagName, isSVGElement(node)));
226
226
  }
227
227
  for (let i = 0; i < node.attributes.length; i++) {
228
228
  const attr = node.attributes[i];
@@ -231,13 +231,13 @@ class Observer {
231
231
  }
232
232
  else if ((0, context_js_1.isInstance)(node, Text)) {
233
233
  // for text node id != 0, hence parentID !== undefined and parent is Element
234
- this.app.send(new index_js_1.CreateTextNode(id, parentID, index));
234
+ this.app.send(new messages_js_1.CreateTextNode(id, parentID, index));
235
235
  this.sendNodeData(id, parent, node.data);
236
236
  }
237
237
  return true;
238
238
  }
239
239
  if (isNew === false && parentID !== undefined) {
240
- this.app.send(new index_js_1.MoveNode(id, parentID, index));
240
+ this.app.send(new messages_js_1.MoveNode(id, parentID, index));
241
241
  }
242
242
  const attr = this.attributesList[id];
243
243
  if (attr !== undefined) {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const observer_js_1 = require("./observer.js");
4
- const index_js_1 = require("../../messages/index.js");
4
+ const messages_js_1 = require("../../common/messages.js");
5
5
  class ShadowRootObserver extends observer_js_1.default {
6
6
  observe(el) {
7
7
  const shRoot = el.shadowRoot;
@@ -14,7 +14,7 @@ class ShadowRootObserver extends observer_js_1.default {
14
14
  console.log("OpenReplay: Shadow Root was not bound");
15
15
  return;
16
16
  }
17
- this.app.send((0, index_js_1.CreateIFrameDocument)(hostID, rootID));
17
+ this.app.send((0, messages_js_1.CreateIFrameDocument)(hostID, rootID));
18
18
  });
19
19
  }
20
20
  }
@@ -4,7 +4,7 @@ const observer_js_1 = require("./observer.js");
4
4
  const context_js_1 = require("../context.js");
5
5
  const iframe_observer_js_1 = require("./iframe_observer.js");
6
6
  const shadow_root_observer_js_1 = require("./shadow_root_observer.js");
7
- const index_js_1 = require("../../messages/index.js");
7
+ const messages_js_1 = require("../../common/messages.js");
8
8
  const utils_js_1 = require("../../utils.js");
9
9
  const attachShadowNativeFn = utils_js_1.IN_BROWSER ? Element.prototype.attachShadow : () => new ShadowRoot();
10
10
  class TopObserver extends observer_js_1.default {
@@ -71,7 +71,7 @@ class TopObserver extends observer_js_1.default {
71
71
  // the 0-node ("fRoot") will become #document rather than documentElement as it is now.
72
72
  // Alternatively - observe(#document) then bindNode(documentElement)
73
73
  this.observeRoot(window.document, () => {
74
- this.app.send(new index_js_1.CreateDocument());
74
+ this.app.send(new messages_js_1.CreateDocument());
75
75
  }, window.document.documentElement);
76
76
  }
77
77
  disconnect() {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const index_js_1 = require("../messages/index.js");
3
+ const messages_js_1 = require("../common/messages.js");
4
4
  var ActivityState;
5
5
  (function (ActivityState) {
6
6
  ActivityState[ActivityState["NotActive"] = 0] = "NotActive";
@@ -42,11 +42,11 @@ class Session {
42
42
  this.handleUpdate();
43
43
  }
44
44
  _setMetadata(key, value) {
45
- this.app.send(new index_js_1.Metadata(key, value));
45
+ this.app.send(new messages_js_1.Metadata(key, value));
46
46
  this.metadata[key] = value;
47
47
  }
48
48
  _setUserID(userID) {
49
- this.app.send(new index_js_1.UserID(userID));
49
+ this.app.send(new messages_js_1.UserID(userID));
50
50
  this.userID = userID;
51
51
  }
52
52
  setMetadata(key, value) {
@@ -1,5 +1,5 @@
1
- import Message from "./message.js";
2
- import Writer from "./writer.js";
1
+ import type { Writer, Message } from "./types.js";
2
+ export default Message;
3
3
  export declare const classes: Map<number, Function>;
4
4
  declare class _BatchMeta implements Message {
5
5
  pageNo: number;
@@ -442,4 +442,3 @@ declare class _CreateIFrameDocument implements Message {
442
442
  encode(writer: Writer): boolean;
443
443
  }
444
444
  export declare const CreateIFrameDocument: typeof _CreateIFrameDocument & ((frameID: number, id: number) => _CreateIFrameDocument);
445
- export {};
File without changes
@@ -0,0 +1,9 @@
1
+ export interface Writer {
2
+ uint(n: number): boolean;
3
+ int(n: number): boolean;
4
+ string(s: string): boolean;
5
+ boolean(b: boolean): boolean;
6
+ }
7
+ export interface Message {
8
+ encode(w: Writer): boolean;
9
+ }
File without changes
@@ -0,0 +1,19 @@
1
+ export interface Options {
2
+ connAttemptCount?: number;
3
+ connAttemptGap?: number;
4
+ }
5
+ declare type Start = {
6
+ type: "start";
7
+ ingestPoint: string;
8
+ pageNo: number;
9
+ timestamp: number;
10
+ } & Options;
11
+ declare type Auth = {
12
+ type: "auth";
13
+ token: string;
14
+ beaconSizeLimit?: number;
15
+ };
16
+ export declare type WorkerMessageData = null | "stop" | Start | Auth | Array<{
17
+ _id: number;
18
+ }>;
19
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/cjs/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import App from "./app/index.js";
2
2
  export { default as App } from './app/index.js';
3
- import * as _Messages from "./messages/index.js";
3
+ import * as _Messages from "./common/messages.js";
4
4
  export declare const Messages: typeof _Messages;
5
5
  import type { Options as AppOptions } from "./app/index.js";
6
6
  import type { Options as ConsoleOptions } from "./modules/console.js";
package/cjs/index.js CHANGED
@@ -4,8 +4,8 @@ exports.Messages = exports.App = void 0;
4
4
  const index_js_1 = require("./app/index.js");
5
5
  var index_js_2 = require("./app/index.js");
6
6
  Object.defineProperty(exports, "App", { enumerable: true, get: function () { return index_js_2.default; } });
7
- const index_js_3 = require("./messages/index.js");
8
- const _Messages = require("./messages/index.js");
7
+ const messages_js_1 = require("./common/messages.js");
8
+ const _Messages = require("./common/messages.js");
9
9
  exports.Messages = _Messages;
10
10
  const connection_js_1 = require("./modules/connection.js");
11
11
  const console_js_1 = require("./modules/console.js");
@@ -127,7 +127,7 @@ class API {
127
127
  // no-cors issue only with text/plain or not-set Content-Type
128
128
  // req.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
129
129
  req.send(JSON.stringify({
130
- trackerVersion: '3.5.10',
130
+ trackerVersion: '3.5.11',
131
131
  projectKey: options.projectKey,
132
132
  doNotTrack,
133
133
  // TODO: add precise reason (an exact API missing)
@@ -187,7 +187,7 @@ class API {
187
187
  }
188
188
  setUserAnonymousID(id) {
189
189
  if (typeof id === 'string' && this.app !== null) {
190
- this.app.send(new index_js_3.UserAnonymousID(id));
190
+ this.app.send(new messages_js_1.UserAnonymousID(id));
191
191
  }
192
192
  }
193
193
  userAnonymousID(id) {
@@ -217,7 +217,7 @@ class API {
217
217
  catch (e) {
218
218
  return;
219
219
  }
220
- this.app.send(new index_js_3.RawCustomEvent(key, payload));
220
+ this.app.send(new messages_js_1.RawCustomEvent(key, payload));
221
221
  }
222
222
  }
223
223
  }
@@ -229,7 +229,7 @@ class API {
229
229
  catch (e) {
230
230
  return;
231
231
  }
232
- this.app.send(new index_js_3.CustomIssue(key, payload));
232
+ this.app.send(new messages_js_1.CustomIssue(key, payload));
233
233
  }
234
234
  }
235
235
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const index_js_1 = require("../messages/index.js");
3
+ const messages_js_1 = require("../common/messages.js");
4
4
  function default_1(app) {
5
5
  const connection = navigator.connection ||
6
6
  navigator.mozConnection ||
@@ -8,7 +8,7 @@ function default_1(app) {
8
8
  if (connection === undefined) {
9
9
  return;
10
10
  }
11
- const sendConnectionInformation = () => app.send(new index_js_1.ConnectionInformation(Math.round(connection.downlink * 1000), connection.type || 'unknown'));
11
+ const sendConnectionInformation = () => app.send(new messages_js_1.ConnectionInformation(Math.round(connection.downlink * 1000), connection.type || 'unknown'));
12
12
  sendConnectionInformation();
13
13
  connection.addEventListener('change', sendConnectionInformation);
14
14
  }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const utils_js_1 = require("../utils.js");
4
- const index_js_1 = require("../messages/index.js");
4
+ const messages_js_1 = require("../common/messages.js");
5
5
  const printError = utils_js_1.IN_BROWSER && 'InstallTrigger' in window // detect Firefox
6
6
  ? (e) => e.message + '\n' + e.stack
7
7
  : (e) => e.stack || e.message;
@@ -92,7 +92,7 @@ function default_1(app, opts) {
92
92
  options.consoleMethods.length === 0) {
93
93
  return;
94
94
  }
95
- const sendConsoleLog = app.safe((level, args) => app.send(new index_js_1.ConsoleLog(level, printf(args))));
95
+ const sendConsoleLog = app.safe((level, args) => app.send(new messages_js_1.ConsoleLog(level, printf(args))));
96
96
  let n;
97
97
  const reset = () => {
98
98
  n = 0;
@@ -1,18 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const index_js_1 = require("../messages/index.js");
3
+ const messages_js_1 = require("../common/messages.js");
4
4
  function default_1(app) {
5
5
  if (app === null) {
6
6
  return;
7
7
  }
8
8
  if (!window.CSSStyleSheet) {
9
- app.send(new index_js_1.TechnicalInfo("no_stylesheet_prototype_in_window", ""));
9
+ app.send(new messages_js_1.TechnicalInfo("no_stylesheet_prototype_in_window", ""));
10
10
  return;
11
11
  }
12
12
  const processOperation = app.safe((stylesheet, index, rule) => {
13
13
  const sendMessage = typeof rule === 'string'
14
- ? (nodeID) => app.send(new index_js_1.CSSInsertRuleURLBased(nodeID, rule, index, app.getBaseHref()))
15
- : (nodeID) => app.send(new index_js_1.CSSDeleteRule(nodeID, index));
14
+ ? (nodeID) => app.send(new messages_js_1.CSSInsertRuleURLBased(nodeID, rule, index, app.getBaseHref()))
15
+ : (nodeID) => app.send(new messages_js_1.CSSDeleteRule(nodeID, index));
16
16
  // TODO: Extend messages to maintain nested rules (CSSGroupingRule prototype, as well as CSSKeyframesRule)
17
17
  if (stylesheet.ownerNode == null) {
18
18
  throw new Error("Owner Node not found");
@@ -1,5 +1,5 @@
1
+ import type Message from "../common/messages.js";
1
2
  import App from "../app/index.js";
2
- import Message from "../messages/message.js";
3
3
  export interface Options {
4
4
  captureExceptions: boolean;
5
5
  }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getExceptionMessageFromEvent = exports.getExceptionMessage = void 0;
4
- const index_js_1 = require("../messages/index.js");
4
+ const messages_js_1 = require("../common/messages.js");
5
5
  const error_stack_parser_1 = require("error-stack-parser");
6
6
  function getDefaultStack(e) {
7
7
  return [{
@@ -19,7 +19,7 @@ function getExceptionMessage(error, fallbackStack) {
19
19
  }
20
20
  catch (e) {
21
21
  }
22
- return new index_js_1.JSException(error.name, error.message, JSON.stringify(stack));
22
+ return new messages_js_1.JSException(error.name, error.message, JSON.stringify(stack));
23
23
  }
24
24
  exports.getExceptionMessage = getExceptionMessage;
25
25
  function getExceptionMessageFromEvent(e) {
@@ -33,7 +33,7 @@ function getExceptionMessageFromEvent(e) {
33
33
  name = 'Error';
34
34
  message = e.message;
35
35
  }
36
- return new index_js_1.JSException(name, message, JSON.stringify(getDefaultStack(e)));
36
+ return new messages_js_1.JSException(name, message, JSON.stringify(getDefaultStack(e)));
37
37
  }
38
38
  }
39
39
  else if ('PromiseRejectionEvent' in window && e instanceof PromiseRejectionEvent) {
@@ -48,7 +48,7 @@ function getExceptionMessageFromEvent(e) {
48
48
  catch (_) {
49
49
  message = String(e.reason);
50
50
  }
51
- return new index_js_1.JSException('Unhandled Promise Rejection', message, '[]');
51
+ return new messages_js_1.JSException('Unhandled Promise Rejection', message, '[]');
52
52
  }
53
53
  }
54
54
  return null;
@@ -1,17 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const utils_js_1 = require("../utils.js");
4
- const index_js_1 = require("../messages/index.js");
4
+ const messages_js_1 = require("../common/messages.js");
5
5
  const PLACEHOLDER_SRC = "https://static.openreplay.com/tracker/placeholder.jpeg";
6
6
  function default_1(app) {
7
7
  function sendPlaceholder(id, node) {
8
- app.send(new index_js_1.SetNodeAttribute(id, "src", PLACEHOLDER_SRC));
8
+ app.send(new messages_js_1.SetNodeAttribute(id, "src", PLACEHOLDER_SRC));
9
9
  const { width, height } = node.getBoundingClientRect();
10
10
  if (!node.hasAttribute("width")) {
11
- app.send(new index_js_1.SetNodeAttribute(id, "width", String(width)));
11
+ app.send(new messages_js_1.SetNodeAttribute(id, "width", String(width)));
12
12
  }
13
13
  if (!node.hasAttribute("height")) {
14
- app.send(new index_js_1.SetNodeAttribute(id, "height", String(height)));
14
+ app.send(new messages_js_1.SetNodeAttribute(id, "height", String(height)));
15
15
  }
16
16
  }
17
17
  const sendImgSrc = app.safe(function () {
@@ -25,14 +25,14 @@ function default_1(app) {
25
25
  }
26
26
  if (naturalWidth === 0 && naturalHeight === 0) {
27
27
  if (src != null && (0, utils_js_1.isURL)(src)) { // TODO: How about relative urls ? Src type is null sometimes.
28
- app.send(new index_js_1.ResourceTiming((0, utils_js_1.timestamp)(), 0, 0, 0, 0, 0, src, 'img'));
28
+ app.send(new messages_js_1.ResourceTiming((0, utils_js_1.timestamp)(), 0, 0, 0, 0, 0, src, 'img'));
29
29
  }
30
30
  }
31
31
  else if (src.length >= 1e5 || app.sanitizer.isMasked(id)) {
32
32
  sendPlaceholder(id, this);
33
33
  }
34
34
  else {
35
- app.send(new index_js_1.SetNodeAttributeURLBased(id, 'src', src, app.getBaseHref()));
35
+ app.send(new messages_js_1.SetNodeAttributeURLBased(id, 'src', src, app.getBaseHref()));
36
36
  }
37
37
  });
38
38
  const observer = new MutationObserver((mutations) => {
@@ -44,7 +44,7 @@ function default_1(app) {
44
44
  return;
45
45
  }
46
46
  const src = target.src;
47
- app.send(new index_js_1.SetNodeAttributeURLBased(id, 'src', src, app.getBaseHref()));
47
+ app.send(new messages_js_1.SetNodeAttributeURLBased(id, 'src', src, app.getBaseHref()));
48
48
  }
49
49
  }
50
50
  });
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getInputLabel = void 0;
4
4
  const utils_js_1 = require("../utils.js");
5
- const index_js_1 = require("../messages/index.js");
5
+ const messages_js_1 = require("../common/messages.js");
6
6
  function isTextEditable(node) {
7
7
  if (node instanceof HTMLTextAreaElement) {
8
8
  return true;
@@ -76,7 +76,7 @@ function default_1(app, opts) {
76
76
  function sendInputTarget(id, node) {
77
77
  const label = getInputLabel(node);
78
78
  if (label !== '') {
79
- app.send(new index_js_1.SetInputTarget(id, label));
79
+ app.send(new messages_js_1.SetInputTarget(id, label));
80
80
  }
81
81
  }
82
82
  function sendInputValue(id, node) {
@@ -103,7 +103,7 @@ function default_1(app, opts) {
103
103
  value = '';
104
104
  break;
105
105
  }
106
- app.send(new index_js_1.SetInputValue(id, value, mask));
106
+ app.send(new messages_js_1.SetInputValue(id, value, mask));
107
107
  }
108
108
  const inputValues = new Map();
109
109
  const checkableValues = new Map();
@@ -137,7 +137,7 @@ function default_1(app, opts) {
137
137
  }
138
138
  if (checked !== node.checked) {
139
139
  checkableValues.set(id, node.checked);
140
- app.send(new index_js_1.SetInputChecked(id, node.checked));
140
+ app.send(new messages_js_1.SetInputChecked(id, node.checked));
141
141
  }
142
142
  });
143
143
  });
@@ -161,7 +161,7 @@ function default_1(app, opts) {
161
161
  }
162
162
  if (isCheckable(node)) {
163
163
  checkableValues.set(id, node.checked);
164
- app.send(new index_js_1.SetInputChecked(id, node.checked));
164
+ app.send(new messages_js_1.SetInputChecked(id, node.checked));
165
165
  return;
166
166
  }
167
167
  }));
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const index_js_1 = require("../messages/index.js");
3
+ const messages_js_1 = require("../common/messages.js");
4
4
  ;
5
5
  ;
6
6
  function default_1(app) {
@@ -18,7 +18,7 @@ function default_1(app) {
18
18
  id = container.containerId;
19
19
  src = container.containerSrc;
20
20
  }
21
- app.send(new index_js_1.LongTask(entry.startTime + performance.timing.navigationStart, entry.duration, Math.max(contexts.indexOf(entry.name), 0), Math.max(containerTypes.indexOf(type), 0), name, id, src));
21
+ app.send(new messages_js_1.LongTask(entry.startTime + performance.timing.navigationStart, entry.duration, Math.max(contexts.indexOf(entry.name), 0), Math.max(containerTypes.indexOf(type), 0), name, id, src));
22
22
  }
23
23
  const observer = new PerformanceObserver((list) => list.getEntries().forEach(longTask));
24
24
  observer.observe({ entryTypes: ['longtask'] });
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const utils_js_1 = require("../utils.js");
4
- const index_js_1 = require("../messages/index.js");
4
+ const messages_js_1 = require("../common/messages.js");
5
5
  const input_js_1 = require("./input.js");
6
6
  function _getSelector(target) {
7
7
  let el = target;
@@ -105,7 +105,7 @@ function default_1(app) {
105
105
  });
106
106
  const sendMouseMove = () => {
107
107
  if (mousePositionChanged) {
108
- app.send(new index_js_1.MouseMove(mousePositionX, mousePositionY));
108
+ app.send(new messages_js_1.MouseMove(mousePositionX, mousePositionY));
109
109
  mousePositionChanged = false;
110
110
  }
111
111
  };
@@ -133,7 +133,7 @@ function default_1(app) {
133
133
  const id = app.nodes.getID(target);
134
134
  if (id !== undefined) {
135
135
  sendMouseMove();
136
- app.send(new index_js_1.MouseClick(id, mouseTarget === target
136
+ app.send(new messages_js_1.MouseClick(id, mouseTarget === target
137
137
  ? Math.round(performance.now() - mouseTargetTime)
138
138
  : 0, getTargetLabel(target), getSelector(id, target)), true);
139
139
  }
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.jsHeapSizeLimit = exports.deviceMemory = void 0;
4
4
  const utils_js_1 = require("../utils.js");
5
- const index_js_1 = require("../messages/index.js");
5
+ const messages_js_1 = require("../common/messages.js");
6
6
  const perf = utils_js_1.IN_BROWSER && 'performance' in window && 'memory' in performance // works in Chrome only
7
7
  ? performance
8
8
  : { memory: {} };
@@ -34,7 +34,7 @@ function default_1(app, opts) {
34
34
  if (frames === undefined || ticks === undefined) {
35
35
  return;
36
36
  }
37
- app.send(new index_js_1.PerformanceTrack(frames, ticks, perf.memory.totalJSHeapSize || 0, perf.memory.usedJSHeapSize || 0));
37
+ app.send(new messages_js_1.PerformanceTrack(frames, ticks, perf.memory.totalJSHeapSize || 0, perf.memory.usedJSHeapSize || 0));
38
38
  ticks = frames = document.hidden ? -1 : 0;
39
39
  };
40
40
  app.attachStartCallback(() => {
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const index_js_1 = require("../messages/index.js");
3
+ const messages_js_1 = require("../common/messages.js");
4
4
  function default_1(app) {
5
5
  let documentScroll = false;
6
6
  const nodeScroll = new Map();
7
- const sendSetViewportScroll = app.safe(() => app.send(new index_js_1.SetViewportScroll(window.pageXOffset ||
7
+ const sendSetViewportScroll = app.safe(() => app.send(new messages_js_1.SetViewportScroll(window.pageXOffset ||
8
8
  (document.documentElement && document.documentElement.scrollLeft) ||
9
9
  (document.body && document.body.scrollLeft) ||
10
10
  0, window.pageYOffset ||
@@ -14,7 +14,7 @@ function default_1(app) {
14
14
  const sendSetNodeScroll = app.safe((s, node) => {
15
15
  const id = app.nodes.getID(node);
16
16
  if (id !== undefined) {
17
- app.send(new index_js_1.SetNodeScroll(id, s[0], s[1]));
17
+ app.send(new messages_js_1.SetNodeScroll(id, s[0], s[1]));
18
18
  }
19
19
  });
20
20
  app.attachStartCallback(sendSetViewportScroll);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const utils_js_1 = require("../utils.js");
4
- const index_js_1 = require("../messages/index.js");
4
+ const messages_js_1 = require("../common/messages.js");
5
5
  function getPaintBlocks(resources) {
6
6
  const paintBlocks = [];
7
7
  const elements = document.getElementsByTagName('*');
@@ -77,7 +77,7 @@ function default_1(app, opts) {
77
77
  if (resources !== null) {
78
78
  resources[entry.name] = entry.startTime + entry.duration;
79
79
  }
80
- app.send(new index_js_1.ResourceTiming(entry.startTime + performance.timing.navigationStart, entry.duration, entry.responseStart && entry.startTime
80
+ app.send(new messages_js_1.ResourceTiming(entry.startTime + performance.timing.navigationStart, entry.duration, entry.responseStart && entry.startTime
81
81
  ? entry.responseStart - entry.startTime
82
82
  : 0, entry.transferSize > entry.encodedBodySize
83
83
  ? entry.transferSize - entry.encodedBodySize
@@ -120,7 +120,7 @@ function default_1(app, opts) {
120
120
  if (performance.timing.loadEventEnd || performance.now() > 30000) {
121
121
  pageLoadTimingSent = true;
122
122
  const { navigationStart, requestStart, responseStart, responseEnd, domContentLoadedEventStart, domContentLoadedEventEnd, loadEventStart, loadEventEnd, } = performance.timing;
123
- app.send(new index_js_1.PageLoadTiming(requestStart - navigationStart || 0, responseStart - navigationStart || 0, responseEnd - navigationStart || 0, domContentLoadedEventStart - navigationStart || 0, domContentLoadedEventEnd - navigationStart || 0, loadEventStart - navigationStart || 0, loadEventEnd - navigationStart || 0, firstPaint, firstContentfulPaint));
123
+ app.send(new messages_js_1.PageLoadTiming(requestStart - navigationStart || 0, responseStart - navigationStart || 0, responseEnd - navigationStart || 0, domContentLoadedEventStart - navigationStart || 0, domContentLoadedEventEnd - navigationStart || 0, loadEventStart - navigationStart || 0, loadEventEnd - navigationStart || 0, firstPaint, firstContentfulPaint));
124
124
  }
125
125
  }, 30);
126
126
  }
@@ -157,7 +157,7 @@ function default_1(app, opts) {
157
157
  ? Math.max(interactiveWindowStartTime, firstContentfulPaint, performance.timing.domContentLoadedEventEnd -
158
158
  performance.timing.navigationStart || 0)
159
159
  : 0;
160
- app.send(new index_js_1.PageRenderTiming(speedIndex, firstContentfulPaint > visuallyComplete
160
+ app.send(new messages_js_1.PageRenderTiming(speedIndex, firstContentfulPaint > visuallyComplete
161
161
  ? firstContentfulPaint
162
162
  : visuallyComplete, timeToInteractive));
163
163
  }