anys-web 6.4.0 → 7.0.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/package.json +20 -20
- package/src/tracer-plugin.js +0 -63
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anys-web",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -12,27 +12,27 @@
|
|
|
12
12
|
"author": "tangshuang",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"anys": "^
|
|
16
|
-
"anys-plugin-store-memory": "^
|
|
17
|
-
"anys-shared": "^
|
|
18
|
-
"anys-web-plugin-identify": "^
|
|
19
|
-
"anys-web-plugin-monitor-ajax": "^
|
|
20
|
-
"anys-web-plugin-monitor-dom-mutation": "^
|
|
21
|
-
"anys-web-plugin-monitor-error": "^
|
|
22
|
-
"anys-web-plugin-monitor-input-event": "^
|
|
23
|
-
"anys-web-plugin-monitor-mouse-event": "^
|
|
24
|
-
"anys-web-plugin-monitor-performance": "^
|
|
25
|
-
"anys-web-plugin-monitor-scroll-event": "^
|
|
26
|
-
"anys-web-plugin-monitor-touch-event": "^
|
|
27
|
-
"anys-web-plugin-monitor-url": "^
|
|
28
|
-
"anys-web-plugin-monitor-window-activity": "^
|
|
29
|
-
"anys-web-plugin-monitor-window-size": "^
|
|
30
|
-
"anys-web-plugin-send-by-ajax": "^
|
|
31
|
-
"anys-web-plugin-send-by-beacon": "^
|
|
32
|
-
"anys-web-plugin-store-offline": "^
|
|
15
|
+
"anys": "^7.0.0",
|
|
16
|
+
"anys-plugin-store-memory": "^7.0.0",
|
|
17
|
+
"anys-shared": "^7.0.0",
|
|
18
|
+
"anys-web-plugin-identify": "^7.0.0",
|
|
19
|
+
"anys-web-plugin-monitor-ajax": "^7.0.0",
|
|
20
|
+
"anys-web-plugin-monitor-dom-mutation": "^7.0.0",
|
|
21
|
+
"anys-web-plugin-monitor-error": "^7.0.0",
|
|
22
|
+
"anys-web-plugin-monitor-input-event": "^7.0.0",
|
|
23
|
+
"anys-web-plugin-monitor-mouse-event": "^7.0.0",
|
|
24
|
+
"anys-web-plugin-monitor-performance": "^7.0.0",
|
|
25
|
+
"anys-web-plugin-monitor-scroll-event": "^7.0.0",
|
|
26
|
+
"anys-web-plugin-monitor-touch-event": "^7.0.0",
|
|
27
|
+
"anys-web-plugin-monitor-url": "^7.0.0",
|
|
28
|
+
"anys-web-plugin-monitor-window-activity": "^7.0.0",
|
|
29
|
+
"anys-web-plugin-monitor-window-size": "^7.0.0",
|
|
30
|
+
"anys-web-plugin-send-by-ajax": "^7.0.0",
|
|
31
|
+
"anys-web-plugin-send-by-beacon": "^7.0.0",
|
|
32
|
+
"anys-web-plugin-store-offline": "^7.0.0"
|
|
33
33
|
},
|
|
34
34
|
"publishConfig": {
|
|
35
35
|
"registry": "https://registry.npmjs.org/"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "3cd679df14e725098c6bdf0622cc1b20d52c910d"
|
|
38
38
|
}
|
package/src/tracer-plugin.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { AnysPlugin } from 'anys-shared';
|
|
2
|
-
import { AnysIdentifyPlugin } from 'anys-web-plugin-identify';
|
|
3
|
-
import { AnysMonitorInputEventPlugin } from 'anys-web-plugin-monitor-input-event';
|
|
4
|
-
import { AnysMonitorMouseEventPlugin } from 'anys-web-plugin-monitor-mouse-event';
|
|
5
|
-
import { AnysMonitorWindowActivityPlugin } from 'anys-web-plugin-monitor-window-activity';
|
|
6
|
-
import { AnysMonitorUrlPlugin } from 'anys-web-plugin-monitor-url';
|
|
7
|
-
import { AnysMonitorTouchEventPlugin } from 'anys-web-plugin-monitor-touch-event';
|
|
8
|
-
import { AnysMonitorDOMMutationPlugin } from 'anys-web-plugin-monitor-dom-mutation';
|
|
9
|
-
import { AnysMonitorWindowSizePlugin } from 'anys-web-plugin-monitor-window-size';
|
|
10
|
-
import { AnysMonitorScrollEventPlugin } from 'anys-web-plugin-monitor-scroll-event';
|
|
11
|
-
import { AnysStoreMemoryPlugin } from 'anys-plugin-store-memory';
|
|
12
|
-
import { AnysSendByBeaconPlugin } from 'anys-web-plugin-send-by-beacon';
|
|
13
|
-
|
|
14
|
-
export class AnysTracerPlugin extends AnysPlugin {
|
|
15
|
-
static dependencies = [
|
|
16
|
-
AnysMonitorUrlPlugin,
|
|
17
|
-
AnysMonitorWindowSizePlugin,
|
|
18
|
-
AnysMonitorDOMMutationPlugin,
|
|
19
|
-
AnysIdentifyPlugin,
|
|
20
|
-
AnysMonitorInputEventPlugin,
|
|
21
|
-
AnysMonitorMouseEventPlugin,
|
|
22
|
-
AnysMonitorWindowActivityPlugin,
|
|
23
|
-
AnysMonitorTouchEventPlugin,
|
|
24
|
-
AnysMonitorScrollEventPlugin,
|
|
25
|
-
AnysStoreMemoryPlugin,
|
|
26
|
-
AnysSendByBeaconPlugin,
|
|
27
|
-
];
|
|
28
|
-
|
|
29
|
-
options() {
|
|
30
|
-
const isSupportTouch = 'ontouchend' in document;
|
|
31
|
-
return {
|
|
32
|
-
touch: isSupportTouch,
|
|
33
|
-
mouse: !isSupportTouch,
|
|
34
|
-
click: false,
|
|
35
|
-
mousedown: true,
|
|
36
|
-
mousemove: true,
|
|
37
|
-
mouseup: true,
|
|
38
|
-
autoReport: true,
|
|
39
|
-
reportUrl: new Error('options.reportUrl is required!'),
|
|
40
|
-
reportInterval: 5000,
|
|
41
|
-
reportParams: null,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
registerAutoReport() {
|
|
46
|
-
let isUnloaded = 0;
|
|
47
|
-
const sendBeaconWhenBeforeUnload = () => {
|
|
48
|
-
if (isUnloaded) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
isUnloaded = 1;
|
|
52
|
-
|
|
53
|
-
this.anys.report();
|
|
54
|
-
};
|
|
55
|
-
window.addEventListener('beforeunload', sendBeaconWhenBeforeUnload);
|
|
56
|
-
window.addEventListener('pagehide', sendBeaconWhenBeforeUnload); // 兼容微信浏览器
|
|
57
|
-
window.addEventListener('unload', sendBeaconWhenBeforeUnload);
|
|
58
|
-
|
|
59
|
-
return () => {
|
|
60
|
-
window.removeEventListener('beforeunload', sendBeaconWhenBeforeUnload);
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
}
|