-
-
Save MarcinSwierczynski/19735 to your computer and use it in GitHub Desktop.
Look for movies in polish site: filmweb.pl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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