theme selector

light blue screenshot grey screenshot navy screenshot dark green screenshot red and black screenshot

by Tony Chang

All opinions on this site are my own and do not represent those of my employer.

Creative Commons Attribution License

Spell check script

Apr 24, 2005, 05:48pm EDT



A long time ago I wrote a real time spell checker in javascript. I was fixing up the script to make it a bit more efficient and I thought, hmm, why not make it into a greasemonkey user script?

Spell check user script

lj comment area

Spelling corrections are received from Google using the web API.

For this script to work, you need to do the following:

  1. Get a web api key from You may need to create a Google account (you automatically have one if you have a Gmail account).
  2. Make the user script aware of your key.
    • In Firefox, go to about:config
    • Right click and select New -> String from the menu.
    • You’ll be prompted for the preference name. Enter
    • Next you’ll be prompted for a value. Enter the api key that you received.

Update: Just follow the instructions below any textarea.

If a key is not properly installed, you should see a message in the javascript console. The script should attach itself to any textarea area as soon as it receives focus.

Update: This requires greasemonkey 0.3.x to work.

Alex at Apr 25, 2005, 12:00am EDT

i’m getting an error in my console for any page I try to use this on: “GM_getValue is not defined” i’m not seeing anything at all on the page with the textarea … i do have a bunch of other greasemonkey scripts … i’ll try disabling them if you don’t know what’s causing this.

Alex at Apr 25, 2005, 12:18am EDT

ok, it looks like I need greasemonkey 0.3 beta for GM_getValue, but the xpi on that page is corrupt. Got a copy somewhere else?

tony at Apr 25, 2005, 12:34am EDT

Ah, I mistakenly thought that was added in 0.2.6. You can get 0.3b here.

Nikolas ‘Atrus’ Coukouma at Apr 27, 2005, 06:02am EDT

0.2.7a is availble from the mozdev mirrors and also has the needed functions.

I’m also hosting 0.3. The only advantage there is less clicking is involved than the mailing list’s copy (the mime-type is set correctly so it should install immediately).

Hrm, perhaps this comment preview could work by changing the node type or moving content around, similar to edit in place (join() is the function of interest).

Jeremy Dunck at May 27, 2005, 05:51pm EDT

Suggestion: Instead of telling your users to go edit about:config, try this approach:

var key = GM_getValue(“googlekey”) if (key.length == 0) { key = prompt(“key, please”); GM_setValue(“googlekey”, key); } I mean, it’s fine to tell them the key exists (if they want to go edit it later), but it’s sort of a nasty speedbump, no?

P.S. The entity-encoded round-trip after preview is sort of a pain. :)

tony at May 28, 2005, 05:51pm EDT

Oh, good idea! I’ve modified the script to make it easier to add a key from any page with a textarea.

Yeah, it’s pretty slow, but I’m not sure how to make it faster -_-

anonymous at Jul 02, 2005, 05:15pm EDT


supriya at Jan 13, 2006, 08:18pm EST

what is the deal with airplane peanuts? i do not like it. Why trste it?

anonymous at Jan 13, 2006, 08:19pm EST

sorry, i thought i was just trying out the spellchecker.

Pete at Jun 09, 2006, 05:03am EDT

Just wanted to bump this post by saying that I’ve successfully installed this user script under Firefox - via Greasemonkey 0.6.4 - and it’s still working a treat.

I do a lot of writing online and this is a stupidly useful script—thanks for sharing it.

anonymous at Jul 24, 2007, 08:29am EDT

yar je code ha ta dao.Aa ki kahaniayan paeean ne?

Girish Singh at Apr 03, 2008, 08:32pm EST

Hey nice work, I implemented such a thing welll not with the google api but rather in .NET using microsoft API. Its not that hard just a few lines of code I must say.