@openreplay/tracker 3.4.7 → 3.4.8

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 (86) hide show
  1. package/cjs/app/index.d.ts +6 -6
  2. package/cjs/app/index.js +19 -19
  3. package/cjs/app/observer.d.ts +1 -1
  4. package/cjs/app/observer.js +24 -20
  5. package/cjs/app/ticker.d.ts +1 -1
  6. package/cjs/index.d.ts +9 -9
  7. package/cjs/index.js +56 -53
  8. package/cjs/messages/index.d.ts +2 -2
  9. package/cjs/messages/message.d.ts +1 -1
  10. package/cjs/modules/connection.d.ts +1 -1
  11. package/cjs/modules/connection.js +2 -2
  12. package/cjs/modules/console.d.ts +1 -1
  13. package/cjs/modules/console.js +4 -4
  14. package/cjs/modules/cssrules.d.ts +1 -1
  15. package/cjs/modules/cssrules.js +4 -4
  16. package/cjs/modules/exception.d.ts +2 -2
  17. package/cjs/modules/exception.js +4 -4
  18. package/cjs/modules/img.d.ts +1 -1
  19. package/cjs/modules/img.js +6 -6
  20. package/cjs/modules/input.d.ts +1 -1
  21. package/cjs/modules/input.js +11 -11
  22. package/cjs/modules/longtasks.d.ts +1 -1
  23. package/cjs/modules/longtasks.js +2 -2
  24. package/cjs/modules/mouse.d.ts +1 -1
  25. package/cjs/modules/mouse.js +10 -10
  26. package/cjs/modules/performance.d.ts +1 -1
  27. package/cjs/modules/performance.js +5 -5
  28. package/cjs/modules/scroll.d.ts +1 -1
  29. package/cjs/modules/scroll.js +3 -3
  30. package/cjs/modules/timing.d.ts +1 -1
  31. package/cjs/modules/timing.js +6 -6
  32. package/cjs/modules/viewport.d.ts +1 -1
  33. package/cjs/modules/viewport.js +4 -4
  34. package/cjs/utils.js +1 -1
  35. package/lib/app/index.d.ts +6 -6
  36. package/lib/app/index.js +7 -7
  37. package/lib/app/observer.d.ts +1 -1
  38. package/lib/app/observer.js +7 -3
  39. package/lib/app/ticker.d.ts +1 -1
  40. package/lib/index.d.ts +9 -9
  41. package/lib/index.js +22 -19
  42. package/lib/messages/index.d.ts +2 -2
  43. package/lib/messages/message.d.ts +1 -1
  44. package/lib/messages/tsconfig.tsbuildinfo +1 -1
  45. package/lib/modules/connection.d.ts +1 -1
  46. package/lib/modules/connection.js +1 -1
  47. package/lib/modules/console.d.ts +1 -1
  48. package/lib/modules/console.js +2 -2
  49. package/lib/modules/cssrules.d.ts +1 -1
  50. package/lib/modules/cssrules.js +1 -1
  51. package/lib/modules/exception.d.ts +2 -2
  52. package/lib/modules/exception.js +1 -1
  53. package/lib/modules/img.d.ts +1 -1
  54. package/lib/modules/img.js +2 -2
  55. package/lib/modules/input.d.ts +1 -1
  56. package/lib/modules/input.js +2 -2
  57. package/lib/modules/longtasks.d.ts +1 -1
  58. package/lib/modules/longtasks.js +1 -1
  59. package/lib/modules/mouse.d.ts +1 -1
  60. package/lib/modules/mouse.js +3 -3
  61. package/lib/modules/performance.d.ts +1 -1
  62. package/lib/modules/performance.js +2 -2
  63. package/lib/modules/scroll.d.ts +1 -1
  64. package/lib/modules/scroll.js +1 -1
  65. package/lib/modules/timing.d.ts +1 -1
  66. package/lib/modules/timing.js +2 -2
  67. package/lib/modules/viewport.d.ts +1 -1
  68. package/lib/modules/viewport.js +1 -1
  69. package/package.json +2 -2
  70. package/tsconfig-base.json +1 -1
  71. package/cjs/app/observer/iframe_observer.d.ts +0 -4
  72. package/cjs/app/observer/iframe_observer.js +0 -21
  73. package/cjs/app/observer/observer.d.ts +0 -46
  74. package/cjs/app/observer/observer.js +0 -353
  75. package/cjs/app/observer/shadow_root_observer.d.ts +0 -4
  76. package/cjs/app/observer/shadow_root_observer.js +0 -21
  77. package/cjs/app/observer/top_observer.d.ts +0 -15
  78. package/cjs/app/observer/top_observer.js +0 -78
  79. package/lib/app/observer/iframe_observer.d.ts +0 -4
  80. package/lib/app/observer/iframe_observer.js +0 -18
  81. package/lib/app/observer/observer.d.ts +0 -46
  82. package/lib/app/observer/observer.js +0 -348
  83. package/lib/app/observer/shadow_root_observer.d.ts +0 -4
  84. package/lib/app/observer/shadow_root_observer.js +0 -18
  85. package/lib/app/observer/top_observer.d.ts +0 -15
  86. package/lib/app/observer/top_observer.js +0 -75
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const utils_1 = require("../utils");
4
- const messages_1 = require("../messages");
5
- const printError = utils_1.IN_BROWSER && 'InstallTrigger' in window // detect Firefox
3
+ const utils_js_1 = require("../utils.js");
4
+ const index_js_1 = require("../messages/index.js");
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;
8
8
  function printString(arg) {
@@ -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 messages_1.ConsoleLog(level, printf(args))));
95
+ const sendConsoleLog = app.safe((level, args) => app.send(new index_js_1.ConsoleLog(level, printf(args))));
96
96
  let n;
