Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
TheFreeDictionary.com - Gives the meaning of a word, in a given language
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
You can’t perform that action at this time.