1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 16:47:59 +01:00

Completion of certain chrome:, resource:, and about: URLs.

This commit is contained in:
Kris Maglione
2010-12-14 23:05:41 -05:00
parent 50e47b9b2f
commit 0dcf1d8ffd
9 changed files with 118 additions and 41 deletions

View File

@@ -864,6 +864,16 @@ const Completion = Module("completion", {
if (complete == null)
complete = options["complete"];
if (/^about:/.test(context.filter)) {
context.fork("about", 6, this, function (context) {
context.generate = function () {
const PREFIX = "@mozilla.org/network/protocol/about;1?what=";
return [[k.substr(PREFIX.length), ""] for (k in Cc) if (k.indexOf(PREFIX) == 0)]
}
});
}
// Will, and should, throw an error if !(c in opts)
Array.forEach(complete, function (c) {
let completer = completion.urlCompleters[c];