Skip to content

Instantly share code, notes, and snippets.

@Nocsaron
Created April 30, 2009 03:06
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 Nocsaron/104230 to your computer and use it in GitHub Desktop.
Save Nocsaron/104230 to your computer and use it in GitHub Desktop.
CmdUtils.CreateCommand({
name: "multi-search",
takes: {"search_string": noun_arb_text},
description: "Open a new page with the URL you requested.",
author: { name: "Nicholas Callahan", email: "scubacallahan@aim.com"},
homepage: "http://www.myspace.com/scubacallahan",
license: "Public domain",
preview: "Open webpage",
execute: function( directObj ) {
var search_string = encodeURIComponent(directObj.text);
var windowManager = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
var browserWindow = windowManager.getMostRecentWindow("navigator:browser");
var browser = browserWindow.getBrowser();
browser.loadOneTab("http://" + search_string, null, null, null, false, false);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment