Greasy Fork

gmxhr-fetch

A fetch-like polyfill for userscript managers.(TM,GM,VM)

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.greasyfork.icu/scripts/372917/639024/gmxhr-fetch.js

作者
maple3142
版本
0.0.1.20181022191154
创建于
2018-10-06
更新于
2018-10-22
大小
1.4 KB
许可证
暂无

gmxhr-fetch

A fetch-like polyfill for userscript managers.(TM,GM,VM)

To use

Add the following content into your script's metablock.

// @require https://unpkg.com/gmxhr-fetch
// @grant   GM_xmlhttpRequest
// @grant   GM.xmlHttpRequest

Then you can call gmfetch anywhere in the script just like fetch.

gmfetch('https://example.com').then(console.log)