monitor-track 1.11.0 → 1.12.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 +36 -0
- package/README.md +15 -5
- package/cjs/handlers/pv.d.ts +1 -0
- package/cjs/index.d.ts +4 -0
- package/cjs/index.js +1102 -1060
- package/cjs/reporter.d.ts +18 -7
- package/cjs/types/global.d.ts +16 -2
- package/cjs/types/index.d.ts +10 -5
- package/esm/config/global.js +15 -5
- package/esm/handlers/error.js +3 -3
- package/esm/handlers/pv.d.ts +1 -0
- package/esm/handlers/pv.js +17 -7
- package/esm/handlers/user-activity.js +2 -2
- package/esm/index.d.ts +4 -0
- package/esm/index.js +20 -4
- package/esm/package.json.js +1 -1
- package/esm/reporter.d.ts +18 -7
- package/esm/reporter.js +20 -10
- package/esm/types/global.d.ts +16 -2
- package/esm/types/index.d.ts +10 -5
- package/esm/utils/index.js +8 -12
- package/index.js +1454 -1410
- package/package.json +1 -1
package/esm/utils/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { __awaiter } from '../_virtual/_tslib.js';
|
|
2
2
|
import axios from 'axios';
|
|
3
|
-
import { v4 } from 'uuid';
|
|
4
3
|
import { UAParser } from 'ua-parser-js';
|
|
5
|
-
import {
|
|
6
|
-
import { setReportValue, getReport } from '../config/global.js';
|
|
7
|
-
import { report } from '../reporter.js';
|
|
8
|
-
import { Config } from '../config/index.js';
|
|
4
|
+
import { v4 } from 'uuid';
|
|
9
5
|
import { version } from '../package.json.js';
|
|
10
|
-
import {
|
|
6
|
+
import { Config } from '../config/index.js';
|
|
7
|
+
import { setReportValue, getReport } from '../config/global.js';
|
|
8
|
+
import { monitorTrackSessionId, monitorTrackId } from '../constant.js';
|
|
11
9
|
import { handleHistoryChange } from '../handlers/pv.js';
|
|
10
|
+
import { getUserEvents, getFullScreenShoot } from '../handlers/error.js';
|
|
11
|
+
import { report } from '../reporter.js';
|
|
12
12
|
|
|
13
13
|
const parser = new UAParser();
|
|
14
14
|
/**
|
|
@@ -195,9 +195,7 @@ const visualTrackFunc = () => {
|
|
|
195
195
|
timeout = setTimeout(() => {
|
|
196
196
|
timeout = null;
|
|
197
197
|
const url = location.href.split('?')[0];
|
|
198
|
-
axios
|
|
199
|
-
.get(`${Config.reportUrl.replace('/s/r', '')}/visual/get_data_list?url=${encodeURIComponent(url)}`)
|
|
200
|
-
.then((res) => {
|
|
198
|
+
axios.get(`${Config.reportUrl.replace('/s/r', '')}/visual/get_data_list?url=${encodeURIComponent(url)}`).then((res) => {
|
|
201
199
|
var _a, _b;
|
|
202
200
|
const listData = (_b = (_a = res.data.result) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.dataList;
|
|
203
201
|
if (Array.isArray(listData)) {
|
|
@@ -207,9 +205,7 @@ const visualTrackFunc = () => {
|
|
|
207
205
|
visualReportEvent(item);
|
|
208
206
|
}
|
|
209
207
|
else {
|
|
210
|
-
const element = document
|
|
211
|
-
.evaluate(formatTrackElementXPath(item.trackElementXPath), document)
|
|
212
|
-
.iterateNext();
|
|
208
|
+
const element = document.evaluate(formatTrackElementXPath(item.trackElementXPath), document).iterateNext();
|
|
213
209
|
const key = url + item.trackElementXPath;
|
|
214
210
|
if (element) {
|
|
215
211
|
if (!existTrackListenEvent[key]) {
|