xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

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, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2021-11-29 16:57  xgqfrms  阅读(69)  评论(3编辑  收藏  举报