您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Extends the GM_setValue and GM_getValue functions for any javascript variable type.
当前为
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.cn-greasyfork.org/scripts/3667/11165/Super_GM_setValue_and_GM_getValuejs.js
Original Author: ScriptKeeper
Re-Upload of Super_GM_setValue_and_GM_getValue.js
Unable to find an uploaded copy here, and seeing as UserScripts.org is now down, this was much needed for me.
All credits to original author, removed test code and reduced it to the bare minimum needed.
Original readme:
This library extends the Greasemonkey GM_setValue() and GM_getValue() functions to handle any javascript variable type.
A library is necessary because GM_setValue only stores: strings, booleans, and 32-bit integers. (A limitation of using Firefox preferences for storage).
Important! This is a library, not a standard Greasemonkey script.
It is meant to be included via the @require directive.
Add it to your script with this line in the metadata block:
// @require http://userscripts.org/scripts/source/107941.user.js
In your user script, use the functions like so:
GM_SuperValue.set (varName, varValue);
var x = GM_SuperValue.get (varName, defaultValue);
That is, just like you would use GM_setValue and GM_getValue, but without the worries of the script breaking on invalid values.