Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
你好,感谢你的这套方案。
我们在使用过程中发现这套方案并不支持发 sendBeacon 的请求,使用 navigator.sendBeacon 的时候依旧会丢 body(我们的跳出率统计 sdk 会使用 SendBeacon,因为它能够保证用户关闭 webview 窗口之后也能发起请求)。
因此我们基于你们的方案增加了对 navigator.sendBeacon 的支持。
另外因为希望 sendBeacon 能够与 ajaxHook 共用一个 body 处理方法,免得维护困难,我们对原来的功能做了一点点重构。
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon