@openreplay/tracker 5.0.0 → 5.0.1-beta.1
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/CHANGELOG.md +5 -0
- package/cjs/app/index.js +1 -1
- package/cjs/index.js +1 -1
- package/cjs/modules/input.js +1 -1
- package/cjs/modules/mouse.js +8 -18
- package/lib/app/index.js +1 -1
- package/lib/index.js +1 -1
- package/lib/modules/input.js +1 -1
- package/lib/modules/mouse.js +8 -18
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
package/cjs/app/index.js
CHANGED
|
@@ -33,7 +33,7 @@ class App {
|
|
|
33
33
|
this.stopCallbacks = [];
|
|
34
34
|
this.commitCallbacks = [];
|
|
35
35
|
this.activityState = ActivityState.NotActive;
|
|
36
|
-
this.version = '5.0.
|
|
36
|
+
this.version = '5.0.1-beta.1'; // TODO: version compatability check inside each plugin.
|
|
37
37
|
this._usingOldFetchPlugin = false;
|
|
38
38
|
this.delay = 0;
|
|
39
39
|
this.projectKey = projectKey;
|
package/cjs/index.js
CHANGED
|
@@ -140,7 +140,7 @@ class API {
|
|
|
140
140
|
// no-cors issue only with text/plain or not-set Content-Type
|
|
141
141
|
// req.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
|
|
142
142
|
req.send(JSON.stringify({
|
|
143
|
-
trackerVersion: '5.0.
|
|
143
|
+
trackerVersion: '5.0.1-beta.1',
|
|
144
144
|
projectKey: options.projectKey,
|
|
145
145
|
doNotTrack,
|
|
146
146
|
// TODO: add precise reason (an exact API missing)
|
package/cjs/modules/input.js
CHANGED
|
@@ -68,7 +68,7 @@ function default_1(app, opts) {
|
|
|
68
68
|
const options = Object.assign({
|
|
69
69
|
obscureInputNumbers: true,
|
|
70
70
|
obscureInputEmails: true,
|
|
71
|
-
defaultInputMode:
|
|
71
|
+
defaultInputMode: 1 /* InputMode.Obscured */,
|
|
72
72
|
obscureInputDates: false,
|
|
73
73
|
}, opts);
|
|
74
74
|
function sendInputTarget(id, node) {
|
package/cjs/modules/mouse.js
CHANGED
|
@@ -4,25 +4,15 @@ const guards_js_1 = require("../app/guards.js");
|
|
|
4
4
|
const utils_js_1 = require("../utils.js");
|
|
5
5
|
const messages_gen_js_1 = require("../app/messages.gen.js");
|
|
6
6
|
const input_js_1 = require("./input.js");
|
|
7
|
+
const finder_1 = require("@medv/finder");
|
|
7
8
|
function _getSelector(target, document) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
el.className
|
|
16
|
-
.split(' ')
|
|
17
|
-
.map((cn) => cn.trim())
|
|
18
|
-
.filter((cn) => cn !== '')
|
|
19
|
-
.reduce((sel, cn) => `${sel}.${cn}`, el.tagName.toLowerCase()) +
|
|
20
|
-
(selector ? ` > ${selector}` : '');
|
|
21
|
-
if (el === document.body) {
|
|
22
|
-
return selector;
|
|
23
|
-
}
|
|
24
|
-
el = el.parentElement;
|
|
25
|
-
} while (el !== document.body && el !== null);
|
|
9
|
+
const selector = (0, finder_1.finder)(target, {
|
|
10
|
+
root: document.body,
|
|
11
|
+
seedMinLength: 3,
|
|
12
|
+
optimizedMinLength: 2,
|
|
13
|
+
threshold: 1000,
|
|
14
|
+
maxNumberOfTries: 10000,
|
|
15
|
+
});
|
|
26
16
|
return selector;
|
|
27
17
|
}
|
|
28
18
|
function isClickable(element) {
|
package/lib/app/index.js
CHANGED
|
@@ -30,7 +30,7 @@ export default class App {
|
|
|
30
30
|
this.stopCallbacks = [];
|
|
31
31
|
this.commitCallbacks = [];
|
|
32
32
|
this.activityState = ActivityState.NotActive;
|
|
33
|
-
this.version = '5.0.
|
|
33
|
+
this.version = '5.0.1-beta.1'; // TODO: version compatability check inside each plugin.
|
|
34
34
|
this._usingOldFetchPlugin = false;
|
|
35
35
|
this.delay = 0;
|
|
36
36
|
this.projectKey = projectKey;
|
package/lib/index.js
CHANGED
|
@@ -135,7 +135,7 @@ export default class API {
|
|
|
135
135
|
// no-cors issue only with text/plain or not-set Content-Type
|
|
136
136
|
// req.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
|
|
137
137
|
req.send(JSON.stringify({
|
|
138
|
-
trackerVersion: '5.0.
|
|
138
|
+
trackerVersion: '5.0.1-beta.1',
|
|
139
139
|
projectKey: options.projectKey,
|
|
140
140
|
doNotTrack,
|
|
141
141
|
// TODO: add precise reason (an exact API missing)
|
package/lib/modules/input.js
CHANGED
|
@@ -64,7 +64,7 @@ export default function (app, opts) {
|
|
|
64
64
|
const options = Object.assign({
|
|
65
65
|
obscureInputNumbers: true,
|
|
66
66
|
obscureInputEmails: true,
|
|
67
|
-
defaultInputMode:
|
|
67
|
+
defaultInputMode: 1 /* InputMode.Obscured */,
|
|
68
68
|
obscureInputDates: false,
|
|
69
69
|
}, opts);
|
|
70
70
|
function sendInputTarget(id, node) {
|
package/lib/modules/mouse.js
CHANGED
|
@@ -2,25 +2,15 @@ import { hasTag, isSVGElement, isDocument } from '../app/guards.js';
|
|
|
2
2
|
import { normSpaces, hasOpenreplayAttribute, getLabelAttribute } from '../utils.js';
|
|
3
3
|
import { MouseMove, MouseClick } from '../app/messages.gen.js';
|
|
4
4
|
import { getInputLabel } from './input.js';
|
|
5
|
+
import { finder } from '@medv/finder';
|
|
5
6
|
function _getSelector(target, document) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
el.className
|
|
14
|
-
.split(' ')
|
|
15
|
-
.map((cn) => cn.trim())
|
|
16
|
-
.filter((cn) => cn !== '')
|
|
17
|
-
.reduce((sel, cn) => `${sel}.${cn}`, el.tagName.toLowerCase()) +
|
|
18
|
-
(selector ? ` > ${selector}` : '');
|
|
19
|
-
if (el === document.body) {
|
|
20
|
-
return selector;
|
|
21
|
-
}
|
|
22
|
-
el = el.parentElement;
|
|
23
|
-
} while (el !== document.body && el !== null);
|
|
7
|
+
const selector = finder(target, {
|
|
8
|
+
root: document.body,
|
|
9
|
+
seedMinLength: 3,
|
|
10
|
+
optimizedMinLength: 2,
|
|
11
|
+
threshold: 1000,
|
|
12
|
+
maxNumberOfTries: 10000,
|
|
13
|
+
});
|
|
24
14
|
return selector;
|
|
25
15
|
}
|
|
26
16
|
function isClickable(element) {
|
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": "5.0.
|
|
4
|
+
"version": "5.0.1-beta.1",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"logging",
|
|
7
7
|
"replay"
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"typescript": "^4.9.4"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
+
"@medv/finder": "^3.0.0",
|
|
50
51
|
"error-stack-parser": "^2.0.6"
|
|
51
52
|
},
|
|
52
53
|
"engines": {
|