├── profile └── chrome │ └── utils │ ├── chrome.manifest │ └── aboutconfig │ ├── config.css │ ├── config.xhtml │ └── config.js ├── installdir ├── defaults │ └── pref │ │ └── autoconfig.js └── _autoconfig.cfg ├── README.md └── aboutcfg.jsm /profile/chrome/utils/chrome.manifest: -------------------------------------------------------------------------------- 1 | content userchromejs ./ 2 | -------------------------------------------------------------------------------- /installdir/defaults/pref/autoconfig.js: -------------------------------------------------------------------------------- 1 | // Any comment. You must start the file with a single-line comment! 2 | 3 | pref("general.config.filename", "_autoconfig.cfg", locked); 4 | pref("general.config.obscure_value", 0, locked); 5 | pref("general.config.sandbox_enabled", false, locked); 6 | -------------------------------------------------------------------------------- /installdir/_autoconfig.cfg: -------------------------------------------------------------------------------- 1 | // skip 1st line 2 | 3 | try { 4 | let cmanifest = Cc['@mozilla.org/file/directory_service;1'].getService(Ci.nsIProperties).get('UChrm', Ci.nsIFile); 5 | cmanifest.append('utils'); 6 | cmanifest.append('chrome.manifest'); 7 | 8 | if(cmanifest.exists()){ 9 | Components.manager.QueryInterface(Ci.nsIComponentRegistrar).autoRegister(cmanifest); 10 | 11 | //Cu.import('chrome://userchromejs/content/aboutcfg.jsm'); 12 | } 13 | 14 | } catch(ex) {}; 15 | -------------------------------------------------------------------------------- /profile/chrome/utils/aboutconfig/config.css: -------------------------------------------------------------------------------- 1 | /* This Source Code Form is subject to the terms of the Mozilla Public 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 | 5 | #warningScreen { 6 | font-size: 15px; 7 | padding-top: 0; 8 | padding-bottom: 0; 9 | padding-inline-start: calc(48px + 4.6em); 10 | padding-inline-end: 48px; 11 | } 12 | 13 | .title { 14 | background-image: url("chrome://global/skin/icons/warning.svg"); 15 | fill: #fcd100; 16 | } 17 | 18 | #warningTitle { 19 | font-weight: lighter; 20 | line-height: 1.2; 21 | margin: 0; 22 | margin-bottom: .5em; 23 | } 24 | 25 | #warningText { 26 | margin: 1em 0; 27 | } 28 | 29 | #warningButton { 30 | margin-top: 0.6em; 31 | } 32 | 33 | #filterRow { 34 | margin-top: 4px; 35 | margin-inline-start: 4px; 36 | } 37 | 38 | #configTree { 39 | margin-top: 4px; 40 | margin-bottom: 4px; 41 | } 42 | 43 | #configTreeBody::-moz-tree-cell-text(user) { 44 | font-weight: bold; 45 | } 46 | 47 | #configTreeBody::-moz-tree-cell-text(locked) { 48 | font-style: italic; 49 | } 50 | 51 | .deck-selected { 52 | max-width: 100vw; 53 | } 54 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## aboutconfig 2 | 3 | The bare minimum to keep the old XUL-based `about:config` version available in Firefox 87+ 4 | 5 | Mostly copied from https://github.com/xiaoxiaoflood/firefox-scripts, all credit goes to them. 6 | 7 | All credit goes to [@aminomancer](https://github.com/aminomancer/) for the idea and the code for registering a proper about: page! 8 | 9 | 10 | ## Installation 11 | 12 | 1. download and extract the [master.zip](https://github.com/earthlng/aboutconfig/archive/main.zip) 13 | 2. copy the files/folders from `installdir` into your Firefox installation folder and the `chrome` folder from `profile` into your profile directory 14 | 3. load `about:support` and click the button "Clear startup cache..." (not sure if this is really necessary) 15 | 4. restart Firefox 16 | 5. you can now access the old `about:config` via `chrome://userchromejs/content/aboutconfig/config.xhtml` 17 | 18 | Optionally you can also let the script register an `about:cfg` page. To do that, copy/move `aboutcfg.jsm` into the `profile/chrome/utils/` folder 19 | and uncomment the 2nd-to-last line in the `_autoconfig.cfg` file.
20 | Now you can access the old about:config page at `about:cfg` ! 21 | 22 | ### How it works 23 | 24 | - `autoconfig.js` tells Firefox to load the autoconfig file `_autoconfig.cfg` 25 | - `_autoconfig.cfg` tells Firefox to load the `chrome.manifest` from the chrome directory in the profile folder 26 | - `chrome.manifest` registers a `chrome://` namespace `userchromejs` 27 | 28 | 29 | #### original files + modifications made 30 | 31 | Mozilla removed the old `about:config` in https://hg.mozilla.org/mozilla-central/rev/2e2f7a1fd4fa 32 | 33 | see the above link for the original files: 34 | 35 | - toolkit/components/viewconfig/content/config.js 36 | - toolkit/components/viewconfig/content/config.xhtml 37 | - toolkit/locales/en-US/toolkit/about/aboutConfig.ftl 38 | - toolkit/themes/shared/config.css 39 | 40 | The only modifications are: 41 | 1. hardcoding all the localization stuff from aboutConfig.ftl into config.js and config.xhtml 42 | 2. remove the unnecessary telemetry stuff from config.js 43 | -------------------------------------------------------------------------------- /aboutcfg.jsm: -------------------------------------------------------------------------------- 1 | /*** register an about:cfg page ... 2 | * 3 | * We're not just faking it, this makes it a bona-fide about: page. 4 | * That means you can navigate to it by just typing about:cfg in the urlbar, and the identity icon will show it as a secure system page rather than a local file. 5 | * And about:cfg will even show up on the about:about page! 6 | * 7 | * This technically also makes using the aboutconfig module safer, because it denies the document access to some privileged stuff that it would have with a chrome:// URI. 8 | * 9 | * Optionally edit the config.xhtml file and remove line 13: title="about:config". 10 | * That line sets the tab title to about:config, which (with this script) isn't necessary or desirable since we're changing the URL to about:cfg. 11 | * Without the title attribute, Firefox will automatically set the title to the tab's URL, which is about:cfg. 12 | * 13 | * Big THANKS to @aminomancer ( https://github.com/aminomancer/ ) 14 | * 15 | ***/ 16 | 17 | (() => { 18 | //const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); 19 | let { classes: Cc, interfaces: Ci, manager: Cm, utils: Cu, results: Cr } = Components; 20 | const registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar); 21 | 22 | let dir = Services.dirsvc.get("UChrm", Ci.nsIFile); 23 | let appendFn = (nm) => dir.append(nm); 24 | 25 | ["utils", "aboutconfig", "config.xhtml"].forEach(appendFn); 26 | if (!dir.exists()) return; 27 | 28 | // generate a unique ID on every app launch. protection against the very unlikely possibility that a 29 | // future update adds a component with the same class ID, which would break the script. 30 | function generateFreeCID() { 31 | let uuid = Components.ID(Services.uuid.generateUUID().toString()); 32 | // I can't tell whether generateUUID is guaranteed to produce a unique ID, or just a random ID. 33 | // so I add this loop to regenerate it in the extremely unlikely (or potentially impossible) 34 | // event that the UUID is already registered as a CID. 35 | while (registrar.isCIDRegistered(uuid)) { 36 | uuid = Components.ID(Services.uuid.generateUUID().toString()); 37 | } 38 | return uuid; 39 | } 40 | 41 | const urlString = 'chrome://userchromejs/content/aboutconfig/config.xhtml'; 42 | 43 | function VintageAboutConfig() {} 44 | 45 | VintageAboutConfig.prototype = { 46 | get uri() { 47 | if (!urlString) return null; 48 | return this._uri || (this._uri = Services.io.newURI(urlString)); 49 | }, 50 | newChannel: function (_uri, loadInfo) { 51 | const ch = Services.io.newChannelFromURIWithLoadInfo(this.uri, loadInfo); 52 | ch.owner = Services.scriptSecurityManager.getSystemPrincipal(); 53 | return ch; 54 | }, 55 | getURIFlags: function (_uri) { 56 | return Ci.nsIAboutModule.ALLOW_SCRIPT | Ci.nsIAboutModule.IS_SECURE_CHROME_UI; 57 | }, 58 | getChromeURI: function (_uri) { 59 | return this.uri; 60 | }, 61 | QueryInterface: ChromeUtils.generateQI(["nsIAboutModule"]), 62 | }; 63 | 64 | var AboutModuleFactory = { 65 | createInstance(aIID) { 66 | return new VintageAboutConfig().QueryInterface(aIID); 67 | }, 68 | QueryInterface: ChromeUtils.generateQI(["nsIFactory"]), 69 | }; 70 | 71 | registrar.registerFactory( 72 | generateFreeCID(), 73 | 'about:cfg', 74 | '@mozilla.org/network/protocol/about;1?what=cfg', 75 | AboutModuleFactory 76 | ); 77 | 78 | })(); 79 | 80 | let EXPORTED_SYMBOLS = []; 81 | -------------------------------------------------------------------------------- /profile/chrome/utils/aboutconfig/config.xhtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 22 | 23 |