@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.
- package/cjs/app/context.d.ts +18 -0
- package/cjs/app/context.js +48 -0
- package/cjs/app/index.d.ts +11 -6
- package/cjs/app/index.js +33 -22
- package/cjs/app/observer/iframe_observer.d.ts +4 -0
- package/cjs/app/observer/iframe_observer.js +22 -0
- package/cjs/app/observer/observer.d.ts +25 -0
- package/cjs/app/{observer.js → observer/observer.js} +82 -170
- package/cjs/app/observer/shadow_root_observer.d.ts +4 -0
- package/cjs/app/observer/shadow_root_observer.js +21 -0
- package/cjs/app/observer/top_observer.d.ts +15 -0
- package/cjs/app/observer/top_observer.js +84 -0
- package/cjs/app/sanitizer.d.ts +16 -0
- package/cjs/app/sanitizer.js +46 -0
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +7 -1
- package/cjs/modules/exception.js +8 -1
- package/cjs/modules/img.js +15 -1
- package/cjs/modules/input.d.ts +3 -1
- package/cjs/modules/input.js +6 -3
- package/cjs/modules/mouse.js +1 -1
- package/lib/app/context.d.ts +18 -0
- package/lib/app/context.js +43 -0
- package/lib/app/index.d.ts +11 -6
- package/lib/app/index.js +33 -22
- package/lib/app/observer/iframe_observer.d.ts +4 -0
- package/lib/app/observer/iframe_observer.js +19 -0
- package/lib/app/observer/observer.d.ts +25 -0
- package/lib/app/{observer.js → observer/observer.js} +82 -170
- package/lib/app/observer/shadow_root_observer.d.ts +4 -0
- package/lib/app/observer/shadow_root_observer.js +18 -0
- package/lib/app/observer/top_observer.d.ts +15 -0
- package/lib/app/observer/top_observer.js +81 -0
- package/lib/app/sanitizer.d.ts +16 -0
- package/lib/app/sanitizer.js +44 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +7 -1
- package/lib/modules/exception.js +8 -1
- package/lib/modules/img.js +16 -2
- package/lib/modules/input.d.ts +3 -1
- package/lib/modules/input.js +6 -3
- package/lib/modules/mouse.js +1 -1
- package/package.json +1 -1
- package/cjs/app/observer.d.ts +0 -47
- package/lib/app/observer.d.ts +0 -47
package/lib/modules/input.js
CHANGED
|
@@ -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
|
|
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 (!
|
|
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 (
|
|
144
|
+
if (isTextEditable(node)) {
|
|
142
145
|
inputValues.set(id, node.value);
|
|
143
146
|
sendInputValue(id, node);
|
|
144
147
|
return;
|
package/lib/modules/mouse.js
CHANGED
|
@@ -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.
|
|
86
|
+
const label = app.sanitizer.getInnerTextSecure(target);
|
|
87
87
|
return normSpaces(label).slice(0, 100);
|
|
88
88
|
}
|
|
89
89
|
return '';
|
package/package.json
CHANGED
package/cjs/app/observer.d.ts
DELETED
|
@@ -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 {};
|
package/lib/app/observer.d.ts
DELETED
|
@@ -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 {};
|