8

I am writing a Greasemonkey script, how to implement auto updating?

Is possible put script into GitHub repository and set @version number?

And then... is some automatically way how to do it? Or I must manually check.

Brock Adams
  • 90,639
  • 22
  • 233
  • 295
chosirai
  • 193
  • 3
  • 7

1 Answers1

8

As of some time ago, Greasemonkey supports auto updates (it was not the case at the moment the question was asked):

  1. Add @updateURL to the script meta config. It can (but not necessary) be the same as @downloadURL.
  2. Add @version to meta. Each new script version should increment the value.
  3. Optionally, the file name should end with .user.js for GM to open the installation dialog.

Is possible put script into GitHub repository and set @version number?

The script can be hosted in GitHub repo or gist. The download and update URLs should link to the raw file, though. To install the script, user will have to open that @downloadURL. Here's the GM wiki page on the subject.

  • 1
    Thanks. This helped me also with `tampermonkey`. – Joe Sep 12 '19 at 06:59
  • 3
    [Read what](https://stackoverflow.com/a/38025376/3273963) `@updateURL and `@downloadURL do and why in most cases they should not be used. – papo Sep 19 '21 at 15:33