97
97
  const reset = () => {
98
98
  n = 0;
@@ -1,2 +1,2 @@
1
- import App from '../app';
1
+ import App from "../app/index.js";
2
2
  export default function (app: App | null): void;
@@ -1,18 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const messages_1 = require("../messages");
3
+ const index_js_1 = require("../messages/index.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 messages_1.TechnicalInfo("no_stylesheet_prototype_in_window", ""));
9
+ app.send(new index_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 messages_1.CSSInsertRuleURLBased(nodeID, rule, index, app.getBaseHref()))
15
- : (nodeID) => app.send(new messages_1.CSSDeleteRule(nodeID, index));
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));
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 App from '../app';
2
- import Message from '../messages/message';
1
+ 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 messages_1 = require("../messages");
4
+ const index_js_1 = require("../messages/index.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 messages_1.JSException(error.name, error.message, JSON.stringify(stack));
22
+ return new index_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 messages_1.JSException(name, message, JSON.stringify(getDefaultStack(e)));
36
+ return new index_js_1.JSException(name, message, JSON.stringify(getDefaultStack(e)));
37
37
  }
38
38
  }
39
39
  else if ('PromiseRejectionEvent' in window && e instanceof PromiseRejectionEvent) {
@@ -41,7 +41,7 @@ function getExceptionMessageFromEvent(e) {
41
41
  return getExceptionMessage(e.reason, []);
42
42
  }
43
43
  else {
44
- return new messages_1.JSException('Unhandled Promise Rejection', String(e.reason), '[]');
44
+ return new index_js_1.JSException('Unhandled Promise Rejection', String(e.reason), '[]');
45
45
  }
46
46
  }
47
47
  return null;
@@ -1,2 +1,2 @@
1
- import App from '../app';
1
+ import App from "../app/index.js";
2
2
  export default function (app: App): void;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const utils_1 = require("../utils");
