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.
@@ -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 { monitorTrackSessionId, monitorTrackId } from '../constant.js';
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 { getUserEvents, getFullScreenShoot } from '../handlers/error.js';
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]) {