Archive for the ‘GreaseMonkey’ Category

Posted by Matt at 14 August 2010

Category: GreaseMonkey, Programming, google, javascript, web

Google recently updated GMail, and in the process they removed the "Select" line just under the buttons at the top. Unfortunately for most people (myself included), this was something that they used often! After reading the messages that weren’t spam, my natural motion was to select "Unread", then move up a bit and click Delete. I used it many times a day.

But after the update, the selector was hidden in a dropdown under a checkbox on the left. Very inconvenient!

So, Greasemonkey to the rescue again!  I wrote this Greasemonkey script: Gmail – Restore "Select" line including "Unread" link

This will add the "Select" line in and bring back one-click access to message selection, like this:

gmail_Select

Enjoy :)

Posted by Matt at 26 March 2010

Category: GreaseMonkey, Programming, browser extensions, facebook, javascript

I had a number of users report problems with my Better Facebook! Firefox Add-on. The error was always with JSON.parse(), and it only happened with the Add-on, not the Greasemonkey version of the script. I was stumped for over a month. Couldn’t figure it out.

Finally, I found the root cause and solution.

The problem was unicode strings being passed into JSON.stringify(). This sometimes resulted in an invalid JSON structure, which then failed when passed to JSON.parse(). The root cause was not within my code, but within the Greasemonkey User Script Compiler that I used to create the Add-on.

The problem was that the script was not being read in using UTF-8, so when executed it didn’t properly handle UTF-8. In the script-compiler.js file, line 22 (for me) I found this:

var channel=ioService.newChannel(aUrl, null, null);

I simply had to change the line to this instead:

var channel=ioService.newChannel(aUrl, "UTF-8", null);

I re-packaged the add-on and the problem disappeared! Hopefully it anyone else runs into this, a quick Google search will find this page. In all my searching, I hadn’t come across anyone else talking about this specific issue. But solving a very needle-in-a-haystack problem is very rewarding, and I’ll be glad to stop getting error reports!

Posted by Matt at 10 February 2010

Category: GreaseMonkey, Programming, browser extensions, facebook, javascript, web

better_facebook_large I have officially released BetterFacebook.net to house my "Better Facebook" greasemonkey script and Firefox add-on.

The script has been updated to work with the new Facebook layout, and also now supports Chrome!

Check out the site and the script. I hope you find it useful!

BetterFacebook.net

Posted by Matt at 7 October 2009

Category: GreaseMonkey, Programming, browser extensions, javascript

Example

This script was born out of a simple problem: I wanted to find out which movies have been released to theaters or DVD lately, and add them to my Netflix queue. Unfortunately, Netflix doesn’t provide an easy way to browse "major" movie releases by release date. However, IMDB always has a nice interface for this. Further, I’ve found myself at IMDB before, looking at a movie that I would like to add to my Netflix queue, but I had to go to Netflix, search, find the movie, then add it.

Solution? A new GreaseMonkey script!: Netflix Links on IMDB

I created this simple GreaseMonkey script, which adds a little red "+" next to movie titles on imdb.com. Clicking the image pops up a new window that searches on the movie name, usually finding the movie you want as the first match.

Easy! Hope it helps!