4
- const messages_1 = require("../messages");
3
+ const utils_js_1 = require("../utils.js");
4
+ const index_js_1 = require("../messages/index.js");
5
5
  function default_1(app) {
6
6
  const sendImgSrc = app.safe(function () {
7
7
  const id = app.nodes.getID(this);
@@ -13,12 +13,12 @@ function default_1(app) {
13
13
  return;
14
14
  }
15
15
  if (naturalWidth === 0 && naturalHeight === 0) {
16
- if (src != null && utils_1.isURL(src)) { // TODO: How about relative urls ? Src type is null sometimes.
17
- app.send(new messages_1.ResourceTiming(utils_1.timestamp(), 0, 0, 0, 0, 0, src, 'img'));
16
+ if (src != null && (0, utils_js_1.isURL)(src)) { // TODO: How about relative urls ? Src type is null sometimes.
17
+ app.send(new index_js_1.ResourceTiming((0, utils_js_1.timestamp)(), 0, 0, 0, 0, 0, src, 'img'));
18
18
  }
19
19
  }
20
20
  else if (src.length < 1e5) {
21
- app.send(new messages_1.SetNodeAttributeURLBased(id, 'src', src, app.getBaseHref()));
21
+ app.send(new index_js_1.SetNodeAttributeURLBased(id, 'src', src, app.getBaseHref()));
22
22
  }
23
23
  });
24
24
  const observer = new MutationObserver((mutations) => {
@@ -30,7 +30,7 @@ function default_1(app) {
30
30
  return;
31
31
  }
32
32
  const src = target.src;
33
- app.send(new messages_1.SetNodeAttributeURLBased(id, 'src', src, app.getBaseHref()));
33
+ app.send(new index_js_1.SetNodeAttributeURLBased(id, 'src', src, app.getBaseHref()));
34
34
  }
35
35
  }
36
36
  });
@@ -1,4 +1,4 @@
1
- import App from '../app';
1
+ import App from "../app/index.js";
2
2
  export declare function getInputLabel(node: HTMLInputElement): string;
3
3
  export declare const enum InputMode {
4
4
  Plain = 0,
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getInputLabel = void 0;
4
- const utils_1 = require("../utils");
5
- const messages_1 = require("../messages");
4
+ const utils_js_1 = require("../utils.js");
5
+ const index_js_1 = require("../messages/index.js");
6
6
  function isInput(node) {
7
7
  if (!(node instanceof HTMLInputElement)) {
8
8
  return false;
@@ -22,7 +22,7 @@ function isCheckable(node) {
22
22
  const type = node.type;
23
23
  return type === 'checkbox' || type === 'radio';
24
24
  }
25
- const labelElementFor = utils_1.IN_BROWSER && 'labels' in HTMLInputElement.prototype
25
+ const labelElementFor = utils_js_1.IN_BROWSER && 'labels' in HTMLInputElement.prototype
26
26
  ? (node) => {
27
27
  let p = node;
28
28
  while ((p = p.parentNode) !== null) {
@@ -51,7 +51,7 @@ const labelElementFor = utils_1.IN_BROWSER && 'labels' in HTMLInputElement.proto
51
51
  }
52
52
  };
53
53
  function getInputLabel(node) {
54
- let label = utils_1.getLabelAttribute(node);
54
+ let label = (0, utils_js_1.getLabelAttribute)(node);
55
55
  if (label === null) {
56
56
  const labelElement = labelElementFor(node);
57
57
  label =
@@ -59,7 +59,7 @@ function getInputLabel(node) {
59
59
  ? node.placeholder || node.name
60
60
  : labelElement.innerText;
61
61
  }
62
- return utils_1.normSpaces(label).slice(0, 100);
62
+ return (0, utils_js_1.normSpaces)(label).slice(0, 100);
63
63
  }
64
64
  exports.getInputLabel = getInputLabel;
65
65
  function default_1(app, opts) {
@@ -71,16 +71,16 @@ function default_1(app, opts) {
71
71
  function sendInputTarget(id, node) {
72
72
  const label = getInputLabel(node);
73
73
  if (label !== '') {
74
- app.send(new messages_1.SetInputTarget(id, label));
74
+ app.send(new index_js_1.SetInputTarget(id, label));
75
75
  }
76
76
  }
77
77
  function sendInputValue(id, node) {
78
78
  let value = node.value;
79
79
  let inputMode = options.defaultInputMode;
80
- if (node.type === 'password' || utils_1.hasOpenreplayAttribute(node, 'hidden')) {
80
+ if (node.type === 'password' || (0, utils_js_1.hasOpenreplayAttribute)(node, 'hidden')) {
81
81
  inputMode = 2 /* Hidden */;
82
82
  }
83
- else if (utils_1.hasOpenreplayAttribute(node, 'obscured') ||
83
+ else if ((0, utils_js_1.hasOpenreplayAttribute)(node, 'obscured') ||
84
84
  (inputMode === 0 /* Plain */ &&
85
85
  ((options.obscureInputNumbers && /\d\d\d\d/.test(value)) ||
86
86
  (options.obscureInputEmails &&
@@ -98,7 +98,7 @@ function default_1(app, opts) {
98
98
  value = '';
99
99
  break;
100
100
  }
101
- app.send(new messages_1.SetInputValue(id, value, mask));
101
+ app.send(new index_js_1.SetInputValue(id, value, mask));
102
102
  }
103
103
  const inputValues = new Map();
104
104
  const checkableValues = new Map();
@@ -132,7 +132,7 @@ function default_1(app, opts) {
132
132
  }
133
133
  if (checked !== node.checked) {
134
134
  checkableValues.set(id, node.checked);
135
- app.send(new messages_1.SetInputChecked(id, node.checked));
135
+ app.send(new index_js_1.SetInputChecked(id, node.checked));
136
136
  }
137
137
  });
138
138
  });
@@ -149,7 +149,7 @@ function default_1(app, opts) {
149
149
  }
150
150
  if (isCheckable(node)) {
151
151
  checkableValues.set(id, node.checked);
152
- app.send(new messages_1.SetInputChecked(id, node.checked));
152
+ app.send(new index_js_1.SetInputChecked(id, node.checked));
153
153
  return;
154
154
  }
155
155
  }));
@@ -1,2 +1,2 @@
1
- import App from '../app';
1
+ import App from "../app/index.js";
2
2
  export default function (app: App): void;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const messages_1 = require("../messages");
3
+ const index_js_1 = require("../messages/index.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 messages_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 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));
22
22
  }
23
23
  const observer = new PerformanceObserver((list) => list.getEntries().forEach(longTask));
24
24
  observer.observe({ entryTypes: ['longtask'] });
@@ -1,2 +1,2 @@
1
- import App from '../app';
1
+ import App from "../app/index.js";
2
2
  export default function (app: App): void;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const utils_1 = require("../utils");
4
- const messages_1 = require("../messages");
5
- const input_1 = require("./input");
3
+ const utils_js_1 = require("../utils.js");
4
+ const index_js_1 = require("../messages/index.js");
5
+ const input_js_1 = require("./input.js");
6
6
  function _getSelector(target) {
7
7
  let el = target;
8
8
  let selector = null;
@@ -33,7 +33,7 @@ function getTarget(target) {
33
33
  function _getTarget(target) {
34
34
  let element = target;
35
35
  while (element !== null && element !== document.documentElement) {
36
- if (utils_1.hasOpenreplayAttribute(element, 'masked')) {
36
+ if ((0, utils_js_1.hasOpenreplayAttribute)(element, 'masked')) {
37
37
  return null;
38
38
  }
39
39
  element = element.parentElement;
@@ -59,7 +59,7 @@ function _getTarget(target) {
59
59
  tag === 'LI' ||
60
60
  element.onclick != null ||
61
61
  element.getAttribute('role') === 'button' ||
62
- utils_1.getLabelAttribute(element) !== null) {
62
+ (0, utils_js_1.getLabelAttribute)(element) !== null) {
63
63
  return element;
64
64
  }
65
65
  element = element.parentElement;
@@ -72,13 +72,13 @@ function default_1(app) {
72
72
  // opts,
73
73
  // );
74
74
  function getTargetLabel(target) {
75
- const dl = utils_1.getLabelAttribute(target);
75
+ const dl = (0, utils_js_1.getLabelAttribute)(target);
76
76
  if (dl !== null) {
77
77
  return dl;
78
78
  }
79
79
  const tag = target.tagName.toUpperCase();
80
80
  if (tag === 'INPUT') {
81
- return input_1.getInputLabel(target);
81
+ return (0, input_js_1.getInputLabel)(target);
82
82
  }
83
83
  if (tag === 'BUTTON' ||
84
84
  tag === 'A' ||
@@ -86,7 +86,7 @@ function default_1(app) {
86
86
  target.onclick != null ||
87
87
  target.getAttribute('role') === 'button') {
88
88
  const label = app.observer.getInnerTextSecure(target);
89
- return utils_1.normSpaces(label).slice(0, 100);
89
+ return (0, utils_js_1.normSpaces)(label).slice(0, 100);
90
90
  }
91
91
  return '';
92
92
  }
@@ -103,7 +103,7 @@ function default_1(app) {
103
103
  });
104
104
  const sendMouseMove = () => {
105
105
  if (mousePositionChanged) {
106
- app.send(new messages_1.MouseMove(mousePositionX, mousePositionY));
106
+ app.send(new index_js_1.MouseMove(mousePositionX, mousePositionY));
107
107
  mousePositionChanged = false;
108
108
  }
109
109
  };
@@ -131,7 +131,7 @@ function default_1(app) {
131
131
  const id = app.nodes.getID(target);
132
132
  if (id !== undefined) {
133
133
  sendMouseMove();
134
- app.send(new messages_1.MouseClick(id, mouseTarget === target
134
+ app.send(new index_js_1.MouseClick(id, mouseTarget === target
135
135
  ? Math.round(performance.now() - mouseTargetTime)
136
136
  : 0, getTargetLabel(target), getSelector(id, target)), true);
137
137
  }
@@ -1,4 +1,4 @@
1
- import App from '../app';
1
+ import App from "../app/index.js";
2
2
  export declare const deviceMemory: number;
3
3
  export declare const jsHeapSizeLimit: number;
4
4
  export interface Options {
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.jsHeapSizeLimit = exports.deviceMemory = void 0;
4
- const utils_1 = require("../utils");
5
- const messages_1 = require("../messages");
6
- const perf = utils_1.IN_BROWSER && 'performance' in window && 'memory' in performance // works in Chrome only
4
+ const utils_js_1 = require("../utils.js");
5
+ const index_js_1 = require("../messages/index.js");
6
+ const perf = utils_js_1.IN_BROWSER && 'performance' in window && 'memory' in performance // works in Chrome only
7
7
  ? performance
8
8
  : { memory: {} };
9
- exports.deviceMemory = utils_1.IN_BROWSER ? (navigator.deviceMemory || 0) * 1024 : 0;
9
+ exports.deviceMemory = utils_js_1.IN_BROWSER ? (navigator.deviceMemory || 0) * 1024 : 0;
10
10
  exports.jsHeapSizeLimit = perf.memory.jsHeapSizeLimit || 0;
11
11
  function default_1(app, opts) {
12
12
  const options = Object.assign({
@@ -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 messages_1.PerformanceTrack(frames, ticks, perf.memory.totalJSHeapSize || 0, perf.memory.usedJSHeapSize || 0));
37
+ app.send(new index_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,2 +1,2 @@
1
- import App from '../app';
1
+ import App from "../app/index.js";
2
2
  export default function (app: App): void;
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const messages_1 = require("../messages");
3
+ const index_js_1 = require("../messages/index.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 messages_1.SetViewportScroll(window.pageXOffset ||
7
+ const sendSetViewportScroll = app.safe(() => app.send(new index_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 messages_1.SetNodeScroll(id, s[0], s[1]));
17
+ app.send(new index_js_1.SetNodeScroll(id, s[0], s[1]));
18
18
  }
19
19
  });
20
20
  app.attachStartCallback(sendSetViewportScroll);
@@ -1,4 +1,4 @@
1
- import App from '../app';
1
+ import App from "../app/index.js";
2
2
  export interface Options {
3
3
  captureResourceTimings: boolean;
4
4
  capturePageLoadTimings: boolean;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const utils_1 = require("../utils");
4
- const messages_1 = require("../messages");
3
+ const utils_js_1 = require("../utils.js");
4
+ const index_js_1 = require("../messages/index.js");
5
5
  function getPaintBlocks(resources) {
6
6
  const paintBlocks = [];
7
7
  const elements = document.getElementsByTagName('*');
@@ -84,12 +84,12 @@ function default_1(app, opts) {
84
84
  });
85
85
  let resources = {};
86
86
  function resourceTiming(entry) {
87
- if (entry.duration < 0 || !utils_1.isURL(entry.name) || app.isServiceURL(entry.name))
87
+ if (entry.duration < 0 || !(0, utils_js_1.isURL)(entry.name) || app.isServiceURL(entry.name))
88
88
  return;
89
89
  if (resources !== null) {
90
90
  resources[entry.name] = entry.startTime + entry.duration;
91
91
  }
92
- sendOnStart(new messages_1.ResourceTiming(entry.startTime + performance.timing.navigationStart, entry.duration, entry.responseStart && entry.startTime
92
+ sendOnStart(new index_js_1.ResourceTiming(entry.startTime + performance.timing.navigationStart, entry.duration, entry.responseStart && entry.startTime
93
93
  ? entry.responseStart - entry.startTime
94
94
  : 0, entry.transferSize > entry.encodedBodySize
95
95
  ? entry.transferSize - entry.encodedBodySize
@@ -123,7 +123,7 @@ function default_1(app, opts) {
123
123
  if (performance.timing.loadEventEnd || performance.now() > 30000) {
124
124
  pageLoadTimingSent = true;
125
125
  const { navigationStart, requestStart, responseStart, responseEnd, domContentLoadedEventStart, domContentLoadedEventEnd, loadEventStart, loadEventEnd, } = performance.timing;
126
- app.send(new messages_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));
126
+ 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));
127
127
  }
128
128
  }, 30);
129
129
  }
@@ -160,7 +160,7 @@ function default_1(app, opts) {
160
160
  ? Math.max(interactiveWindowStartTime, firstContentfulPaint, performance.timing.domContentLoadedEventEnd -
161
161
  performance.timing.navigationStart || 0)
162
162
  : 0;
163
- app.send(new messages_1.PageRenderTiming(speedIndex, firstContentfulPaint > visuallyComplete
163
+ app.send(new index_js_1.PageRenderTiming(speedIndex, firstContentfulPaint > visuallyComplete
164
164
  ? firstContentfulPaint
165
165
  : visuallyComplete, timeToInteractive));
166
166
  }
@@ -1,2 +1,2 @@
1
- import App from '../app';
1
+ import App from "../app/index.js";
2
2
  export default function (app: App): void;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const messages_1 = require("../messages");
3
+ const index_js_1 = require("../messages/index.js");
4
4
  function default_1(app) {
5
5
  let url, width, height;
6
6
  let navigationStart = performance.timing.navigationStart;
@@ -8,7 +8,7 @@ function default_1(app) {
8
8
  const { URL } = document;
9
9
  if (URL !== url) {
10
10
  url = URL;
11
- app.send(new messages_1.SetPageLocation(url, document.referrer, navigationStart));
11
+ app.send(new index_js_1.SetPageLocation(url, document.referrer, navigationStart));
12
12
  navigationStart = 0;
13
13
  }
14
14
  });
@@ -17,12 +17,12 @@ function default_1(app) {
17
17
  if (innerWidth !== width || innerHeight !== height) {
18
18
  width = innerWidth;
19
19
  height = innerHeight;
20
- app.send(new messages_1.SetViewportSize(width, height));
20
+ app.send(new index_js_1.SetViewportSize(width, height));
21
21
  }
22
22
  });
23
23
  const sendSetPageVisibility = document.hidden === undefined
24
24
  ? Function.prototype
25
- : app.safe(() => app.send(new messages_1.SetPageVisibility(document.hidden)));
25
+ : app.safe(() => app.send(new index_js_1.SetPageVisibility(document.hidden)));
26
26
  app.attachStartCallback(() => {
27
27
  url = '';
28
28
  width = height = -1;
package/cjs/utils.js CHANGED
@@ -26,7 +26,7 @@ function deprecationWarn(nameOfFeature, useInstead, docsPath = "/") {
26
26
  if (warnedFeatures[nameOfFeature]) {
27
27
  return;
28
28
  }
29
- exports.warn(`OpenReplay: ${nameOfFeature} is deprecated. ${useInstead ? `Please, use ${useInstead} instead.` : ""} Visit ${exports.DOCS_HOST}${docsPath} for more information.`);
29
+ (0, exports.warn)(`OpenReplay: ${nameOfFeature} is deprecated. ${useInstead ? `Please, use ${useInstead} instead.` : ""} Visit ${exports.DOCS_HOST}${docsPath} for more information.`);
30
30
  warnedFeatures[nameOfFeature] = true;
31
31
  }
32
32
  exports.deprecationWarn = deprecationWarn;
@@ -1,9 +1,9 @@
1
- import Message from '../messages/message';
2
- import Nodes from './nodes';
3
- import Observer from './observer';
4
- import Ticker from './ticker';
5
- import type { Options as ObserverOptions } from './observer';
6
- import type { Options as WebworkerOptions } from '../messages/webworker';
1
+ import Message from "../messages/message.js";
2
+ import Nodes from "./nodes.js";
3
+ import Observer from "./observer.js";
4
+ import Ticker from "./ticker.js";
5
+ import type { Options as ObserverOptions } from "./observer.js";
6
+ import type { Options as WebworkerOptions } from "../messages/webworker.js";
7
7
  interface OnStartInfo {
8
8
  sessionID: string;
9
9
  sessionToken: string;
package/lib/app/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { timestamp, log, warn } from '../utils';
2
- import { Timestamp } from '../messages';
3
- import Nodes from './nodes';
4
- import Observer from './observer';
5
- import Ticker from './ticker';
6
- import { deviceMemory, jsHeapSizeLimit } from '../modules/performance';
1
+ import { timestamp, log, warn } from "../utils.js";
2
+ import { Timestamp } from "../messages/index.js";
3
+ import Nodes from "./nodes.js";
4
+ import Observer from "./observer.js";
5
+ import Ticker from "./ticker.js";
6
+ import { deviceMemory, jsHeapSizeLimit } from "../modules/performance.js";
7
7
  // TODO: use backendHost only
8
8
  export const DEFAULT_INGEST_POINT = 'https://api.openreplay.com/ingest';
9
9
  export default class App {
@@ -14,7 +14,7 @@ export default class App {
14
14
  this.commitCallbacks = [];
15
15
  this._sessionID = null;
16
16
  this.isActive = false;
17
- this.version = '3.4.7';
17
+ this.version = '3.4.8';
18
18
  this.projectKey = projectKey;
19
19
  this.options = Object.assign({
20
20
  revID: '',
@@ -1,4 +1,4 @@
1
- import App from './index';
1
+ import App from "./index.js";
2
2
  interface Window extends WindowProxy {
3
3
  HTMLInputElement: typeof HTMLInputElement;
4
4
  HTMLLinkElement: typeof HTMLLinkElement;
@@ -1,5 +1,5 @@
1
- import { stars, hasOpenreplayAttribute } from '../utils';
2
- import { CreateDocument, CreateElementNode, CreateTextNode, SetNodeData, SetCSSDataURLBased, SetNodeAttribute, SetNodeAttributeURLBased, RemoveNodeAttribute, MoveNode, RemoveNode, CreateIFrameDocument, } from '../messages';
1
+ import { stars, hasOpenreplayAttribute } from "../utils.js";
2
+ import { CreateDocument, CreateElementNode, CreateTextNode, SetNodeData, SetCSSDataURLBased, SetNodeAttribute, SetNodeAttributeURLBased, RemoveNodeAttribute, MoveNode, RemoveNode, CreateIFrameDocument, } from "../messages/index.js";
3
3
  function isSVGElement(node) {
4
4
  return node.namespaceURI === 'http://www.w3.org/2000/svg';
5
5
  }
@@ -167,6 +167,7 @@ export default class Observer {
167
167
  }
168
168
  this.app.send(new SetNodeAttribute(id, name, value));
169
169
  }
170
+ /* TODO: abstract sanitation */
170
171
  getInnerTextSecure(el) {
171
172
  const id = this.app.nodes.getID(el);
172
173
  if (!id) {
@@ -194,6 +195,7 @@ export default class Observer {
194
195
  data = this.checkObscure(id, data);
195
196
  this.app.send(new SetNodeData(id, data));
196
197
  }
198
+ /* end TODO: abstract sanitation */
197
199
  bindNode(node) {
198
200
  const r = this.app.nodes.registerNode(node);
199
201
  const id = r[0];
@@ -208,7 +210,9 @@ export default class Observer {
208
210
  acceptNode: (node) => this.isIgnored(node) || this.app.nodes.getID(node) !== undefined
209
211
  ? NodeFilter.FILTER_REJECT
210
212
  : NodeFilter.FILTER_ACCEPT,
211
- }, false);
213
+ },
214
+ // @ts-ignore
215
+ false);
212
216
  while (walker.nextNode()) {
213
217
  this.bindNode(walker.currentNode);
214
218
  }
@@ -1,4 +1,4 @@
1
- import App from './index';
1
+ import App from "./index.js";
2
2
  declare type Callback = () => void;
3
3
  export default class Ticker {
4
4
  private readonly app;
package/lib/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- import App from './app';
2
- export { default as App } from './app';
3
- import * as _Messages from './messages';
1
+ import App from "./app/index.js";
2
+ export { default as App } from './app/index.js';
3
+ import * as _Messages from "./messages/index.js";
4
4
  export declare const Messages: typeof _Messages;
5
- import { Options as AppOptions } from './app';
6
- import { Options as ConsoleOptions } from './modules/console';
7
- import { Options as ExceptionOptions } from './modules/exception';
8
- import { Options as InputOptions } from './modules/input';
9
- import { Options as PerformanceOptions } from './modules/performance';
10
- import { Options as TimingOptions } from './modules/timing';
5
+ import { Options as AppOptions } from "./app/index.js";
6
+ import { Options as ConsoleOptions } from "./modules/console.js";
7
+ import { Options as ExceptionOptions } from "./modules/exception.js";
8
+ import { Options as InputOptions } from "./modules/input.js";
9
+ import { Options as PerformanceOptions } from "./modules/performance.js";
10
+ import { Options as TimingOptions } from "./modules/timing.js";
11
11
  export declare type Options = Partial<AppOptions & ConsoleOptions & ExceptionOptions & InputOptions & PerformanceOptions & TimingOptions> & {
12
12
  projectID?: number;
13
13
  projectKey: string;