refactor: simplify overlay loading for about:preferences
(cherry picked from commit 02b9daab060d607d9b406725635e089f3a88e3ca)
This commit is contained in:
@@ -52,11 +52,8 @@ const WaterfoxGlue = {
|
||||
case "preferences-general":
|
||||
uri = "resource://waterfox/overlays/preferences-general.overlay";
|
||||
break;
|
||||
case "preferences-privacy":
|
||||
uri = "resource://waterfox/overlays/preferences-privacy.overlay";
|
||||
break;
|
||||
case "preferences-home":
|
||||
uri = "resource://waterfox/overlays/preferences-home.overlay";
|
||||
case "preferences-other":
|
||||
uri = "resource://waterfox/overlays/preferences-other.overlay";
|
||||
break;
|
||||
}
|
||||
let chromeManifest = new ChromeManifest(async () => {
|
||||
@@ -123,22 +120,14 @@ const WaterfoxGlue = {
|
||||
) {
|
||||
subject.setTimeout(async () => {
|
||||
await Overlays.load(
|
||||
await this.getChromeManifest("preferences-privacy"),
|
||||
subject
|
||||
);
|
||||
await Overlays.load(
|
||||
await this.getChromeManifest("preferences-home"),
|
||||
await this.getChromeManifest("preferences-other"),
|
||||
subject
|
||||
);
|
||||
subject.privacyInitialized = true;
|
||||
}, 500);
|
||||
} else {
|
||||
await Overlays.load(
|
||||
await this.getChromeManifest("preferences-privacy"),
|
||||
subject
|
||||
);
|
||||
await Overlays.load(
|
||||
await this.getChromeManifest("preferences-home"),
|
||||
await this.getChromeManifest("preferences-other"),
|
||||
subject
|
||||
);
|
||||
subject.privacyInitialized = true;
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<overlay id="preferences-overlay" xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<vbox data-subcategory="topstories" delete="true" />
|
||||
<vbox data-subcategory="snippets" delete="true" />
|
||||
</overlay>
|
||||
@@ -6,6 +6,12 @@
|
||||
|
||||
<overlay id="preferences-overlay" xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<!-- Home -->
|
||||
<vbox data-subcategory="topstories" delete="true" />
|
||||
<vbox data-subcategory="snippets" delete="true" />
|
||||
|
||||
<!-- Privacy -->
|
||||
<script>
|
||||
/* eslint-env mozilla/browser-window */
|
||||
/* globals gPrivacyPaneOverlay */
|
||||
@@ -1,12 +1,10 @@
|
||||
browser.jar:
|
||||
% content browser %content/browser/ contentaccessible=yes
|
||||
* content/browser/overlays/preferences-general.xhtml (content/preferences-general.xhtml)
|
||||
content/browser/overlays/preferences-privacy.xhtml (content/preferences-privacy.xhtml)
|
||||
content/browser/overlays/preferences-home.xhtml (content/preferences-home.xhtml)
|
||||
content/browser/overlays/preferences-other.xhtml (content/preferences-other.xhtml)
|
||||
content/browser/overlays/general.js (content/general.js)
|
||||
content/browser/overlays/privacy.js (content/privacy.js)
|
||||
|
||||
% resource waterfox %waterfox/ contentaccessible=yes
|
||||
waterfox/overlays/preferences-general.overlay (preferences-general.overlay)
|
||||
waterfox/overlays/preferences-privacy.overlay (preferences-privacy.overlay)
|
||||
waterfox/overlays/preferences-home.overlay (preferences-home.overlay)
|
||||
waterfox/overlays/preferences-other.overlay (preferences-other.overlay)
|
||||
|
||||
@@ -1 +1 @@
|
||||
overlay about:preferences chrome://browser/content/overlays/preferences-home.xhtml
|
||||
overlay about:preferences chrome://browser/content/overlays/preferences-other.xhtml
|
||||
@@ -1 +0,0 @@
|
||||
overlay about:preferences chrome://browser/content/overlays/preferences-privacy.xhtml
|
||||
Reference in New Issue
Block a user