mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-14 23:35:44 +01:00
added search suggestions (thanks to M.Terada)
This commit is contained in:
@@ -286,9 +286,25 @@ liberator.CommandLine = function () //{{{
|
||||
"Items which are completed at the :[tab]open prompt",
|
||||
"charlist", "sfbh",
|
||||
{
|
||||
validator: function (value) { return !/[^sfbhg]/.test(value); }
|
||||
validator: function (value) { return !/[^sfbhS]/.test(value); }
|
||||
});
|
||||
|
||||
liberator.options.add(["suggestengines"],
|
||||
"Engine Alias which has a feature of suggest",
|
||||
"stringlist", "google",
|
||||
{
|
||||
validator: function (value)
|
||||
{
|
||||
var ss = Components.classes["@mozilla.org/browser/search-service;1"]
|
||||
.getService(Components.interfaces.nsIBrowserSearchService);
|
||||
return value.split(",").every(function (item)
|
||||
{
|
||||
var e = ss.getEngineByAlias(item);
|
||||
return (e && e.supportsResponseType("application/x-suggestions+json")) ? true : false;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
liberator.options.add(["showmode", "smd"],
|
||||
"Show the current mode in the command line",
|
||||
"boolean", true);
|
||||
|
||||
Reference in New Issue
Block a user