Snippets code from my daily experience

February 3, 2009

Firefox spelling checker and multiple dictionaries

Filed under: extension,firefox,spelling — dafi @ 10:00 am

When Firefox integrated the spelling checker I didn’t immediately realized its value, but using it day after day I became “spell” addicted and now I can’t imagine my browser without this feature.

You can install all dictionaries you need, but many people uses only the dictionary for its own language.

Obviously I’m not a normal person so I use three dictionaries; Italian, English and French switching between them when necessary.

Following Murphy laws every time I start to type inside a input box I discover I’m using the wrong language and I must switch it from context menu, a very annoying practice.

Finally I’ve solved this problem writing the extension SpellBySite.

SpellBySite switches automatically to the correct dictionary looking for it on user settings.

For example user can set English dictionary for, Italian for and so on.

When input boxes receive focus the dictionary is set and spell checking executed, no more needs to switching from context menu πŸ˜€

Now my life is a bit easier πŸ˜›

SpellBySite is waiting on AMO to escape from sandbox πŸ˜‰



  1. Will you add support for switching in the one page based on multiple textarea inputs with different lang attributes? Like lang=”es-ES” as suggested at:

    Great job implementing the other half of that idea πŸ™‚

    Comment by Mardeg — February 3, 2009 @ 10:38 am

    • It sounds interesting using the lang attribute, I will add very soon

      Comment by dafi — February 3, 2009 @ 10:43 am

  2. What a fantastic idea to have a whitelist of site’s languages.

    To make the language changing automatic on 99% of sites, how about reading the headers of the sites: , even before reading the language of individual textareas. I think web are more likely to define the lanfguage of the page before they define textareas…!?

    Anyhow, thanks for a fantastic add-on!!!

    Comment by Peter Lairo — February 3, 2009 @ 11:11 am

  3. Apologies for some errors:

    add: …sites: html lang=”en-us”, even…

    add: …I think web authors are…

    Comment by Peter Lairo — February 3, 2009 @ 11:15 am

  4. Here’s another one:
    Tries to auto-detect and allows you to save the setting for the current site.

    Comment by Dao — February 3, 2009 @ 12:33 pm

  5. Err… did you just rewrite Dictionary Switcher ? πŸ™‚

    Comment by mat — February 3, 2009 @ 12:58 pm

  6. What about spell-checking in all installed languages and using the language with the least errors?

    Use case for this:
    I use GMail for writing emails, both in English and German. The only difference is who and what I write to. The same for some forums I visit. I don’t think you can solve this problem with looking at the HTML alone.

    Comment by Benjamin Otte — February 3, 2009 @ 2:05 pm

  7. So doesn’t fulfill your desires?

    Comment by Archaeopteryx — February 3, 2009 @ 2:09 pm

  8. I’m not sure but ‘Dictionary Switcher’ does work with gmail and wordpress HTML editor?

    Comment by dafi — February 3, 2009 @ 2:55 pm

  9. Had to type a German mail on yesterday, SpellBySite kept resetting the language to English (I have a “fallback” rule at the bottom that says “everything not mentioned is English”). Not sure whether this is because of site specifics (HTML editor) or whether my frequent switches to other applications were the cause – but apparently onEnableSpell() can be called more than once for the same text field. Maybe set an expando property on that text field to make sure you don’t change the language more than once?

    Comment by Wladimir Palant — February 4, 2009 @ 7:26 am

    • Hi Wladimir,

      I’m investigating the cause of bug maybe related to onFocus() listener (called more times).
      I hope to release a new version very soon, the next release will also contain other minor fixes reported on AMO comments πŸ˜‰
      The code handling the yahoo HTML editor should be bug free (I repeat “should be”) because it is the same code used on ViewSourceWith and it ever worked

      Comment by dafi — February 4, 2009 @ 7:48 am

  10. Firefox: Panic Mode, Location Bar und Tasks in der Sidebar…

    Google Mail hat ja nun auch eine To Do-Liste an Board. Wer mag kann diese in der Sidebar des Firefox anzeigen. Dazu einfach diesen Link in die Bookmarks aufnehmen und in den Eigenschaften aktivieren, dass man dieses Lesezeichen in der Sidebar laden m…

    Trackback by Caschys Blog — February 4, 2009 @ 6:24 pm

  11. I encounter the same bug as Wladimir Palant with version 0.1.2. It doesn’t seem to be site specific – it occurs even on a page with textarea as the only element, without any scripting involved. Every time the textarea regains focus, its language is reset to the one specified by the filter list. Please set the language only once, rather than at each refocus.

    Very useful extension, thank you!

    Comment by snoring — September 23, 2009 @ 11:21 pm

  12. Also, please consider setting the language when the textarea is created, not when it is focused.

    Comment by snoring — September 26, 2009 @ 10:40 am

    • I want to rewrite entirely the code

      Comment by dafi — September 26, 2009 @ 10:42 am

RSS feed for comments on this post.

Blog at

%d bloggers like this: