Skip to content

Instantly share code, notes, and snippets.

@MarcinSwierczynski
Created October 25, 2008 12:42
Show Gist options
  • Save MarcinSwierczynski/19735 to your computer and use it in GitHub Desktop.
Save MarcinSwierczynski/19735 to your computer and use it in GitHub Desktop.
Look for movies in polish site: filmweb.pl
function openUrl(url, postData) {
var windowManager = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
var browserWindow = windowManager.getMostRecentWindow("navigator:browser");
var browser = browserWindow.getBrowser();
if(browser.mCurrentBrowser.currentURI.spec == "about:blank")
browserWindow.loadURI(url, null, postData, false);
else
browser.loadOneTab(url, null, null, postData, false, false);
}
CmdUtils.CreateCommand({
name: "filmweb",
icon: "http://gfx.filmweb.pl/gf/favicon.ico",
takes: {"movie title": noun_arb_text},
locale: "pl-PL",
author: {name: "Marcin Świerczyński", email: "[email protected]"},
license: "GPL",
execute: function(inputObject) {
var searchUrl = "http://www.filmweb.pl/szukaj";
var searchParams = {q: inputObject.text};
openUrl(searchUrl + Utils.paramsToString(searchParams));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment