@openreplay/tracker 9.0.9 → 9.0.11-beta.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.
Files changed (77) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/cjs/app/index.js +1 -1
  3. package/cjs/index.js +17 -2
  4. package/cjs/modules/timing.d.ts +1 -0
  5. package/cjs/modules/timing.js +7 -0
  6. package/coverage/clover.xml +3426 -0
  7. package/coverage/coverage-final.json +50 -0
  8. package/coverage/lcov-report/base.css +224 -0
  9. package/coverage/lcov-report/block-navigation.js +87 -0
  10. package/coverage/lcov-report/favicon.png +0 -0
  11. package/coverage/lcov-report/index.html +206 -0
  12. package/coverage/lcov-report/main/app/guards.ts.html +229 -0
  13. package/coverage/lcov-report/main/app/index.html +221 -0
  14. package/coverage/lcov-report/main/app/index.ts.html +2182 -0
  15. package/coverage/lcov-report/main/app/logger.ts.html +277 -0
  16. package/coverage/lcov-report/main/app/messages.gen.ts.html +2827 -0
  17. package/coverage/lcov-report/main/app/nodes.ts.html +385 -0
  18. package/coverage/lcov-report/main/app/observer/iframe_observer.ts.html +148 -0
  19. package/coverage/lcov-report/main/app/observer/iframe_offsets.ts.html +289 -0
  20. package/coverage/lcov-report/main/app/observer/index.html +161 -0
  21. package/coverage/lcov-report/main/app/observer/shadow_root_observer.ts.html +142 -0
  22. package/coverage/lcov-report/main/app/observer/top_observer.ts.html +538 -0
  23. package/coverage/lcov-report/main/app/sanitizer.ts.html +394 -0
  24. package/coverage/lcov-report/main/app/session.ts.html +601 -0
  25. package/coverage/lcov-report/main/app/ticker.ts.html +250 -0
  26. package/coverage/lcov-report/main/index.html +131 -0
  27. package/coverage/lcov-report/main/index.ts.html +1213 -0
  28. package/coverage/lcov-report/main/modules/Network/beaconProxy.ts.html +391 -0
  29. package/coverage/lcov-report/main/modules/Network/fetchProxy.ts.html +1027 -0
  30. package/coverage/lcov-report/main/modules/Network/index.html +191 -0
  31. package/coverage/lcov-report/main/modules/Network/index.ts.html +244 -0
  32. package/coverage/lcov-report/main/modules/Network/networkMessage.ts.html +385 -0
  33. package/coverage/lcov-report/main/modules/Network/utils.ts.html +700 -0
  34. package/coverage/lcov-report/main/modules/Network/xhrProxy.ts.html +850 -0
  35. package/coverage/lcov-report/main/modules/attributeSender.ts.html +232 -0
  36. package/coverage/lcov-report/main/modules/axiosSpy.ts.html +709 -0
  37. package/coverage/lcov-report/main/modules/connection.ts.html +160 -0
  38. package/coverage/lcov-report/main/modules/console.ts.html +541 -0
  39. package/coverage/lcov-report/main/modules/constructedStyleSheets.ts.html +559 -0
  40. package/coverage/lcov-report/main/modules/cssrules.ts.html +418 -0
  41. package/coverage/lcov-report/main/modules/exception.ts.html +385 -0
  42. package/coverage/lcov-report/main/modules/featureFlags.ts.html +412 -0
  43. package/coverage/lcov-report/main/modules/focus.ts.html +220 -0
  44. package/coverage/lcov-report/main/modules/fonts.ts.html +289 -0
  45. package/coverage/lcov-report/main/modules/img.ts.html +433 -0
  46. package/coverage/lcov-report/main/modules/index.html +401 -0
  47. package/coverage/lcov-report/main/modules/input.ts.html +826 -0
  48. package/coverage/lcov-report/main/modules/mouse.ts.html +826 -0
  49. package/coverage/lcov-report/main/modules/network.ts.html +1123 -0
  50. package/coverage/lcov-report/main/modules/performance.ts.html +367 -0
  51. package/coverage/lcov-report/main/modules/scroll.ts.html +364 -0
  52. package/coverage/lcov-report/main/modules/selection.ts.html +202 -0
  53. package/coverage/lcov-report/main/modules/tabs.ts.html +124 -0
  54. package/coverage/lcov-report/main/modules/timing.ts.html +841 -0
  55. package/coverage/lcov-report/main/modules/userTesting/dnd.ts.html +232 -0
  56. package/coverage/lcov-report/main/modules/userTesting/index.html +161 -0
  57. package/coverage/lcov-report/main/modules/userTesting/index.ts.html +1210 -0
  58. package/coverage/lcov-report/main/modules/userTesting/recorder.ts.html +361 -0
  59. package/coverage/lcov-report/main/modules/userTesting/styles.ts.html +865 -0
  60. package/coverage/lcov-report/main/modules/viewport.ts.html +250 -0
  61. package/coverage/lcov-report/main/utils.ts.html +406 -0
  62. package/coverage/lcov-report/prettify.css +1 -0
  63. package/coverage/lcov-report/prettify.js +2 -0
  64. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  65. package/coverage/lcov-report/sorter.js +196 -0
  66. package/coverage/lcov-report/webworker/BatchWriter.ts.html +481 -0
  67. package/coverage/lcov-report/webworker/MessageEncoder.gen.ts.html +961 -0
  68. package/coverage/lcov-report/webworker/PrimitiveEncoder.ts.html +436 -0
  69. package/coverage/lcov-report/webworker/QueueSender.ts.html +505 -0
  70. package/coverage/lcov-report/webworker/index.html +176 -0
  71. package/coverage/lcov-report/webworker/index.ts.html +628 -0
  72. package/coverage/lcov.info +6631 -0
  73. package/lib/app/index.js +1 -1
  74. package/lib/index.js +17 -2
  75. package/lib/modules/timing.d.ts +1 -0
  76. package/lib/modules/timing.js +7 -0
  77. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # 9.0.11
