anys-web 6.4.0 → 7.0.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.
Files changed (2) hide show
  1. package/package.json +20 -20
  2. package/src/tracer-plugin.js +0 -63
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anys-web",
3
- "version": "6.4.0",
3
+ "version": "7.0.1",
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": "^6.4.0",
16
- "anys-plugin-store-memory": "^6.4.0",
17
- "anys-shared": "^6.4.0",
18
- "anys-web-plugin-identify": "^6.4.0",
19
- "anys-web-plugin-monitor-ajax": "^6.4.0",
20
- "anys-web-plugin-monitor-dom-mutation": "^6.4.0",
21
- "anys-web-plugin-monitor-error": "^6.4.0",
22
- "anys-web-plugin-monitor-input-event": "^6.4.0",
23
- "anys-web-plugin-monitor-mouse-event": "^6.4.0",
24
- "anys-web-plugin-monitor-performance": "^6.4.0",
25
- "anys-web-plugin-monitor-scroll-event": "^6.4.0",
26
- "anys-web-plugin-monitor-touch-event": "^6.4.0",
27
- "anys-web-plugin-monitor-url": "^6.4.0",
28
- "anys-web-plugin-monitor-window-activity": "^6.4.0",
29
- "anys-web-plugin-monitor-window-size": "^6.4.0",
30
- "anys-web-plugin-send-by-ajax": "^6.4.0",
31
- "anys-web-plugin-send-by-beacon": "^6.4.0",
32
- "anys-web-plugin-store-offline": "^6.4.0"
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.1",
31
+ "anys-web-plugin-send-by-beacon": "^7.0.1",
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": "b917a175c4434546544756f32d7b71102d058162"
37
+ "gitHead": "fece86b7db710354ad998a3406105d88b13cd533"
38
38
  }
@@ -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
- }