Loading browser/components/preferences/config/home-startup.mjs +7 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,10 @@ import { SettingGroupManager } from "chrome://browser/content/preferences/config/SettingGroupManager.mjs"; import { Preferences } from "chrome://global/content/preferences/Preferences.mjs"; const { AboutPreferences } = ChromeUtils.importESModule( "moz-src:///browser/extensions/newtab/lib/AboutPreferences.sys.mjs" ); /* * Preferences: * Loading Loading @@ -32,4 +36,7 @@ if (Services.prefs.getBoolPref("browser.settings-redesign.enabled")) { defaultBrowserHome: window.createDefaultBrowserConfig(), startupHome: window.createStartupConfig(), }); // Register the rest of the home settings using the "newtab" extension's file. // tor-browser#44830. new AboutPreferences().baseBrowserRegisterGroups(window); } browser/extensions/moz.build +5 −0 Original line number Diff line number Diff line Loading @@ -5,3 +5,8 @@ DIRS += [] JAR_MANIFESTS += ["jar.mn"] # Hack in the AboutPreferences.sys.mjs file, which is needed for the home # settings pane, and can more-or-less function without the rest of the "newtab" # extension. tor-browser#44830. MOZ_SRC_FILES += ["newtab/lib/AboutPreferences.sys.mjs"] browser/extensions/newtab/lib/AboutPreferences.sys.mjs +25 −9 Original line number Diff line number Diff line Loading @@ -2,15 +2,14 @@ * 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/. */ import { actionTypes as at, actionCreators as ac, } from "resource://newtab/common/Actions.mjs"; import { WIDGET_REGISTRY, isWidgetToggleVisible, isWidgetsContainerVisible, } from "resource://newtab/common/WidgetsRegistry.mjs"; // The newtab extension is not available in base browser, so we replace the // imports with empty objects that we do *not* expect to be used in practice. // See tor-browser#44830. const at = {}; const ac = {}; const WIDGET_REGISTRY = []; const isWidgetToggleVisible = () => {}; const isWidgetsContainerVisible = () => {}; const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { Loading Loading @@ -347,6 +346,23 @@ export class AboutPreferences { this.toggleRestoreDefaults(window.gHomePane); } /** * Register the setting groups for base browser. * * Added for tor-browser#44830. * * @param {Window} window - The about:preferences window. */ baseBrowserRegisterGroups(window) { // We do not register the "home" component, since this is specific for // Firefox Home. tor-browser#44830. window.MozXULElement.insertFTLIfNeeded("browser/newtab/newtab.ftl"); window.SettingGroupManager.registerGroups({ homepage: this._setupHomepageGroup(window), customHomepage: this._setupCustomHomepageGroup(window), }); } /** @param {Window} window */ _registerPreferences(window) { const { Preferences } = window; Loading Loading
browser/components/preferences/config/home-startup.mjs +7 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,10 @@ import { SettingGroupManager } from "chrome://browser/content/preferences/config/SettingGroupManager.mjs"; import { Preferences } from "chrome://global/content/preferences/Preferences.mjs"; const { AboutPreferences } = ChromeUtils.importESModule( "moz-src:///browser/extensions/newtab/lib/AboutPreferences.sys.mjs" ); /* * Preferences: * Loading Loading @@ -32,4 +36,7 @@ if (Services.prefs.getBoolPref("browser.settings-redesign.enabled")) { defaultBrowserHome: window.createDefaultBrowserConfig(), startupHome: window.createStartupConfig(), }); // Register the rest of the home settings using the "newtab" extension's file. // tor-browser#44830. new AboutPreferences().baseBrowserRegisterGroups(window); }
browser/extensions/moz.build +5 −0 Original line number Diff line number Diff line Loading @@ -5,3 +5,8 @@ DIRS += [] JAR_MANIFESTS += ["jar.mn"] # Hack in the AboutPreferences.sys.mjs file, which is needed for the home # settings pane, and can more-or-less function without the rest of the "newtab" # extension. tor-browser#44830. MOZ_SRC_FILES += ["newtab/lib/AboutPreferences.sys.mjs"]
browser/extensions/newtab/lib/AboutPreferences.sys.mjs +25 −9 Original line number Diff line number Diff line Loading @@ -2,15 +2,14 @@ * 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/. */ import { actionTypes as at, actionCreators as ac, } from "resource://newtab/common/Actions.mjs"; import { WIDGET_REGISTRY, isWidgetToggleVisible, isWidgetsContainerVisible, } from "resource://newtab/common/WidgetsRegistry.mjs"; // The newtab extension is not available in base browser, so we replace the // imports with empty objects that we do *not* expect to be used in practice. // See tor-browser#44830. const at = {}; const ac = {}; const WIDGET_REGISTRY = []; const isWidgetToggleVisible = () => {}; const isWidgetsContainerVisible = () => {}; const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { Loading Loading @@ -347,6 +346,23 @@ export class AboutPreferences { this.toggleRestoreDefaults(window.gHomePane); } /** * Register the setting groups for base browser. * * Added for tor-browser#44830. * * @param {Window} window - The about:preferences window. */ baseBrowserRegisterGroups(window) { // We do not register the "home" component, since this is specific for // Firefox Home. tor-browser#44830. window.MozXULElement.insertFTLIfNeeded("browser/newtab/newtab.ftl"); window.SettingGroupManager.registerGroups({ homepage: this._setupHomepageGroup(window), customHomepage: this._setupCustomHomepageGroup(window), }); } /** @param {Window} window */ _registerPreferences(window) { const { Preferences } = window; Loading