chosirai
chosirai

Reputation: 193

How to implement auto-update in a Greasemonkey script?

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.

Upvotes: 8

Views: 6260

Answers (1)

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.

Upvotes: 8

Related Questions