Tuesday, February 28, 2012

Greasemonkey 0.9.18 Release

The entire list of bugs handled in this release is also available via the 0.9.18 milestone on GitHub. Note that as always it takes some time for Mozilla to review the new version, but it's available on the all versions page immediately.

If you are using it and notice problems, it's best to log an issue or let us know at greasemonkey-dev (and be clear that it's with this version).

Enhancements:
Bug fixes:
  • Add-on Manager shows correct data when re-installing (e.g. to update) a script. (#1476)
  • Re-installed scripts are put into the same directory as the original. (#1515)
  • The matches property of GM_info is now a list of (pattern) strings. (#1516)

Automatic script updates come to Greasemonkey

In the 0.9.18 release, Greasemonkey is now checking for, and installing, updated versions of user scripts by default.  This post is intended as a primer for how this new functionality works, both for users and for script authors.


The Greasemonkey Options dialog now includes these settings to control automatic update checking and installation. By default updates will be checked for every seven days, and automatically installed when found.  The download location must be secure (https) by default.  And it should just work!

If you know there's an update, you can open the Add-ons manager, right click on a User Script, and choose "Find Updates".  This will check immediately, even if a scheduled check has happened more recently than seven days ago.*

*You may need to clear your browser cache, if an old version of the script was downloaded recently.

Script Authors
Greasemonkey supports a number of new metadata directives to support updates: @downloadURL, @updateURL and (more than before) @version.

The @updateURL will be accessed when checking for the update.  This can be a ".meta.js" format like userscripts.org produces, with only the metadata.  The @version defined here will be checked to the install version.  It does not need to be hosted on https to be checked by default.

Sidebar: for userscripts.org, the updateURL is automatically set to the .meta.js corresponding to the script, and passed through the Coral Content Distribution Network (see why).

The @downloadURL is where the update will be downloaded from, when found.  This is most useful to guarantee that updates come from a secure (https) location, so that they will be installed by default.

If @updateURL or @downloadURL are not provided, the URL that the script was downloaded from is used instead.  If the @downloadURL is not provided and the install URL is not known, updates will never be applied.

Finally the @version directive controls what is considered an update.  Read about the (Mozilla) toolkit version format to learn exactly what value is greater than what, and what formats are valid.

It's also worth pointing out that the recently added GM_info API can be used to check if Greasemonkey will ever try to apply updates (e.g. because the user has turned it off, or the URL is insecure).

Finally, if you want to make sure that Greasemonkey will never update your script, it can be accomplished by providing an invalid @updateURL (like "about:blank") which will never return a newer version.

Questions?
Please bring any questions or comments to us at the greasemonkey-users discussion list.

Saturday, February 11, 2012

Greasemonkey 0.9.17 Release

Whoops, there was a problem with 0.9.16 yesterday, so here's a quick patch.

Bug fixes:
  • Error: "aForced is not defined".  (#1517)

Friday, February 10, 2012

Greasemonkey 0.9.16 Release

The entire list of bugs handled in this release is also available via the 0.9.16 milestone on GitHub. Note that as always it takes some time for Mozilla to review the new version, but it's available on the all versions page immediately.

If you are using it and notice problems, it's best to log an issue or let us know at greasemonkey-dev (and be clear that it's with this version).

Enhancements:
  • Expose information (including Greasemonkey version) to user scripts via GM_info. (#1452; also see #1512)
  • Track the install time of scripts.  (This is designed to better support automatic updates for scripts ... still coming soon.)  (#1513)
Bug fixes:
  • Editing script from the "New User Script" feature, to change any remote dependency (@icon, @require, @resource), could the script to malfunction. (#1504)
  • Enabling/disabling scripts from the status bar menu (Firefox 3 only). (#1506)
  • Incompatibility with GreaseFire.  (#1507)
  • Failures during "Check for Updates" from the Add-on manager. (#1509)