您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
A Simple Extension Manager
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.greasyfork.icu/scripts/441384/1027332/ExtMan.js
独立用户脚本做附加模块框架。Host和Module都需要引用此脚本。
Host:
const ExtMan = unsafeWindow.getExtMan();
const ext = new ExtMan({
name: "YourHostScriptNamespace",
requiredProperties:{// specify this for module precheck or leave this empty object to skip precheck
name:"string",
version:"string",
onhook: (prop, fullmodule, propname)=>true // custom checker
}
});
ext.getAllModules();// get all registered module with precheck, return an array
External Module:
const ExtMan = unsafeWindow.getExtMan();
const ext = new ExtMan({
name: "TheNamespaceOfYourHostScript",
});
ext.registerModule({// register your module with object like this. Make sure your module script load before the host script!
name: "...",
//...
});