您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Check update for Greasyfork userscript
当前为
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.greatest.deepsurf.us/scripts/431490/964610/GreasyForkScriptUpdate.js
Check for script updates on greatest.deepsurf.us
Just @require
it.
var GFU = new GreasyForkUpdater(); GFU.checkUpdate(<integer/string>scriptID, <string>currentversion, <function>callback[, <array>args])Arguments:
<integer/string> scriptID
: The GreasyFork demical script id. <string> currentversion
: The current version of your script, you can get it from GM_info.script.version
. It should just contains demical numbers(0123456789) and dots('.'). <function> callback
: The callback function. You will get three arguments while your callback function being called: <bool>update, <string>updateurl, <object>metaData
<bool> update
: Whether there is an update, true/false. <string> updateurl
: The url latest version script. <object> metaData
: An object containing all meta info of the latest script. It should like:{ name: "hello world", version: 0.2, grant: "GM_xmlhttpRequest", connect: ["www.example.com", "example.org"] noframes: true }
[<array> args]
: An arguments list that will be passed to your callback function as the 4th, 5th... argument. It should be an array. Optional.var GFU = new GreasyForkUpdater(); GFU.update(<integer/string>scriptID, <string>currentversion)This will just check whether there is an update of your given script, and automatically (request your script user to) install the latest version if there is. If there is no update, then nothing happends.
Please refer to the source code. I've written the usage of each function.
Be aware that one of GreasyFork's rules for posted scripts is that Scripts must not check for updates at a rate higher than once per day. Note that most user script managers will handle automatic updates, so doing it in the script is unnecessary. Scripts should also not dynamically inject another Greasy Fork-hosted script into a page, as this bypasses caching in user script managers.
. Make sure you won't violate the rules all the time.