Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
magic-spearmint opened this issue Jan 12, 2024 · 0 comments

Comments

@magic-spearmint
Copy link

magic-spearmint commented Jan 12, 2024

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).

Footnotes

  1. Example (Violentmonkey, Firefox)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant