henry pushed to branch base-browser-140.0esr-15.0-1 at The Tor Project / Applications / Tor Browser
Commits:
-
9bb41495
by Henry Wilkes at 2025-07-16T12:42:19+01:00
-
218d86b8
by Henry Wilkes at 2025-07-16T12:42:26+01:00
8 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
Changes:
... | ... | @@ -32,8 +32,7 @@ with Files("WebRTCChild.sys.mjs"): |
32 | 32 | BUG_COMPONENT = ("Firefox", "Site Permissions")
|
33 | 33 | |
34 | 34 | FINAL_TARGET_FILES.actors += [
|
35 | - "AboutNewTabChild.sys.mjs",
|
|
36 | - "AboutNewTabParent.sys.mjs",
|
|
35 | + # Remove newtab actors. tor-browser#43886.
|
|
37 | 36 | "AboutPocketChild.sys.mjs",
|
38 | 37 | "AboutPocketParent.sys.mjs",
|
39 | 38 | "AboutPrivateBrowsingChild.sys.mjs",
|
... | ... | @@ -16,7 +16,7 @@ category browser-before-ui-startup resource:///modules/BuiltInThemes.sys.mjs Bui |
16 | 16 | category browser-before-ui-startup resource://normandy/Normandy.sys.mjs Normandy.init
|
17 | 17 | #endif
|
18 | 18 | category browser-before-ui-startup resource:///modules/ResetPBMPanel.sys.mjs ResetPBMPanel.init
|
19 | -category browser-before-ui-startup resource:///modules/AboutHomeStartupCache.sys.mjs AboutHomeStartupCache.init
|
|
19 | +# newtab component is disabled. tor-browser#43886
|
|
20 | 20 | category browser-before-ui-startup resource:///modules/AccountsGlue.sys.mjs AccountsGlue.init
|
21 | 21 | |
22 | 22 | # Browser window lifecycle consumers
|
... | ... | @@ -8,7 +8,7 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; |
8 | 8 | const lazy = {};
|
9 | 9 | |
10 | 10 | ChromeUtils.defineESModuleGetters(lazy, {
|
11 | - AboutHomeStartupCache: "resource:///modules/AboutHomeStartupCache.sys.mjs",
|
|
11 | + // newtab component is disabled. tor-browser#43886
|
|
12 | 12 | AWToolbarButton: "resource:///modules/aboutwelcome/AWToolbarUtils.sys.mjs",
|
13 | 13 | ASRouter: "resource:///modules/asrouter/ASRouter.sys.mjs",
|
14 | 14 | AddonManager: "resource://gre/modules/AddonManager.sys.mjs",
|
... | ... | @@ -562,10 +562,7 @@ BrowserGlue.prototype = { |
562 | 562 | |
563 | 563 | // cleanup (called on application shutdown)
|
564 | 564 | _dispose: function BG__dispose() {
|
565 | - // AboutHomeStartupCache might write to the cache during
|
|
566 | - // quit-application-granted, so we defer uninitialization
|
|
567 | - // until here.
|
|
568 | - lazy.AboutHomeStartupCache.uninit();
|
|
565 | + // newtab component is disabled. tor-browser#43886
|
|
569 | 566 | |
570 | 567 | if (this._lateTasksIdleObserver) {
|
571 | 568 | this._userIdleService.removeIdleObserver(
|
... | ... | @@ -21,6 +21,7 @@ |
21 | 21 | #define ABOUT_WELCOME_CHROME_URL \
|
22 | 22 | "chrome://browser/content/aboutwelcome/aboutwelcome.html"
|
23 | 23 | #define ABOUT_HOME_URL "about:home"
|
24 | +#define BASE_BROWSER_HOME_PAGE_URL "chrome://browser/content/blanktab.html"
|
|
24 | 25 | |
25 | 26 | namespace mozilla {
|
26 | 27 | namespace browser {
|
... | ... | @@ -33,6 +34,11 @@ struct RedirEntry { |
33 | 34 | uint32_t flags;
|
34 | 35 | };
|
35 | 36 | |
37 | +static const uint32_t BASE_BROWSER_HOME_PAGE_FLAGS =
|
|
38 | + nsIAboutModule::URI_MUST_LOAD_IN_CHILD |
|
|
39 | + nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
|
|
40 | + nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::IS_SECURE_CHROME_UI;
|
|
41 | + |
|
36 | 42 | /*
|
37 | 43 | Entries which do not have URI_SAFE_FOR_UNTRUSTED_CONTENT will run with chrome
|
38 | 44 | privileges. This is potentially dangerous. Please use
|
... | ... | @@ -77,10 +83,7 @@ static const RedirEntry kRedirMap[] = { |
77 | 83 | nsIAboutModule::IS_SECURE_CHROME_UI},
|
78 | 84 | {"policies", "chrome://browser/content/policies/aboutPolicies.html",
|
79 | 85 | nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::IS_SECURE_CHROME_UI},
|
80 | - {"privatebrowsing", "about:blank",
|
|
81 | - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
|
|
82 | - nsIAboutModule::URI_MUST_LOAD_IN_CHILD | nsIAboutModule::ALLOW_SCRIPT |
|
|
83 | - nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS},
|
|
86 | + {"privatebrowsing", "about:blank", BASE_BROWSER_HOME_PAGE_FLAGS},
|
|
84 | 87 | {"profiling",
|
85 | 88 | "chrome://devtools/content/performance-new/aboutprofiling/index.html",
|
86 | 89 | nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::IS_SECURE_CHROME_UI},
|
... | ... | @@ -101,11 +104,10 @@ static const RedirEntry kRedirMap[] = { |
101 | 104 | {"welcomeback", "chrome://browser/content/aboutWelcomeBack.xhtml",
|
102 | 105 | nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::HIDE_FROM_ABOUTABOUT |
|
103 | 106 | nsIAboutModule::IS_SECURE_CHROME_UI},
|
104 | - {"welcome", "about:blank",
|
|
105 | - nsIAboutModule::URI_MUST_LOAD_IN_CHILD |
|
|
106 | - nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS |
|
|
107 | - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
|
|
108 | - nsIAboutModule::ALLOW_SCRIPT},
|
|
107 | + {"welcome", "about:blank", BASE_BROWSER_HOME_PAGE_FLAGS},
|
|
108 | + {"home", "about:blank", BASE_BROWSER_HOME_PAGE_FLAGS},
|
|
109 | + {"newtab", "chrome://browser/content/blanktab.html",
|
|
110 | + BASE_BROWSER_HOME_PAGE_FLAGS},
|
|
109 | 111 | {"messagepreview",
|
110 | 112 | "chrome://browser/content/messagepreview/messagepreview.html",
|
111 | 113 | nsIAboutModule::URI_MUST_LOAD_IN_CHILD |
|
... | ... | @@ -213,13 +215,11 @@ AboutRedirector::NewChannel(nsIURI* aURI, nsILoadInfo* aLoadInfo, |
213 | 215 | if (!strcmp(path.get(), redir.id)) {
|
214 | 216 | nsAutoCString url;
|
215 | 217 | |
216 | - if (path.EqualsLiteral("welcome")) {
|
|
217 | - NimbusFeatures::RecordExposureEvent("aboutwelcome"_ns, true);
|
|
218 | - if (NimbusFeatures::GetBool("aboutwelcome"_ns, "enabled"_ns, true)) {
|
|
219 | - url.AssignASCII(ABOUT_WELCOME_CHROME_URL);
|
|
220 | - } else {
|
|
221 | - url.AssignASCII(ABOUT_HOME_URL);
|
|
222 | - }
|
|
218 | + if (path.EqualsLiteral("welcome") || path.EqualsLiteral("home") ||
|
|
219 | + path.EqualsLiteral("privatebrowsing") ||
|
|
220 | + (path.EqualsLiteral("newtab") &&
|
|
221 | + StaticPrefs::browser_newtabpage_enabled())) {
|
|
222 | + url.AssignASCII(BASE_BROWSER_HOME_PAGE_URL);
|
|
223 | 223 | }
|
224 | 224 | |
225 | 225 | // fall back to the specified url in the map
|
... | ... | @@ -10,8 +10,10 @@ pages = [ |
10 | 10 | 'certerror',
|
11 | 11 | 'downloads',
|
12 | 12 | 'framecrashed',
|
13 | + 'home',
|
|
13 | 14 | 'logins',
|
14 | 15 | 'loginsimportreport',
|
16 | + 'newtab',
|
|
15 | 17 | 'messagepreview',
|
16 | 18 | 'policies',
|
17 | 19 | 'preferences',
|
... | ... | @@ -43,7 +43,7 @@ DIRS += [ |
43 | 43 | "messagepreview",
|
44 | 44 | "migration",
|
45 | 45 | "newidentity",
|
46 | - "newtab",
|
|
46 | + # Exclude newtab component. tor-browser#43886.
|
|
47 | 47 | "originattributes",
|
48 | 48 | "pagedata",
|
49 | 49 | "permissions",
|
... | ... | @@ -416,7 +416,20 @@ class BaseAboutNewTabRedirector { |
416 | 416 | * the newtab page has no effect on the result of this function.
|
417 | 417 | */
|
418 | 418 | get defaultURL() {
|
419 | - return "about:blank";
|
|
419 | + // Generate the desired activity stream resource depending on state, e.g.,
|
|
420 | + // "resource://newtab/prerendered/activity-stream.html"
|
|
421 | + // "resource://newtab/prerendered/activity-stream-debug.html"
|
|
422 | + // "resource://newtab/prerendered/activity-stream-noscripts.html"
|
|
423 | + return [
|
|
424 | + "resource://newtab/prerendered/",
|
|
425 | + "activity-stream",
|
|
426 | + // Debug version loads dev scripts but noscripts separately loads scripts
|
|
427 | + this.activityStreamDebug && !this.privilegedAboutProcessEnabled
|
|
428 | + ? "-debug"
|
|
429 | + : "",
|
|
430 | + this.privilegedAboutProcessEnabled ? "-noscripts" : "",
|
|
431 | + ".html",
|
|
432 | + ].join("");
|
|
420 | 433 | }
|
421 | 434 | |
422 | 435 | newChannel() {
|
... | ... | @@ -154,6 +154,11 @@ export const AboutNewTab = { |
154 | 154 | * onBrowserReady - Continues the initialization of Activity Stream after browser is ready.
|
155 | 155 | */
|
156 | 156 | async onBrowserReady() {
|
157 | + if (AppConstants.BASE_BROWSER_VERSION) {
|
|
158 | + // Do not initialise ActivityStream, which we do not want and is not
|
|
159 | + // available. tor-browser#43886.
|
|
160 | + return;
|
|
161 | + }
|
|
157 | 162 | if (this.activityStream && this.activityStream.initialized) {
|
158 | 163 | return;
|
159 | 164 | }
|