您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
A config library powered by webext-pref.
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.gf.qytechs.cn/scripts/371339/961539/GM_webextPref.js
Use webext-pref in userscripts. This library includes createPref
, createView
, a storage object implemented with GM API, and a dialog service.
You can @require
this script from Greasy Fork镜像.
This library is also hosted on npm so you can import it with a build tool:
npm install gm-webext-pref
import GM_webextPref from "gm-webext-pref";
This script uses following permissions:
// @grant GM_getValue
// @grant GM.getValue
// @grant GM_setValue
// @grant GM.setValue
// @grant GM_deleteValue
// @grant GM.deleteValue
// @grant GM_addValueChangeListener
// @grant GM_registerMenuCommand
// @grant GM.registerMenuCommand
https://rawgit.com/eight04/GM_webextPref/master/demo/demo.html
const pref = GM_webextPref({
default: {
useImage: true,
excludeElements: "code, .highlight"
},
body: [
{
key: "useImage",
type: "checkbox",
label: "Use image"
},
{
key: "excludeElements",
type: "text",
label: "Exclude elements"
}
]
});
pref.ready()
.then(() => {
console.log(pref.get("useImage")); // true
});
This module exports a single function.
const pref = GM_webextPref({
default: Object,
separator?: String,
css?: String,
...options
});
Create a pref
object. pref
inherits all methods from the pref object returned by createPref
.
default
and separator
would be sent to createPref
.
css
would be injected to the dialog for customization.
Other options
would be passed to createUI
and createBinding
.
If GM_registerMenuCommand
exists, the function would register a menu command like:
GM_registerMenuCommand(GM_info.script.name + " - Configure", pref.openDialog);
So that users can open the config dialog through monkey menu.
pref.openDialog();
Open the config dialog.
0.4.2 (Aug 18, 2021)
createBinding
, createUI
, and createPref
.css
option.0.4.1 (Aug 17, 2021)
0.4.0 (Aug 19, 2020)
0.3.0 (Aug 25, 2018)
GM_deleteValue/GM.deleteValue
APIs.0.2.1 (Aug 24, 2018)
0.2.0 (Aug 21, 2018)
translate
arg.0.1.5 (Aug 20, 2018)
0.1.4 (Aug 19, 2018)
0.1.3 (Aug 19, 2018)
0.1.2 (Aug 19, 2018)
0.1.1 (Aug 19, 2018)
0.1.0 (Aug 19, 2018)
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址