henry pushed to branch mullvad-browser-140.1.0esr-15.0-1 at The Tor Project / Applications / Mullvad Browser
Commits:
-
f5000c1f
by Henry Wilkes at 2025-08-05T16:34:57+01:00
-
9ba2a7bf
by Henry Wilkes at 2025-08-05T16:35:17+01:00
-
bf086fe6
by Henry Wilkes at 2025-08-05T16:35:18+01:00
-
9fe4d6f4
by Henry Wilkes at 2025-08-05T16:35:19+01:00
4 changed files:
- browser/app/profile/000-mullvad-browser.js
- browser/components/urlbar/QuickActionsLoaderDefault.sys.mjs
- browser/components/urlbar/SearchModeSwitcher.sys.mjs
- toolkit/content/widgets/moz-support-link/moz-support-link.mjs
Changes:
... | ... | @@ -2,6 +2,9 @@ |
2 | 2 | |
3 | 3 | pref("browser.startup.homepage", "about:mullvad-browser");
|
4 | 4 | |
5 | +// General browser support url. tor-browser#43864 and mullvad-browser#244.
|
|
6 | +pref("browser.base-browser-support-url", "https://mullvad.net/en/help/");
|
|
7 | + |
|
5 | 8 | // Do not show the bookmark panel for now, because it makes the initial browser
|
6 | 9 | // window (about:home) bigger, and regular pages will show letterbox margins as
|
7 | 10 | // a result.
|
... | ... | @@ -13,6 +13,7 @@ ChromeUtils.defineESModuleGetters(lazy, { |
13 | 13 | ScreenshotsUtils: "resource:///modules/ScreenshotsUtils.sys.mjs",
|
14 | 14 | ActionsProviderQuickActions:
|
15 | 15 | "resource:///modules/ActionsProviderQuickActions.sys.mjs",
|
16 | + PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs",
|
|
16 | 17 | });
|
17 | 18 | |
18 | 19 | import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
|
... | ... | @@ -78,6 +79,9 @@ const DEFAULT_ACTIONS = { |
78 | 79 | icon: "chrome://mozapps/skin/extensions/category-extensions.svg",
|
79 | 80 | label: "quickactions-addons",
|
80 | 81 | onPick: openAddonsUrl("addons://discover/"),
|
82 | + // Hide in base-browser, since we don't want to open extensions
|
|
83 | + // "recommendations" tab. tor-browser#43864.
|
|
84 | + disabled: () => true,
|
|
81 | 85 | },
|
82 | 86 | bookmarks: {
|
83 | 87 | l10nCommands: ["quickactions-cmd-bookmarks", "quickactions-bookmarks2"],
|
... | ... | @@ -100,6 +104,12 @@ const DEFAULT_ACTIONS = { |
100 | 104 | .document.getElementById("Tools:Sanitize")
|
101 | 105 | .doCommand();
|
102 | 106 | },
|
107 | + // Disable in permanent private browsing. tor-browser#43864.
|
|
108 | + // NOTE: This should also be disabled in private windows, but we don't have
|
|
109 | + // access to a Window element to check. See mozilla bug 1980912.
|
|
110 | + disabled: () => {
|
|
111 | + return lazy.PrivateBrowsingUtils.permanentPrivateBrowsing;
|
|
112 | + },
|
|
103 | 113 | },
|
104 | 114 | downloads: {
|
105 | 115 | l10nCommands: ["quickactions-cmd-downloads"],
|
... | ... | @@ -112,13 +122,18 @@ const DEFAULT_ACTIONS = { |
112 | 122 | icon: "chrome://mozapps/skin/extensions/category-extensions.svg",
|
113 | 123 | label: "quickactions-extensions",
|
114 | 124 | onPick: openAddonsUrl("addons://list/extension"),
|
125 | + // Hide in base-browser since we do not want to encourage users to change
|
|
126 | + // their extensions/addons. tor-browser#43864.
|
|
127 | + disabled: () => true,
|
|
115 | 128 | },
|
116 | 129 | help: {
|
117 | 130 | l10nCommands: ["quickactions-cmd-help"],
|
118 | 131 | icon: "chrome://global/skin/icons/help.svg",
|
119 | 132 | label: "quickactions-help",
|
133 | + // Open the base-browser support/help page, rather than Firefox's.
|
|
134 | + // tor-browser#43864.
|
|
120 | 135 | onPick: openUrlFun(
|
121 | - "https://support.mozilla.org/products/firefox?as=u&utm_source=inproduct"
|
|
136 | + Services.prefs.getStringPref("browser.base-browser-support-url", "")
|
|
122 | 137 | ),
|
123 | 138 | },
|
124 | 139 | firefoxview: {
|
... | ... | @@ -128,6 +143,9 @@ const DEFAULT_ACTIONS = { |
128 | 143 | onPick: () => {
|
129 | 144 | lazy.BrowserWindowTracker.getTopWindow().FirefoxViewHandler.openTab();
|
130 | 145 | },
|
146 | + // Hide in base-browser since firefoxview is disabled.
|
|
147 | + // tor-browser#43864 and tor-browser#42037.
|
|
148 | + disabled: () => true,
|
|
131 | 149 | },
|
132 | 150 | inspect: {
|
133 | 151 | l10nCommands: ["quickactions-cmd-inspector2"],
|
... | ... | @@ -311,6 +329,9 @@ export class QuickActionsLoaderDefault { |
311 | 329 | let keys = Object.keys(DEFAULT_ACTIONS);
|
312 | 330 | for (const key of keys) {
|
313 | 331 | let actionData = DEFAULT_ACTIONS[key];
|
332 | + if (actionData.disabled?.()) {
|
|
333 | + continue;
|
|
334 | + }
|
|
314 | 335 | let messages = await lazy.gFluentStrings.formatMessages(
|
315 | 336 | actionData.l10nCommands.map(id => ({ id }))
|
316 | 337 | );
|
... | ... | @@ -413,6 +413,15 @@ export class SearchModeSwitcher { |
413 | 413 | if (!lazy.UrlbarPrefs.get(pref)) {
|
414 | 414 | continue;
|
415 | 415 | }
|
416 | + if (
|
|
417 | + source === lazy.UrlbarUtils.RESULT_SOURCE.HISTORY &&
|
|
418 | + lazy.PrivateBrowsingUtils.permanentPrivateBrowsing
|
|
419 | + ) {
|
|
420 | + // Do not show the search history option in PBM. tor-browser#43864.
|
|
421 | + // Although, it can still be triggered with "^" restrict keyword or
|
|
422 | + // through an app menu item. See also mozilla bug 1980928.
|
|
423 | + continue;
|
|
424 | + }
|
|
416 | 425 | let name = lazy.UrlbarUtils.getResultSourceName(source);
|
417 | 426 | let { icon } = await this.#getDisplayedEngineDetails({
|
418 | 427 | source,
|
... | ... | @@ -125,11 +125,21 @@ export default class MozSupportLink extends HTMLAnchorElement { |
125 | 125 | return;
|
126 | 126 | }
|
127 | 127 | let supportPage = this.getAttribute("support-page") ?? "";
|
128 | - // Customize the link in about:preferences.
|
|
129 | - // See mullvad-browser#244 and tor-browser#41910.
|
|
130 | - if (supportPage === "preferences") {
|
|
131 | - this.href = "https://mullvad.net/en/help/";
|
|
132 | - return;
|
|
128 | + // For base-browser we sometimes want to override firefox support links with
|
|
129 | + // our own.
|
|
130 | + // See tor-browser#40899.
|
|
131 | + switch (supportPage) {
|
|
132 | + case "preferences":
|
|
133 | + // Shown twice in preferences, both as `{ -brand-short-name } Support`.
|
|
134 | + // Instead of directing to support for preferences, we link to general
|
|
135 | + // tor browser support.
|
|
136 | + // See tor-browser#32092.
|
|
137 | + this.href = Services.prefs.getStringPref(
|
|
138 | + "browser.base-browser-support-url",
|
|
139 | + ""
|
|
140 | + );
|
|
141 | + return;
|
|
142 | + // Fall through to support.mozilla.org
|
|
133 | 143 | }
|
134 | 144 | let base = MozSupportLink.SUPPORT_URL + supportPage;
|
135 | 145 | this.href = this.hasAttribute("utm-content")
|