Skip to content

Instantly share code, notes, and snippets.

@cers
Created October 14, 2009 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cers/210177 to your computer and use it in GitHub Desktop.
Save cers/210177 to your computer and use it in GitHub Desktop.
CmdUtils.CreateCommand({
names: ["download"],
description: "downloads a specified url",
help: "download <url>",
author: {
name: "Christian Sonne",
email: "cers@geeksbynature.dk",
homepage: "http://geeksbynature.dk/",
},
license: "GPL",
homepage: "http://geeksbynature.dk/",
icon: "chrome://mozapps/skin/downloads/downloadIcon.png",
arguments: [{role: "object", nountype: noun_arb_text, label: "url"}],
execute: function execute(args) {
var url = args.object.text;
if (url == "") return;
context.chromeWindow.saveURL(url);
},
preview: function preview(pblock, args) {
pblock.innerHTML = _("Download the url: " + args.object.html.bold() + ".");
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment