Automatically Update Script

Library that automatically alerts user when the script requires update. Complies with Greasy Fork rules (greasyfork.org/help/code-rules).

بۇ قوليازمىنى بىۋاسىتە قاچىلاشقا بولمايدۇ. بۇ باشقا قوليازمىلارنىڭ ئىشلىتىشى ئۈچۈن تەمىنلەنگەن ئامبار بولۇپ، ئىشلىتىش ئۈچۈن مېتا كۆرسەتمىسىگە قىستۇرىدىغان كود: // @require https://update.greasyfork.org/scripts/568072/1764879/Automatically%20Update%20Script.js

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

ئاپتورى
NotYou
نەشرى
1.0.0
قۇرۇلغان ۋاقتى
2026-03-02
يېڭىلانغان ۋاقتى
2026-03-02
Size
6.1 KB
ئىجازەتنامىسى
MIT

Automatically Update Script

Description

Library that automatically alerts user when the script requires update. Complies with Greasy Fork rules (greasyfork.org/help/code-rules).

Dependencies

// @require https://unpkg.com/[email protected]/lib/index.umd.js
// @require https://update.greasyfork.org/scripts/565798/1752557/Zod%203x%20Error%20Formatter.js
// @require https://update.greasyfork.org/scripts/445697/1756808/Greasy%20Fork%20API.js
// @require https://unpkg.com/compare-versions/lib/umd/index.js
// @grant GM.xmlHttpRequest
// @grant GM.openInTab
// @grant GM.getValue
// @grant GM.setValue
// @grant GM.deleteValue
// @grant GM.info

Also recommended to add this:

// @connect greasyfork.org

How script works?

  1. Script firstly checks if there is @updateURL, or @downloadURL and tries to get script id from there, otherwise it tries to query script in Greasy Fork. If it finds script id, it saves it and never again checks @updateURL/@download or Greasy Fork.

Note: You can set script id manually to avoid any mistake that can happen during automatic script id detection, using AUS.setUserScriptId method, just set it at the start of your user-script.

// ==UserScript==
...
// @require https://unpkg.com/[email protected]/lib/index.umd.js
// @require https://update.greasyfork.org/scripts/565798/1752557/Zod%203x%20Error%20Formatter.js
// @require https://update.greasyfork.org/scripts/445697/1756808/Greasy%20Fork%20API.js
// @require https://unpkg.com/compare-versions/lib/umd/index.js
// @grant GM.xmlHttpRequest
// @grant GM.openInTab
// @grant GM.getValue
// @grant GM.setValue
// @grant GM.deleteValue
// @grant GM.info
// @connect greasyfork.org
// ==/UserScript==

/* global AUS */

(async function() {
  await AUS.setUserScriptId(1234567)

  // your user-script logic
})()
  1. After that library checks if 24 hours have passed since last update check, then checks if the new update is available

  2. Confirms if the user wants to update

  3. Then, opens new installation link from which user can install new version of the user-script.