Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 重构部分代码并增加 sendBeacon 的 hook #72

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kamilic
Copy link

@kamilic kamilic commented Dec 26, 2021

你好,感谢你的这套方案。
我们在使用过程中发现这套方案并不支持发 sendBeacon 的请求,使用 navigator.sendBeacon 的时候依旧会丢 body(我们的跳出率统计 sdk 会使用 SendBeacon,因为它能够保证用户关闭 webview 窗口之后也能发起请求)。
因此我们基于你们的方案增加了对 navigator.sendBeacon 的支持。

另外因为希望 sendBeacon 能够与 ajaxHook 共用一个 body 处理方法,免得维护困难,我们对原来的功能做了一点点重构。
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon

@kamilic kamilic force-pushed the add-send-beacon-hook branch from dfb274e to 2f69163 Compare December 26, 2021 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant