Old-Reddit-Redirect icon indicating copy to clipboard operation
Old-Reddit-Redirect copied to clipboard

[enhancement][documentation] @updateURL and @downloadURL declarations for automatic updates; Link to raw script in installation instructions

Open magic-spearmint opened this issue 1 year ago • 0 comments

Replacing the current UserScript metadata block with this will make it possible for userscript managers to automatically check for and install updates (only other change is @version being iterated):

// ==UserScript==
// @name        Old Reddit Redirect
// @version     0.1.2
// @description Redirects you to old.reddit.com
// @author      github.com/richkmls
// @match       *://*.reddit.com/*
// @exclude     /^https?://[a-z]{2}\.reddit\.com/*
// @exclude     *out.reddit.com/*
// @exclude     *://*.reddit.com/gallery/*
// @exclude     *://*.reddit.com/media*
// @run-at      document-start
// @updateURL   https://github.com/RichKMLS/Old-Reddit-Redirect/raw/main/oldRedditRedirect.user.js
// @downloadURL https://github.com/RichKMLS/Old-Reddit-Redirect/raw/main/oldRedditRedirect.user.js
// @grant       none
// ==/UserScript==

On the topic of quality-of-life stuff: A lot of userscript managers quietly peek at JavaScript documents opened for viewing within the browser to see if they start with a userscript metadata block, evaluating them further and prompting the user for an action to take (including installation) if so.[^1]

To take advantage of this, the installation instructions could be revised to specify a preferred method (instructing readers to simply click a link leading to the raw version of the script) followed by an alternative/fallback method (the current one involving copying and pasting the code).

[^1]: Example (Violentmonkey, Firefox)

magic-spearmint avatar Jan 12 '24 03:01 magic-spearmint