
henry pushed to branch tor-browser-140.0esr-15.0-1 at The Tor Project / Applications / Tor Browser Commits: 27defb0b by Henry Wilkes at 2025-07-16T12:05:09+01:00 amend! BB 31575: Disable Firefox Home (Activity Stream) BB 31575: Disable Firefox Home (Activity Stream) Treat about:blank as the default home page and new tab page. BB 43886: Disable the newtab component/addon. Bug 41624: Disable about:pocket-* pages. Bug 40144: Redirect about:privatebrowsing to the user's home - - - - - e6335a46 by Henry Wilkes at 2025-07-16T12:05:20+01:00 fixup! TB 7494: Create local home page for TBB. TB 43886: Drop tor-browser changes to AboutNewTabRedirector.sys.mjs since the module is now excluded. - - - - - a4abc77c by Henry Wilkes at 2025-07-16T12:05:21+01:00 fixup! BB 31575: Disable Firefox Home (Activity Stream) TB 43886: Drop base-browser changes to AboutNewTabRedirector.sys.mjs since the module is now excluded. - - - - - dba06fad by Henry Wilkes at 2025-07-16T12:05:22+01:00 fixup! TB 7494: Create local home page for TBB. TB 43886: Move about:tor redirector to browser/components/about/ and change the home page to about:tor. - - - - - 10 changed files: - browser/actors/moz.build - browser/components/BrowserComponents.manifest - browser/components/BrowserGlue.sys.mjs - browser/components/about/AboutRedirector.cpp - browser/components/about/components.conf - browser/components/moz.build - browser/components/newtab/AboutNewTabRedirector.sys.mjs - browser/modules/AboutNewTab.sys.mjs - docshell/base/nsAboutRedirector.cpp - docshell/build/components.conf Changes: ===================================== browser/actors/moz.build ===================================== @@ -32,8 +32,7 @@ with Files("WebRTCChild.sys.mjs"): BUG_COMPONENT = ("Firefox", "Site Permissions") FINAL_TARGET_FILES.actors += [ - "AboutNewTabChild.sys.mjs", - "AboutNewTabParent.sys.mjs", + # Remove newtab actors. tor-browser#43886. "AboutPocketChild.sys.mjs", "AboutPocketParent.sys.mjs", "AboutPrivateBrowsingChild.sys.mjs", ===================================== browser/components/BrowserComponents.manifest ===================================== @@ -17,7 +17,7 @@ category browser-before-ui-startup resource://normandy/Normandy.sys.mjs Normandy #endif category browser-before-ui-startup resource:///modules/ResetPBMPanel.sys.mjs ResetPBMPanel.init category browser-before-ui-startup resource:///modules/HomepageOverride.sys.mjs HomepageOverride.check -category browser-before-ui-startup resource:///modules/AboutHomeStartupCache.sys.mjs AboutHomeStartupCache.init +# newtab component is disabled. tor-browser#43886 category browser-before-ui-startup resource:///modules/AccountsGlue.sys.mjs AccountsGlue.init # Browser window lifecycle consumers ===================================== browser/components/BrowserGlue.sys.mjs ===================================== @@ -8,7 +8,7 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { - AboutHomeStartupCache: "resource:///modules/AboutHomeStartupCache.sys.mjs", + // newtab component is disabled. tor-browser#43886 AWToolbarButton: "resource:///modules/aboutwelcome/AWToolbarUtils.sys.mjs", ASRouter: "resource:///modules/asrouter/ASRouter.sys.mjs", AddonManager: "resource://gre/modules/AddonManager.sys.mjs", @@ -569,10 +569,7 @@ BrowserGlue.prototype = { // cleanup (called on application shutdown) _dispose: function BG__dispose() { - // AboutHomeStartupCache might write to the cache during - // quit-application-granted, so we defer uninitialization - // until here. - lazy.AboutHomeStartupCache.uninit(); + // newtab component is disabled. tor-browser#43886 if (this._lateTasksIdleObserver) { this._userIdleService.removeIdleObserver( ===================================== browser/components/about/AboutRedirector.cpp ===================================== @@ -26,6 +26,18 @@ #define ABOUT_WELCOME_CHROME_URL \ "chrome://browser/content/aboutwelcome/aboutwelcome.html" #define ABOUT_HOME_URL "about:home" +// NOTE: We return "about:tor" rather than the "chrome:" path +// "chrome://browser/content/abouttor/aboutTor.html" +// The result is that the channel created in NewChannel in will have its +// resultPrincipalURI set to "about:tor". +// What this means in practice is that the loaded document's documentURI and +// currentURI will be "about:tor" rather than "about:newtab", "about:home", +// "about:welcome" or "about:privatebrowsing". +// The disadvantage of this is that we often need to add "about:tor" to places +// where "about:newtab" or other URIs appear. +// The advantage is that we maintain more control against changes in +// mozilla-central. +#define BASE_BROWSER_HOME_PAGE_URL "about:tor" namespace mozilla { namespace browser { @@ -38,6 +50,11 @@ struct RedirEntry { uint32_t flags; }; +static const uint32_t BASE_BROWSER_HOME_PAGE_FLAGS = + nsIAboutModule::URI_MUST_LOAD_IN_CHILD | + nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | + nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::IS_SECURE_CHROME_UI; + /* Entries which do not have URI_SAFE_FOR_UNTRUSTED_CONTENT will run with chrome privileges. This is potentially dangerous. Please use @@ -82,10 +99,7 @@ static const RedirEntry kRedirMap[] = { nsIAboutModule::IS_SECURE_CHROME_UI}, {"policies", "chrome://browser/content/policies/aboutPolicies.html", nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::IS_SECURE_CHROME_UI}, - {"privatebrowsing", "about:blank", - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | - nsIAboutModule::URI_MUST_LOAD_IN_CHILD | nsIAboutModule::ALLOW_SCRIPT | - nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS}, + {"privatebrowsing", "about:blank", BASE_BROWSER_HOME_PAGE_FLAGS}, {"profiling", "chrome://devtools/content/performance-new/aboutprofiling/index.html", nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::IS_SECURE_CHROME_UI}, @@ -111,11 +125,10 @@ static const RedirEntry kRedirMap[] = { {"welcomeback", "chrome://browser/content/aboutWelcomeBack.xhtml", nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::HIDE_FROM_ABOUTABOUT | nsIAboutModule::IS_SECURE_CHROME_UI}, - {"welcome", "about:blank", - nsIAboutModule::URI_MUST_LOAD_IN_CHILD | - nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS | - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | - nsIAboutModule::ALLOW_SCRIPT}, + {"welcome", "about:blank", BASE_BROWSER_HOME_PAGE_FLAGS}, + {"home", "about:blank", BASE_BROWSER_HOME_PAGE_FLAGS}, + {"newtab", "chrome://browser/content/blanktab.html", + BASE_BROWSER_HOME_PAGE_FLAGS}, {"messagepreview", "chrome://browser/content/messagepreview/messagepreview.html", nsIAboutModule::URI_MUST_LOAD_IN_CHILD | @@ -177,6 +190,8 @@ static const RedirEntry kRedirMap[] = { nsIAboutModule::URI_MUST_LOAD_IN_CHILD | nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS}, #endif + {"tor", "chrome://browser/content/abouttor/aboutTor.html", + BASE_BROWSER_HOME_PAGE_FLAGS}, // The correct URI must be obtained by GetManualChromeURI {"manual", "about:blank", nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | @@ -277,13 +292,11 @@ AboutRedirector::NewChannel(nsIURI* aURI, nsILoadInfo* aLoadInfo, if (!strcmp(path.get(), redir.id)) { nsAutoCString url; - if (path.EqualsLiteral("welcome")) { - NimbusFeatures::RecordExposureEvent("aboutwelcome"_ns, true); - if (NimbusFeatures::GetBool("aboutwelcome"_ns, "enabled"_ns, true)) { - url.AssignASCII(ABOUT_WELCOME_CHROME_URL); - } else { - url.AssignASCII(ABOUT_HOME_URL); - } + if (path.EqualsLiteral("welcome") || path.EqualsLiteral("home") || + path.EqualsLiteral("privatebrowsing") || + (path.EqualsLiteral("newtab") && + StaticPrefs::browser_newtabpage_enabled())) { + url.AssignASCII(BASE_BROWSER_HOME_PAGE_URL); } if (path.EqualsLiteral("manual")) { ===================================== browser/components/about/components.conf ===================================== @@ -10,8 +10,10 @@ pages = [ 'certerror', 'downloads', 'framecrashed', + 'home', 'logins', 'loginsimportreport', + 'newtab', 'manual', 'messagepreview', 'policies', @@ -26,6 +28,7 @@ pages = [ 'sessionrestore', 'settings', 'tabcrashed', + 'tor', 'unloads', 'welcome', 'welcomeback', ===================================== browser/components/moz.build ===================================== @@ -44,7 +44,7 @@ DIRS += [ "messagepreview", "migration", "newidentity", - "newtab", + # Exclude newtab component. tor-browser#43886. "onionservices", "originattributes", "pagedata", ===================================== browser/components/newtab/AboutNewTabRedirector.sys.mjs ===================================== @@ -416,19 +416,20 @@ class BaseAboutNewTabRedirector { * the newtab page has no effect on the result of this function. */ get defaultURL() { - // NOTE: We return "about:tor" rather than the "chrome:" path - // "chrome://browser/content/abouttor/aboutTor.html" - // The result is that the channel created in NewChannel in - // browser/components/about/AboutRedirector.cpp will have its - // resultPrincipalURI set to "about:tor". - // What this means in practice is that the loaded document's documentURI and - // currentURI will be "about:tor" rather than "about:newtab", "about:home", - // "about:welcome" or "about:privatebrowsing". - // The disadvantage of this is that we often need to add "about:tor" to - // places where "about:newtab" or other URIs appear. - // The advantage is that we maintain more control against changes in - // mozilla-central. - return "about:tor"; + // Generate the desired activity stream resource depending on state, e.g., + // "resource://newtab/prerendered/activity-stream.html" + // "resource://newtab/prerendered/activity-stream-debug.html" + // "resource://newtab/prerendered/activity-stream-noscripts.html" + return [ + "resource://newtab/prerendered/", + "activity-stream", + // Debug version loads dev scripts but noscripts separately loads scripts + this.activityStreamDebug && !this.privilegedAboutProcessEnabled + ? "-debug" + : "", + this.privilegedAboutProcessEnabled ? "-noscripts" : "", + ".html", + ].join(""); } newChannel() { ===================================== browser/modules/AboutNewTab.sys.mjs ===================================== @@ -154,6 +154,11 @@ export const AboutNewTab = { * onBrowserReady - Continues the initialization of Activity Stream after browser is ready. */ async onBrowserReady() { + if (AppConstants.BASE_BROWSER_VERSION) { + // Do not initialise ActivityStream, which we do not want and is not + // available. tor-browser#43886. + return; + } if (this.activityStream && this.activityStream.initialized) { return; } ===================================== docshell/base/nsAboutRedirector.cpp ===================================== @@ -232,11 +232,7 @@ static const RedirEntry kRedirMap[] = { nsIAboutModule::URI_CAN_LOAD_IN_CHILD | nsIAboutModule::URI_MUST_LOAD_IN_CHILD}, {"crashgpu", "about:blank", nsIAboutModule::HIDE_FROM_ABOUTABOUT}, - {"crashextensions", "about:blank", nsIAboutModule::HIDE_FROM_ABOUTABOUT}, - {"tor", "chrome://browser/content/abouttor/aboutTor.html", - nsIAboutModule::URI_MUST_LOAD_IN_CHILD | - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | - nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::IS_SECURE_CHROME_UI}}; + {"crashextensions", "about:blank", nsIAboutModule::HIDE_FROM_ABOUTABOUT}}; static const int kRedirTotal = std::size(kRedirMap); NS_IMETHODIMP ===================================== docshell/build/components.conf ===================================== @@ -31,7 +31,6 @@ about_pages = [ 'support', 'torconnect', 'translations', - 'tor', # Removed 'url-classifier'. tor-browser#42831. ] View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/c83d096... -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/c83d096... You're receiving this email because of your account on gitlab.torproject.org.