2
+
3
+ - fix window.open issue with sessionStorage being inherited (replicating tabId bug)
4
+
5
+ # 9.0.10
6
+
7
+ - added `excludedResourceUrls` to timings options to better sanitize network data
8
+
1
9
  # 9.0.9
2
10
 
3
11
  - Fix for `{disableStringDict: true}` behavior
package/cjs/app/index.js CHANGED
@@ -42,7 +42,7 @@ class App {
42
42
  this.stopCallbacks = [];
43
43
  this.commitCallbacks = [];
44
44
  this.activityState = ActivityState.NotActive;
45
- this.version = '9.0.9'; // TODO: version compatability check inside each plugin.
45
+ this.version = '9.0.11-beta.0'; // TODO: version compatability check inside each plugin.
46
46
  this.compressionThreshold = 24 * 1000;
47
47
  this.restartAttempts = 0;
48
48
  this.bc = null;
package/cjs/index.js CHANGED
@@ -130,8 +130,8 @@ class API {
130
130
  }
131
131
  void this.featureFlags.reloadFlags();
132
132
  });
133
+ const wOpen = window.open;
133
134
  if (options.autoResetOnWindowOpen) {
134
- const wOpen = window.open;
135
135
  app.attachStartCallback(() => {
136
136
  // @ts-ignore ?
137
137
  window.open = function (...args) {
@@ -144,6 +144,21 @@ class API {
144
144
  window.open = wOpen;
145
145
  });
146
146
  }
147
+ else {
148
+ app.attachStartCallback(() => {
149
+ // this function causes new tab to inherit sessionStorage completely,
150
+ // we don't really want that so we remove tabId for a short period
151
+ // @ts-ignore
152
+ window.open = function (...args) {
153
+ var _a;
154
+ const tabId = app.getTabId();
155
+ const sessStorage = (_a = app.sessionStorage) !== null && _a !== void 0 ? _a : window.sessionStorage;
156
+ sessStorage.removeItem(options.session_tabid_key || '__openreplay_tabid');
157
+ wOpen.call(window, ...args);
158
+ sessStorage.setItem(options.session_tabid_key || '__openreplay_tabid', tabId);
159
+ };
160
+ });
161
+ }
147
162
  }
148
163
  else {
149
164
  console.log("OpenReplay: browser doesn't support API required for tracking or doNotTrack is set to 1.");
@@ -153,7 +168,7 @@ class API {
153
168
  // no-cors issue only with text/plain or not-set Content-Type
154
169
  // req.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
155
170
  req.send(JSON.stringify({
156
- trackerVersion: '9.0.9',
171
+ trackerVersion: '9.0.11-beta.0',
157
172
  projectKey: options.projectKey,
158
173
  doNotTrack,
159
174
  // TODO: add precise reason (an exact API missing)
@@ -3,5 +3,6 @@ export interface Options {
3
3
  captureResourceTimings: boolean;
4
4
  capturePageLoadTimings: boolean;
5
5
  capturePageRenderTimings: boolean;
6
+ excludedResourceUrls?: Array<string>;
6
7
  }
7
8
  export default function (app: App, opts: Partial<Options>): void;
@@ -61,6 +61,7 @@ function default_1(app, opts) {
61
61
  captureResourceTimings: true,
62
62
  capturePageLoadTimings: true,
63
63
  capturePageRenderTimings: true,
64
+ excludedResourceUrls: [],
64
65
  }, opts);
65
66
  if (!('PerformanceObserver' in window)) {
66
67
  options.captureResourceTimings = false;
@@ -70,11 +71,17 @@ function default_1(app, opts) {
70
71
  } // Resources are necessary for all timings
71
72
  let resources = {};
72
73
  function resourceTiming(entry) {
74
+ var _a;
73
75
  if (entry.duration < 0 || !(0, utils_js_1.isURL)(entry.name) || app.isServiceURL(entry.name))
74
76
  return;
75
77
  if (resources !== null) {
76
78
  resources[entry.name] = entry.startTime + entry.duration;
77
79
  }
80
+ (_a = options.excludedResourceUrls) === null || _a === void 0 ? void 0 : _a.forEach((url) => {
81
+ if (entry.name.startsWith(url)) {
82
+ return;
83
+ }
84
+ });
78
85
  app.send((0, messages_gen_js_1.ResourceTiming)(entry.startTime + (0, utils_js_1.getTimeOrigin)(), entry.duration, entry.responseStart && entry.startTime ? entry.responseStart - entry.startTime : 0, entry.transferSize > entry.encodedBodySize ? entry.transferSize - entry.encodedBodySize : 0, entry.encodedBodySize || 0, entry.decodedBodySize || 0, entry.name, entry.initiatorType, entry.transferSize,
79
86
  // @ts-ignore
80
87
  (entry.responseStatus && entry.responseStatus === 304) || entry.transferSize === 0));