Greasemonkey 2.0 released, introduces changes that may break scripts

Advertisement

When it comes to adding userscript support to Firefox, Greasemonkey is still the number one extension trusted by the majority of users. While there are alternatives such as Scriptish, they pale in terms of raw user numbers when compared to Greasemonkey.

The development team behind Greasemonkey has just released version 2.0 of the extension. As always, it takes time before the new version is made available to all existing users and users who visit the Greasemonkey page on the website.

Interested users can install the new version of the extension on the "versions" page of it on the website where it is already made available.

The new version introduces several changes that may make some scripts incompatible with version 2.0 of Greasemonkey.

One of the changes affects the @grant mode that scripts use. It allows scripts to specify which API methods they want to have access to. Up until now, Greasemonkey tried to auto-detect the right settings when grant was not used by a script.

The new version changes this by assigning @grant none mode to any script that does not specifically request API methods using the feature.

It is interesting to note that the change affects only scripts that you install new, update, edit or reinstall. Existing scripts that you leave untouched are not affected by the change according to the announcement.

The second change that may break compatibility with some scripts is that Greasemonkey's privileged sandbox has been updated to match changes made to unsafeWindow in Mozilla's Add-on SDK. What this means is that scripts need to use the new methods cloneInto(), exportFunction() and createObjectIn() to write values to unsafeWindow.

According to the developers, this improves the extension's stability, reliability and security.

The consequence is that the changes may break some scripts unless they are updated by their authors to correct the issues.

It is unclear how many scripts will be affected by this but the team believes that the benefits outweigh compatibility issues.

A couple of additional changes and fixes are introduced in Greasemonkey 2.0. Firefox Sync support is turned on by default for instance which means that it is enabled by default now. If a user has activated Firefox Sync, userscripts will be synchronized automatically once Greasemonkey 2.0 has been installed.

You can change that behavior in the extension's options where you need to uncheck the "Enable Firefox Sync for User Scripts" box.

greasemonkey-2.0

Another interesting change is that all references to userscripts.org have been removed from the extension. The repository has been down for some time now and while there is an option to access it, as outlined here, it is unclear if it will return fully or vanish into oblivion.

You can read up on the remaining changes and fixes -- mostly coding related -- on the official Greasepot website.

Summary
Article Name
Greasemonkey 2.0 introduces changes that may break scripts
Author
Description
The popular extension Greasemonkey for Firefox has been released as version 2.0. It introduces several changes that improve the add-ons stability, security and reliability.
Please share this article

facebooktwittergoogle_plusredditlinkedinmail

Advertisement

Responses to Greasemonkey 2.0 released, introduces changes that may break scripts

  1. Chains The Bounty Hunter June 18, 2014 at 7:59 pm #

    I'm confused - is it @grant or @grand? I always thought it the former.

  2. Boris June 18, 2014 at 9:57 pm #

    2.0 is not a final version, just beta.

    • Martin Brinkmann June 18, 2014 at 10:11 pm #

      No the final version is out, you need to load the Versions page on Firefox, the front page only lists version 1.15 and 2.0 beta.

  3. Ray June 18, 2014 at 11:23 pm #

    When Greasemonkey was lagging behind in releases, I switched to Scriptish. However, Scriptish is now lagging behind!

  4. Krisada June 19, 2014 at 4:55 am #

    With the fall of userscript.org I fear that many of my scrips will never ever get any update again...

  5. Boris June 19, 2014 at 10:30 pm #

    Any broken scripts experienced in first person with new version?

  6. CHEF-KOCH June 21, 2014 at 2:11 am #

    No broken scripts here and I'm on the latest dev branch 2.0 beta 2. But I think that most of the script problems are already fixed, because the source code seems open and all devs can easily update the scripts.

    I know it was already written down but here are some alternatives:
    https://monkeyguts.com/
    https://greasyfork.org/
    https://openuserjs.org

    Openuserjs and Greasefork seems most up-2-date.

  7. Zsolt June 25, 2014 at 12:34 pm #

    By the way what became the most complete replacement for userscripts.org? (Meaning where the most script devs moved their scripts)
    Also previously people mentioned forking the whole website. Did anyone actually did that and backed up all the scipts?

Leave a Reply