Skip to content

Commit 2592a3d

Browse files
amzyangmaxauthority
authored andcommitted
add auto completion for about urls (#595)
eg: about:config, about:addons etc
1 parent 68f704c commit 2592a3d

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

common/content/completion.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,17 @@ const Completion = Module("completion", {
717717
if (options.urlseparator)
718718
skip = context.filter.match("^.*" + options.urlseparator); // start after the last 'urlseparator'
719719

720+
if (/^about:/.test(context.filter))
721+
context.fork("about", 6, this, function fork_(context) {
722+
context.title = ["about:"];
723+
context.generate = function generate_() {
724+
return Object.keys(Cc).filter(k => k.startsWith(services.ABOUT))
725+
.map(k => [k.substr(services.ABOUT.length),
726+
""]);
727+
};
728+
});
729+
730+
720731
if (skip)
721732
context.advance(skip[0].length);
722733

common/content/services.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @constructor
1212
*/
1313
const Services = Module("services", {
14+
ABOUT: "@mozilla.org/network/protocol/about;1?what=",
1415
init: function () {
1516
this.classes = {};
1617
this.jsm = window.Services;

0 commit comments

Comments
 (0)