1 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
2 * vim: sw=2 ts=2 sts=2 expandtab
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 export const AboutPagesUtils = {};
9 ChromeUtils.defineLazyGetter(AboutPagesUtils, "visibleAboutUrls", () => {
11 const rx = /@mozilla.org\/network\/protocol\/about;1\?what\=(.*)$/;
12 for (const cid in Cc) {
13 const result = cid.match(rx);
17 const [, aboutType] = result;
19 const am = Cc[cid].getService(Ci.nsIAboutModule);
20 const uri = Services.io.newURI(`about:${aboutType}`);
21 const flags = am.getURIFlags(uri);
22 if (!(flags & Ci.nsIAboutModule.HIDE_FROM_ABOUTABOUT)) {
23 urls.push(`about:${aboutType}`);
26 // getService() might have thrown if the component doesn't actually
27 // implement nsIAboutModule