Created
July 10, 2009 23:46
-
-
Save harlemblues/144913 to your computer and use it in GitHub Desktop.
TheFreeDictionary.com - Gives the meaning of a word, in a given language
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Components.utils.import("resource://ubiquity/modules/setup.js"); | |
const defaultLang = UbiquitySetup.languageCode; | |
CmdUtils.CreateCommand({ | |
names: ["TFD", "TheFreeDictionary"], | |
arguments: [{role: "object", | |
nountype: noun_arb_text, | |
label: "word"}, | |
{role: "format", | |
nountype: noun_type_lang_wikipedia, | |
label: "language"}], | |
locale: "en-US", | |
homepage: "http://www.thefreedictionary.com/", | |
author: {name: "harlemblues", email: ""}, | |
license: "MPL", | |
icon: "http://www.thefreedictionary.com/favicon.ico", | |
description: "Gives the meaning of a word, in a given language, using TheFreeDictionary", | |
execute: function(arguments) { | |
var lang = arguments.format.data || defaultLang; | |
var searchUrl = "http://" + lang + ".thefreedictionary.com/"; | |
var searchParams = arguments.object.text; | |
Utils.openUrlInBrowser(searchUrl + searchParams); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment