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?
Spelling corrections are received from Google using the web API.
For this script to work, you need to do the following:
- Get a web api key from http://api.google.com/createkey. You may need to create a Google account (you automatically have one if you have a Gmail account).
- 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
greasemonkey.scriptvals.gm/spellcheck.googlekey
- 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.
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. :)