1.2.0 • Published 8 months ago
@sec-ant/gm-fetch v1.2.0
@sec-ant/gm-fetch
A fetch API for GM_xmlhttpRequest
/ GM.xmlHttpRequest
.
Features
- Use
responseType: stream
to prevent buffering large data when possible. - Use Typescript.
- Provides es module, iife script and lib mode userscript as well.
Install
If you use vite-plugin-monkey:
npm i @sec-ant/gm-fetch
or just plain userscript (change latest
to the version number as needed):
// @require https://cdn.jsdelivr.net/npm/@sec-ant/gm-fetch@latest/dist/index.iife.js
Usage
Grant necessary GM_APIs:
vite-plugin-monkey:
{ plugins: [ monkey({ userscript: { // or GM.xmlHttpRequest grant: "GM_xmlhttpRequest", // whatever websites you're to make requests to connect: ["github.com"], }, }), ]; }
plain userscript:
// @grant GM_xmlhttpRequest // @connect github.com
Use it just like fetch:
vite-plugin-monkey:
import gmFetch from "@sec-ant/gm-fetch"; gmFetch("https://github.com/Sec-ant/gm-fetch");
plain userscript:
/* globals gmFetch */ (function () { "use strict"; gmFetch("https://github.com/Sec-ant/gm-fetch"); })();
License
MIT
1.2.0
8 months ago
1.1.6
8 months ago
1.1.5
8 months ago
1.1.4
8 months ago
1.1.3
8 months ago
1.1.2
8 months ago
1.1.1
8 months ago
1.1.0
8 months ago
1.1.0-rc.1
8 months ago
1.0.2
8 months ago
1.0.1
8 months ago
1.0.0
9 months ago
0.0.9
9 months ago
0.0.8
9 months ago
0.0.7
9 months ago
0.0.6
9 months ago
0.0.5
9 months ago
0.0.4
9 months ago
0.0.3
9 months ago
0.0.2
9 months ago
0.0.1
9 months ago