henry pushed to branch mullvad-browser-140.0esr-15.0-1 at The Tor Project / Applications / Mullvad Browser
Commits:
-
824cc87c
by Henry Wilkes at 2025-07-16T12:51:48+01:00
-
6b7cf586
by Henry Wilkes at 2025-07-16T12:52:30+01:00
-
59f89a8f
by Henry Wilkes at 2025-07-16T12:52:43+01:00
-
fa5c1f1f
by Henry Wilkes at 2025-07-16T12:53:02+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 "about:mullvad-browser"
|
|
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
|
... | ... | @@ -79,10 +85,7 @@ static const RedirEntry kRedirMap[] = { |
79 | 85 | #endif
|
80 | 86 | {"policies", "chrome://browser/content/policies/aboutPolicies.html",
|
81 | 87 | nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::IS_SECURE_CHROME_UI},
|
82 | - {"privatebrowsing", "about:blank",
|
|
83 | - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
|
|
84 | - nsIAboutModule::URI_MUST_LOAD_IN_CHILD | nsIAboutModule::ALLOW_SCRIPT |
|
|
85 | - nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS},
|
|
88 | + {"privatebrowsing", "about:blank", BASE_BROWSER_HOME_PAGE_FLAGS},
|
|
86 | 89 | {"profiling",
|
87 | 90 | "chrome://devtools/content/performance-new/aboutprofiling/index.html",
|
88 | 91 | nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::IS_SECURE_CHROME_UI},
|
... | ... | @@ -103,11 +106,10 @@ static const RedirEntry kRedirMap[] = { |
103 | 106 | {"welcomeback", "chrome://browser/content/aboutWelcomeBack.xhtml",
|
104 | 107 | nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::HIDE_FROM_ABOUTABOUT |
|
105 | 108 | nsIAboutModule::IS_SECURE_CHROME_UI},
|
106 | - {"welcome", "about:blank",
|
|
107 | - nsIAboutModule::URI_MUST_LOAD_IN_CHILD |
|
|
108 | - nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS |
|
|
109 | - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
|
|
110 | - nsIAboutModule::ALLOW_SCRIPT},
|
|
109 | + {"welcome", "about:blank", BASE_BROWSER_HOME_PAGE_FLAGS},
|
|
110 | + {"home", "about:blank", BASE_BROWSER_HOME_PAGE_FLAGS},
|
|
111 | + {"newtab", "chrome://browser/content/blanktab.html",
|
|
112 | + BASE_BROWSER_HOME_PAGE_FLAGS},
|
|
111 | 113 | {"messagepreview",
|
112 | 114 | "chrome://browser/content/messagepreview/messagepreview.html",
|
113 | 115 | nsIAboutModule::URI_MUST_LOAD_IN_CHILD |
|
... | ... | @@ -171,9 +173,7 @@ static const RedirEntry kRedirMap[] = { |
171 | 173 | #endif
|
172 | 174 | {"mullvad-browser",
|
173 | 175 | "chrome://browser/content/mullvad-browser/aboutMullvadBrowser.html",
|
174 | - nsIAboutModule::URI_MUST_LOAD_IN_CHILD |
|
|
175 | - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
|
|
176 | - nsIAboutModule::IS_SECURE_CHROME_UI},
|
|
176 | + BASE_BROWSER_HOME_PAGE_FLAGS},
|
|
177 | 177 | };
|
178 | 178 | |
179 | 179 | static nsAutoCString GetAboutModuleName(nsIURI* aURI) {
|
... | ... | @@ -220,13 +220,11 @@ AboutRedirector::NewChannel(nsIURI* aURI, nsILoadInfo* aLoadInfo, |
220 | 220 | if (!strcmp(path.get(), redir.id)) {
|
221 | 221 | nsAutoCString url;
|
222 | 222 | |
223 | - if (path.EqualsLiteral("welcome")) {
|
|
224 | - NimbusFeatures::RecordExposureEvent("aboutwelcome"_ns, true);
|
|
225 | - if (NimbusFeatures::GetBool("aboutwelcome"_ns, "enabled"_ns, true)) {
|
|
226 | - url.AssignASCII(ABOUT_WELCOME_CHROME_URL);
|
|
227 | - } else {
|
|
228 | - url.AssignASCII(ABOUT_HOME_URL);
|
|
229 | - }
|
|
223 | + if (path.EqualsLiteral("welcome") || path.EqualsLiteral("home") ||
|
|
224 | + path.EqualsLiteral("privatebrowsing") ||
|
|
225 | + (path.EqualsLiteral("newtab") &&
|
|
226 | + StaticPrefs::browser_newtabpage_enabled())) {
|
|
227 | + url.AssignASCII(BASE_BROWSER_HOME_PAGE_URL);
|
|
230 | 228 | }
|
231 | 229 | |
232 | 230 | // fall back to the specified url in the map
|
... | ... | @@ -10,6 +10,8 @@ pages = [ |
10 | 10 | 'certerror',
|
11 | 11 | 'downloads',
|
12 | 12 | 'framecrashed',
|
13 | + 'home',
|
|
14 | + 'newtab',
|
|
13 | 15 | 'messagepreview',
|
14 | 16 | 'mullvad-browser',
|
15 | 17 | 'policies',
|
... | ... | @@ -43,7 +43,7 @@ DIRS += [ |
43 | 43 | "migration",
|
44 | 44 | "mullvad-browser",
|
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:mullvad-browser";
|
|
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 | }
|