March 23, 2011 11:38 AM   Subscribe

Updating to Firefox 4 broke my favorite Greasemonkey scripts! Is there any way to fix them?

After amassing a sizable collection of Greasemonkey userscripts on Firefox over the years, I found myself using the lightweight Google Chrome more and more, to the point that it became my de facto default browser in 2010. Despite the switch, I was able to continue using most of my favorite userscripts thanks to the Blank Canvas Script Handler extension, a Greasemonkey analog for Google Chrome (not all scripts were compatible, though).

After hearing about all the speed improvements and other goodies in Firefox 4, I decided to give Mozilla another shot. So yesterday I booted up Firefox 3.6 (the most recent version I had installed), downloaded a dozen or so extension updates that had long been pending (including Greasemonkey), then downloaded Firefox 4. Right off the bat, half my existing extensions were no longer compatible, so I spent some time removing the ones that were truly broken and doing everything else necessary to get the browser up to speed.

Anyway, I was glad to see that the updated version of Greasemonkey (0.9.1) was already compatible with Firefox 4, and even had its own custom "Userscripts" slot in the browser's new Add-ons Manager window. But after a few minutes of websurfing, I ran into a bunch of major issues.

Basically, a whole slew of userscripts just don't work anymore. This includes not only highly complex interactive scripts like YouTube Enhancer and my precious Google Reader Preview, but also dead-simple ones like Allow Snopes Text Selection, which contains a grand total of four lines of code.

And yet, some other scripts do work, including Greased Lightbox and Plutor's fairly sophisticated Mefiquote. So it's not simply a matter of Greasemonkey not working -- something is interfering with individual userscripts.

Because I updated Firefox, Greasemonkey, and a bunch of other add-ons all at once after months of neglect, I wasn't sure what particular change was causing the problem. So I did some testing on another computer that also had Firefox 3.6. The scripts worked under version 3.6, and continued to work after I updated to the latest version of Greasemonkey. But as soon as I installed Firefox 4, the same scripts quit functioning.

So, what gives? Greasemonkey interacts directly with a page's source code, and that should be the same across all browsers, right? So why is Firefox 4 interfering? Upgrading has never messed with my userscripts before. And why only some scripts, including extremely simple ones, but not others? And for the programmatically-inclined: looking at the source code for these scripts (especially Google Reader Preview), is there anything that can be tweaked to make them work again? I'd wait for the script authors to update them, but many have been abandoned for months or years...
posted by Rhaomi to Computers & Internet (2 answers total) 1 user marked this as a favorite
YouTube Enhancer seemed like a good idea, so having installed it I can confirm it's working on Firefox 4.0 for me....

Maybe you need to uninstall and re-install (the script or grease monkey or both).
posted by tiamat at 1:58 PM on March 23, 2011

Greasemonkey interacts directly with a page's source code, and that should be the same across all browsers, right? So why is Firefox 4 interfering?

It's far from that simple. Greasemonkey has to use some internal Firefox APIs, most notably the XPCNativeWrapper to wrap the objects in the page for security reasons. There were changes to this API in Fx 4, which means problems with scripts in certain circumstances. There are other JS changes in Fx4 which might cause scripts to break.

Check the 'discussions' tab for each of the scripts that aren't working. Look in the Error Console for any messages.
posted by Rhomboid at 3:07 AM on March 24, 2011

« Older Help us find the right "Somewhere over the...   |   Mac + iPhone or Ubuntu + Android? Newer »
This thread is closed to new comments.