您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
A fetch API of GM_xmlhttpRequest
当前为
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.greasyfork.org/scripts/472236/1235760/GM%20Fetch.js
A fetch API of GM_xmlhttpRequest
.
responseType: stream
to prevent buffering large data when possible.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.umd.js
Grant necessary GM_APIs:
vite-plugin-monkey:
{
plugins: [
monkey({
userscript: {
grant: "GM_xmlhttpRequest",
// whatever websites you're to make requests to
connect: ["localhost"],
},
}),
];
}
plain userscript:
// @grant GM_xmlhttpRequest
// @connect localhost
Use it just like fetch:
vite-plugin-monkey:
import gmFetch from "@sec-ant/gm-fetch";
gmFetch("http://localhost:4567/100.zip");
plain userscript:
/* globals gmFetch */
(function () {
"use strict";
gmFetch("http://localhost:4567/100.zip");
})();
MIT