navigator.sendBeacon with CORS All In One
navigator.sendBeacon with CORS All In One
window.onunload = function () {
const body = {
id,
email,
};
const headers = {
type: 'application/json',
};
const blob = new Blob([JSON.stringify(body)], headers);
navigator.sendBeacon('url', blob);
});
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon
JSON-LD
JSON-LD 1.1 Processing Algorithms and API
W3C Recommendation 16 July 2020
https://www.w3.org/TR/json-ld-api/
(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!
refs
https://stackoverflow.com/questions/40523469/navigator-sendbeacon-to-pass-header-information
©xgqfrms 2012-2021
www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/15620247.html
未经授权禁止转载,违者必究!