您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
Easy configuration dialog builder for user scripts. Updated version of MonkeyConfig that supports color picker fields.
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.greasyfork.icu/scripts/395037/764968/MonkeyConfig%20Modern.js
MonkeyConfig is a simple configuration library for user scripts. It allows for easy creation of configuration dialog windows and takes care of storing and retrieving the configuration parameters for the script.
Tell your user script to use MonkeyConfig by placing a @require
directive in
the metadata section:
// ==UserScript==
// @name AwesomeScript
// @require https://raw.github.com/odyniec/MonkeyConfig/master/monkeyconfig.js
Then, call MonkeyConfig()
to construct your configuration object:
var cfg = new MonkeyConfig({
title: 'AwesomeScript Configuration',
menuCommand: true,
params: {
font_size: {
type: 'select',
choices: [ 'Small', 'Medium', 'Large' ],
default: 'Medium'
},
auto_adjust: {
type: 'checkbox',
default: true
}
}
});
And that's pretty much it. MonkeyConfig builds a configuration dialog based on the passed data. It also adds a menu item in the User Script Commands menu to open the configuration dialog.
At any time in your script, you can retrieve the value of a configuration
parameter with the get()
method:
var auto_adjust = cfg.get('auto_adjust');
and set a new value using the set()
method:
cfg.set('font_size', 'Small');