auto-point 0.0.19 → 0.0.21
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/AP/auto_point.js +5 -4
- package/package.json +1 -1
package/AP/auto_point.js
CHANGED
|
@@ -167,10 +167,10 @@
|
|
|
167
167
|
})
|
|
168
168
|
// 挂载页面离开事件监听
|
|
169
169
|
window.addEventListener('visibilitychange', () => {
|
|
170
|
-
if (navigator && navigator.sendBeacon
|
|
171
|
-
let type = "
|
|
172
|
-
let value =
|
|
173
|
-
let describe = "Webpage
|
|
170
|
+
if (navigator && navigator.sendBeacon) {
|
|
171
|
+
let type = "visibilitychange"
|
|
172
|
+
let value = document.visibilityState
|
|
173
|
+
let describe = "Webpage visibility state is changed to: " + document.visibilityState
|
|
174
174
|
this.#add_point(this.#create_active_point_data(type, value, describe))
|
|
175
175
|
this.#send()
|
|
176
176
|
}
|
|
@@ -196,6 +196,7 @@
|
|
|
196
196
|
item.apply(this)
|
|
197
197
|
}
|
|
198
198
|
})
|
|
199
|
+
this.#POINT_LAST_SEND_TIME = new Date().getTime() // 更新最后发送时间
|
|
199
200
|
navigator.sendBeacon(this.#SERVER, JSON.stringify(this.#POINT_LIST));
|
|
200
201
|
// 发送后清空埋点列表数据
|
|
201
202
|
this.#POINT_LIST = new Array()
|
package/package.json
CHANGED