@openreplay/tracker 3.4.13 → 3.4.17-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 (45) hide show
  1. package/cjs/app/context.d.ts +18 -0
  2. package/cjs/app/context.js +48 -0
  3. package/cjs/app/index.d.ts +11 -6
  4. package/cjs/app/index.js +33 -22
  5. package/cjs/app/observer/iframe_observer.d.ts +4 -0
  6. package/cjs/app/observer/iframe_observer.js +22 -0
  7. package/cjs/app/observer/observer.d.ts +25 -0
  8. package/cjs/app/{observer.js → observer/observer.js} +82 -170
  9. package/cjs/app/observer/shadow_root_observer.d.ts +4 -0
  10. package/cjs/app/observer/shadow_root_observer.js +21 -0
  11. package/cjs/app/observer/top_observer.d.ts +15 -0
  12. package/cjs/app/observer/top_observer.js +84 -0
  13. package/cjs/app/sanitizer.d.ts +16 -0
  14. package/cjs/app/sanitizer.js +46 -0
  15. package/cjs/index.d.ts +1 -0
  16. package/cjs/index.js +7 -1
  17. package/cjs/modules/exception.js +8 -1
  18. package/cjs/modules/img.js +15 -1
  19. package/cjs/modules/input.d.ts +3 -1
  20. package/cjs/modules/input.js +6 -3
  21. package/cjs/modules/mouse.js +1 -1
  22. package/lib/app/context.d.ts +18 -0
  23. package/lib/app/context.js +43 -0
  24. package/lib/app/index.d.ts +11 -6
  25. package/lib/app/index.js +33 -22
  26. package/lib/app/observer/iframe_observer.d.ts +4 -0
  27. package/lib/app/observer/iframe_observer.js +19 -0
  28. package/lib/app/observer/observer.d.ts +25 -0
  29. package/lib/app/{observer.js → observer/observer.js} +82 -170
  30. package/lib/app/observer/shadow_root_observer.d.ts +4 -0
  31. package/lib/app/observer/shadow_root_observer.js +18 -0
  32. package/lib/app/observer/top_observer.d.ts +15 -0
  33. package/lib/app/observer/top_observer.js +81 -0
  34. package/lib/app/sanitizer.d.ts +16 -0
  35. package/lib/app/sanitizer.js +44 -1
  36. package/lib/index.d.ts +1 -0
  37. package/lib/index.js +7 -1
  38. package/lib/modules/exception.js +8 -1
  39. package/lib/modules/img.js +16 -2
  40. package/lib/modules/input.d.ts +3 -1
  41. package/lib/modules/input.js +6 -3
  42. package/lib/modules/mouse.js +1 -1
  43. package/package.json +1 -1
  44. package/cjs/app/observer.d.ts +0 -47
  45. package/lib/app/observer.d.ts +0 -47
@@ -1,6 +1,9 @@
1
1
  import { normSpaces, IN_BROWSER, getLabelAttribute, hasOpenreplayAttribute } from "../utils.js";
2
2
  import { SetInputTarget, SetInputValue, SetInputChecked } from "../messages/index.js";
