Pier Angelo Vendrame pushed to branch base-browser-102.7.0esr-12.5-1 at The Tor Project / Applications / Tor Browser
Commits: 971383bf by Henry Wilkes at 2023-02-08T10:24:49+00:00 fixup! Firefox preference overrides.
Bug 41609: Set home page and new tab to about:blank in base-browser.
- - - - - 2bbd2240 by Henry Wilkes at 2023-02-08T10:24:59+00:00 Bug 31575: Disable Firefox Home (Activity Stream)
Treat about:blank as the default home page and new tab page.
Avoid loading AboutNewTab in BrowserGlue.jsm in order to avoid several network requests that we do not need.
- - - - -
6 changed files:
- browser/app/profile/001-base-profile.js - browser/components/BrowserGlue.jsm - browser/components/newtab/AboutNewTabService.jsm - browser/components/preferences/home.inc.xhtml - browser/components/preferences/home.js - browser/modules/HomePage.jsm
Changes:
===================================== browser/app/profile/001-base-profile.js ===================================== @@ -4,6 +4,11 @@ // Use the OS locale by default (tor-browser#17400) pref("intl.locale.requested", "");
+// Home page and new tab is blank rather than Firefox Home (Activity Stream). +// tor-browser#31575 and tor-browser#30662 +pref("browser.startup.homepage", "about:blank"); +pref("browser.newtabpage.enabled", false); + // Disable initial homepage notifications pref("browser.search.update", false); pref("startup.homepage_welcome_url", ""); @@ -151,7 +156,6 @@ pref("services.sync.engine.passwords", false); pref("services.sync.engine.prefs", false); pref("services.sync.engine.tabs", false); pref("extensions.getAddons.cache.enabled", false); // https://blog.mozilla.org/addons/how-to-opt-out-of-add-on-metadata-updates/ -pref("browser.newtabpage.enabled", false); pref("browser.search.region", "US"); // The next two prefs disable GeoIP search lookups (#16254) pref("browser.search.geoip.url", ""); pref("browser.fixup.alternate.enabled", false); // Bug #16783: Prevent .onion fixups
===================================== browser/components/BrowserGlue.jsm ===================================== @@ -18,7 +18,6 @@ const { AppConstants } = ChromeUtils.import( );
XPCOMUtils.defineLazyModuleGetters(this, { - AboutNewTab: "resource:///modules/AboutNewTab.jsm", ActorManagerParent: "resource://gre/modules/ActorManagerParent.jsm", AddonManager: "resource://gre/modules/AddonManager.jsm", AppMenuNotifications: "resource://gre/modules/AppMenuNotifications.jsm", @@ -223,28 +222,6 @@ let JSWINDOWACTORS = { remoteTypes: ["privilegedabout"], },
- AboutNewTab: { - parent: { - moduleURI: "resource:///actors/AboutNewTabParent.jsm", - }, - child: { - moduleURI: "resource:///actors/AboutNewTabChild.jsm", - events: { - DOMContentLoaded: {}, - pageshow: {}, - visibilitychange: {}, - }, - }, - // The wildcard on about:newtab is for the ?endpoint query parameter - // that is used for snippets debugging. The wildcard for about:home - // is similar, and also allows for falling back to loading the - // about:home document dynamically if an attempt is made to load - // about:home?jscache from the AboutHomeStartupCache as a top-level - // load. - matches: ["about:home*", "about:welcome", "about:newtab*"], - remoteTypes: ["privilegedabout"], - }, - AboutPlugins: { parent: { moduleURI: "resource:///actors/AboutPluginsParent.jsm", @@ -1576,8 +1553,6 @@ BrowserGlue.prototype = {
// the first browser window has finished initializing _onFirstWindowLoaded: function BG__onFirstWindowLoaded(aWindow) { - AboutNewTab.init(); - TabCrashHandler.init();
ProcessHangMonitor.init(); @@ -5785,12 +5760,8 @@ var AboutHomeStartupCache = { return { pageInputStream: null, scriptInputStream: null }; }
- let state = AboutNewTab.activityStream.store.getState(); - return new Promise(resolve => { - this._cacheDeferred = resolve; - this.log.trace("Parent is requesting cache streams."); - this._procManager.sendAsyncMessage(this.CACHE_REQUEST_MESSAGE, { state }); - }); + this.log.error("Activity Stream is disabled."); + return { pageInputStream: null, scriptInputStream: null }; },
/**
===================================== browser/components/newtab/AboutNewTabService.jsm ===================================== @@ -420,20 +420,7 @@ class BaseAboutNewTabService { * the newtab page has no effect on the result of this function. */ get defaultURL() { - // Generate the desired activity stream resource depending on state, e.g., - // "resource://activity-stream/prerendered/activity-stream.html" - // "resource://activity-stream/prerendered/activity-stream-debug.html" - // "resource://activity-stream/prerendered/activity-stream-noscripts.html" - return [ - "resource://activity-stream/prerendered/", - "activity-stream", - // Debug version loads dev scripts but noscripts separately loads scripts - this.activityStreamDebug && !this.privilegedAboutProcessEnabled - ? "-debug" - : "", - this.privilegedAboutProcessEnabled ? "-noscripts" : "", - ".html", - ].join(""); + return "about:blank"; }
get welcomeURL() {
===================================== browser/components/preferences/home.inc.xhtml ===================================== @@ -33,7 +33,6 @@ class="check-home-page-controlled" data-preference-related="browser.startup.homepage"> <menupopup> - <menuitem value="0" data-l10n-id="home-mode-choice-default" /> <menuitem value="2" data-l10n-id="home-mode-choice-custom" /> <menuitem value="1" data-l10n-id="home-mode-choice-blank" /> </menupopup> @@ -84,7 +83,6 @@ Preferences so we need to handle setting the pref manually.--> <menulist id="newTabMode" flex="1" data-preference-related="browser.newtabpage.enabled"> <menupopup> - <menuitem value="0" data-l10n-id="home-mode-choice-default" /> <menuitem value="1" data-l10n-id="home-mode-choice-blank" /> </menupopup> </menulist>
===================================== browser/components/preferences/home.js ===================================== @@ -380,10 +380,14 @@ var gHomePane = {
if (controllingExtension && controllingExtension.id) { newValue = controllingExtension.id; - } else if (isDefault) { - newValue = this.HOME_MODE_FIREFOX_HOME; } else if (isBlank) { + // For base-browser, we want to check isBlank first since the default page + // is also the blank page, but we only have a menu option for + // HOME_MODE_BLANK, rather than HOME_MODE_FIREFOX_HOME. + // See tor-browser#41609. newValue = this.HOME_MODE_BLANK; + } else if (isDefault) { + newValue = this.HOME_MODE_FIREFOX_HOME; } else { newValue = this.HOME_MODE_CUSTOM; }
===================================== browser/modules/HomePage.jsm ===================================== @@ -21,7 +21,7 @@ XPCOMUtils.defineLazyModuleGetters(this, { });
const kPrefName = "browser.startup.homepage"; -const kDefaultHomePage = "about:home"; +const kDefaultHomePage = "about:blank"; const kExtensionControllerPref = "browser.startup.homepage_override.extensionControlled"; const kHomePageIgnoreListId = "homepage-urls";
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/2b933eb...
tbb-commits@lists.torproject.org