Greasemonkey 2.0 released, introduces changes that may break scripts

Martin Brinkmann
Jun 18, 2014
Updated • Jun 18, 2014
Firefox
|
12

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.

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
Greasemonkey 2.0 introduces changes that may break scripts
Article Name
Greasemonkey 2.0 introduces changes that may break scripts
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.
Author
Advertisement

Tutorials & Tips


Previous Post: «
Next Post: «

Comments

  1. Zsolt said on June 25, 2014 at 12:34 pm
    Reply

    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?

    1. Dieu said on July 29, 2014 at 1:54 am
      Reply

      https://greasyfork.org/ is the best it’s there that I had post all my old scripts and will update when needed.

    2. Martin Brinkmann said on June 25, 2014 at 12:38 pm
      Reply
  2. CHEF-KOCH said on June 21, 2014 at 2:11 am
    Reply

    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.

  3. Boris said on June 19, 2014 at 10:30 pm
    Reply

    Any broken scripts experienced in first person with new version?

  4. Krisada said on June 19, 2014 at 4:55 am
    Reply

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

    1. Blue said on June 19, 2014 at 3:22 pm
      Reply

      You can still access it through their 8080 portal.

      http://userscripts.org:8080/

  5. Ray said on June 18, 2014 at 11:23 pm
    Reply

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

  6. Boris said on June 18, 2014 at 9:57 pm
    Reply

    2.0 is not a final version, just beta.

    1. Martin Brinkmann said on June 18, 2014 at 10:11 pm
      Reply

      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.

  7. Chains The Bounty Hunter said on June 18, 2014 at 7:59 pm
    Reply

    I’m confused – is it @grant or @grand? I always thought it the former.

    1. Martin Brinkmann said on June 18, 2014 at 8:05 pm
      Reply

      It is grant, corrected.

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.