3
- function isInput(node) {
3
+ function isTextEditable(node) {
4
+ if (node instanceof HTMLTextAreaElement) {
5
+ return true;
6
+ }
4
7
  if (!(node instanceof HTMLInputElement)) {
5
8
  return false;
6
9
  }
@@ -107,7 +110,7 @@ export default function (app, opts) {
107
110
  app.ticker.attach(() => {
108
111
  inputValues.forEach((value, id) => {
109
112
  const node = app.nodes.getNode(id);
110
- if (!isInput(node)) {
113
+ if (!isTextEditable(node)) {
111
114
  inputValues.delete(id);
112
115
  return;
113
116
  }
@@ -138,7 +141,7 @@ export default function (app, opts) {
138
141
  if (id === undefined) {
139
142
  return;
140
143
  }
141
- if (isInput(node)) {
144
+ if (isTextEditable(node)) {
142
145
  inputValues.set(id, node.value);
143
146
  sendInputValue(id, node);
144
147
  return;
@@ -83,7 +83,7 @@ export default function (app) {
83
83
  tag === 'LI' ||
84
84
  target.onclick != null ||
85
85
  target.getAttribute('role') === 'button') {
86
- const label = app.observer.getInnerTextSecure(target);
86
+ const label = app.sanitizer.getInnerTextSecure(target);
87
87
  return normSpaces(label).slice(0, 100);
88
88
  }
89
89
  return '';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@openreplay/tracker",
3
3
  "description": "The OpenReplay tracker main package",
4
- "version": "3.4.13",
4
+ "version": "3.4.17-beta.0",
5
5
  "keywords": [
6
6
  "logging",
7
7
  "replay"
@@ -1,47 +0,0 @@
1
- import App from "./index.js";
2
- interface Window extends WindowProxy {
3
- HTMLInputElement: typeof HTMLInputElement;
4
- HTMLLinkElement: typeof HTMLLinkElement;
5
- HTMLStyleElement: typeof HTMLStyleElement;
6
- SVGStyleElement: typeof SVGStyleElement;
7
- HTMLIFrameElement: typeof HTMLIFrameElement;
8
- Text: typeof Text;
9
- Element: typeof Element;
10
- }
11
- export interface Options {
12
- obscureTextEmails: boolean;
13
- obscureTextNumbers: boolean;
14
- captureIFrames: boolean;
15
- }
16
- export default class Observer {
17
- private readonly app;
18
- private readonly options;
19
- private readonly context;
20
- private readonly observer;
21
- private readonly commited;
22
- private readonly recents;
23
- private readonly indexes;
24
- private readonly attributesList;
25
- private readonly textSet;
26
- private readonly textMasked;
27
- constructor(app: App, options: Options, context?: Window);
28
- private clear;
29
- private isInstance;
30
- private isIgnored;
31
- private sendNodeAttribute;
32
- getInnerTextSecure(el: HTMLElement): string;
33
- private checkObscure;
34
- private sendNodeData;
35
- private bindNode;
36
- private bindTree;
37
- private unbindNode;
38
- private _commitNode;
39
- private commitNode;
40
- private commitNodes;
41
- private iframeObservers;
42
- private handleIframe;
43
- private observeIframe;
44
- observe(): void;
45
- disconnect(): void;
46
- }
47
- export {};
@@ -1,47 +0,0 @@
1
- import App from "./index.js";
2
- interface Window extends WindowProxy {
3
- HTMLInputElement: typeof HTMLInputElement;
4
- HTMLLinkElement: typeof HTMLLinkElement;
5
- HTMLStyleElement: typeof HTMLStyleElement;
6
- SVGStyleElement: typeof SVGStyleElement;
7
- HTMLIFrameElement: typeof HTMLIFrameElement;
8
- Text: typeof Text;
9
- Element: typeof Element;
10
- }
11
- export interface Options {
12
- obscureTextEmails: boolean;
13
- obscureTextNumbers: boolean;
14
- captureIFrames: boolean;
15
- }
16
- export default class Observer {
17
- private readonly app;
18
- private readonly options;
19
- private readonly context;
20
- private readonly observer;
21
- private readonly commited;
22
- private readonly recents;
23
- private readonly indexes;
24
- private readonly attributesList;
25
- private readonly textSet;
26
- private readonly textMasked;
27
- constructor(app: App, options: Options, context?: Window);
28
- private clear;
29
- private isInstance;
30
- private isIgnored;
31
- private sendNodeAttribute;
32
- getInnerTextSecure(el: HTMLElement): string;
33
- private checkObscure;
34
- private sendNodeData;
35
- private bindNode;
36
- private bindTree;
37
- private unbindNode;
38
- private _commitNode;
39
- private commitNode;
40
- private commitNodes;
41
- private iframeObservers;
42
- private handleIframe;
43
- private observeIframe;
44
- observe(): void;
45
- disconnect(): void;
46
- }
47
- export {};