Updated “define word” Firefox plugin

Based on lots of user feedback, I have improved the define word plugin for FireFox slightly – please use the comment section to suggest other improvements. The new version 0.3.1 can be downloaded here.

This version adds an option dialog where you can choose whether to use google.com, yahoo.com, wordsmyth.com, dictionary.com, wikipedia.org or a custom search string to look up the definition. It also removes one of the two pop-up menu item links as it is now an option whether to open the definition in a window or a new tab.

It has been tested with FireFox v1.0 on Windows and Linux – and probably does not work in Mozilla on any platform. I may look into this later.

To install it, download the .xpi file to somewhere, and then drag it onto the FireFox window.

5 thoughts on “Updated “define word” Firefox plugin

  1. Great tool! One thing I would like to see added would be the abilty to choose which search engine to use from the context menu. Sometimes I want to look up a dictionary definition of a word, but other times I want to do an enclycopedia search to get more information on a highlighted word or phrase. This way I dont have to keep changing the preferred search engine in the options menu. Also, the ability to add multiple custom searches to my list of choices would be great too. Keep up the good work!

  2. I agree with Nathan. If I could choose a search engine from a second level of the popup menu, it would be da bomb. I use dictionary and encyclopedia searches constantly while writing. For now, I copy and paste it into the searchbar.

  3. I decided to add in a feature that I’d like to have, the ability to search on words in <textarea> and <input type="text">. It is handy because when I’m typing e-mails in squirrelmail or googlemail or something like this, I can check words that I’m not sure I’m spelling correctly. I just added some lines to two of the functions in the defineWordOverlay.js (not sure if this will format correctly or not):

    showHide: function() {
    var isTextSelection = false;

    if(gContextMenu)
    if (gContextMenu.isTextSelected)
    isTextSelection = true;
    else if (gContextMenu.onTextInput) {
    // context menu request came from a text field (textarea or input type=text)
    // get it and check to see if the selected text is greater in length than 0
    var text = document.popupNode;
    if (text.selectionEnd – text.selectionStart > 0)
    isTextSelection = true;
    }

    for(var i=0; i<definewordMenuItems.length; i++) {
    var menuitem = document.getElementById(definewordMenuItems[i]);
    if(menuitem) {
    menuitem.hidden = !isTextSelection;
    }
    }
    },

    openALink: function(e) {
    var selText = gContextMenu.searchSelected();
    if (gContextMenu.onTextInput) {
    // need to get the selected text from the text field
    var text = document.popupNode;
    selText = text.value.substring(text.selectionStart, text.selectionEnd);
    }
    if (selText == “”) {
    // shouldn’t get here, but throw an error via an alert
    alert(“No Text Selected!\nPlease select some text first.”);
    } else {
    this.openLink(this.getGoogleURL(selText));
    }
    },

    Don’t know if you want to put it in your version or not, but I’ve found it to be rather handy and thought I would pass it along. Gave me a chance to try my hand at working on a mozilla extension.

Comments are closed.