Skip to content

Instantly share code, notes, and snippets.

@bogado
Created September 10, 2009 13:21
Show Gist options
  • Save bogado/184546 to your computer and use it in GitHub Desktop.
Save bogado/184546 to your computer and use it in GitHub Desktop.
CmdUtils.CreateCommand({
names: ["site search"],
icon: "http://www.google.com/favicon.ico",
description: "Search, using google, on the current site only.",
author: {name: "Victor Bogado", email: "victor@bogado.net"},
license: "GPL",
arguments: [{role: 'object', nountype: noun_arb_text}],
preview: function preview(pblock, args) {
pblock.innerHTML = "Search <b>" + args.object.html + "</b> on " + CmdUtils.getDocument().location.host + ".";
},
execute: function execute(args) {
Utils.openUrlInBrowser("http://www.google.com/search?q=" + args.object.html + "+site:" + CmdUtils.getDocument().location.host);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment