Friday, August 24, 2012

Greasemonkey 1.0 Release

After more than seven years, Greasemonkey has finally grown to version 1.0.

Back in August of 2005 (almost exactly seven years ago now), Greasemonkey introduced wrappers intended to plug security holes.  As a result the common pitfalls were born.  Ever since then, in order to write a user script that would function properly in Greasemonkey, authors were required to either get lucky and not trip over one of these pitfalls, or get lucky and figure out that they exist -- and how to work around them.

As of today, all you have to know is "@grant none".  If you specify this setting in your metadata, then none of these security wrappers are put around your script. And you aren't granted access to any of the Greasemonkey APIs that a normal page wouldn't have.  Almost anything you can do in a script in the page itself should work in a "@grant none" user script.  There is still a sandbox; this isolates your variable scope from the page itself.  Without this it is extremely easy to break the page.  In order to explicitly read/write to/from the content scope, just reference properties of the window object.  (I.E. "x = 10" assigns to a variable x only in the user script's private scope.  "window.x = 10" assigns to the variable x in the content page's scope, which it can see.)


The entire list of bugs handled in this release is also available via the 1.0 milestone on GitHub. A number of issues listed there only affected Greasemonkey during the development of version 1.0, so they aren't listed as changes below.

As always, if you notice problems, it's best to log an issue at GitHub or let us know at the greasemonkey-dev mailing list (and be clear that your issues are with this version).

Enhancements since Greasemonkey 0.9.x:
Bug fixes since Greasemonkey 0.9.x:
  • When downloading a script not encoded in UTF-8, display an error message to the user (rather than just failing). (#1588)
  • The "show script" button in the install dialog is disabled until the download of the script file is complete. (#1586)
  • Scripts with missing or broken "==UserScript==" metadata will work.  (#1562)

3 comments:

Women Out Front said...

Bandcamp seems to be broken. Will briefly display album art before it disappears

Artangel said...

greasemonkey is not compatible with firefox 2.12. Are you working on a fix for this?

arantius said...

Firefox 2? Absolutely not.