Skip to content

Instantly share code, notes, and snippets.

@10sr
Created May 12, 2010 16:11
Show Gist options
  • Select an option

  • Save 10sr/398767 to your computer and use it in GitHub Desktop.

Select an option

Save 10sr/398767 to your computer and use it in GitHub Desktop.
keysnailで文字入力→検索エンジン選択みたいな
plugins.options["search-url-list"] = [
["bing","http://bing.com/search?q=%q"],
["raw","%r"],
];
ext.add("query-then-engine", function () {
prompt.read("Search Word?:", function (q) {
if (q) {
prompt.selector({ message : "search \"" + q + "\" with?",
collection : plugins.options["search-url-list"],
width : [20,80],
callback : function (i) { if (window.loadURI) {getBrowser().selectedTab = getBrowser().addTab(plugins.options["search-url-list"][i][1].replace("%r",q).replace("%q",encodeURIComponent(q)));} },
});
};
});
}, "enter search word and then select engine");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment