Pier Angelo Vendrame pushed to branch mullvad-browser-145.0a1-16.0-1 at The Tor Project / Applications / Mullvad Browser Commits: 71a835d4 by Pier Angelo Vendrame at 2025-11-24T16:42:17+01:00 fixup! BB 43140: Tighten up fonts on Linux. BB 44315: Fix the fonts on the updater. - - - - - 2e8e285c by Pier Angelo Vendrame at 2025-11-24T16:44:40+01:00 fixup! BB 43525: Skip Remote Settings for search engine customization. MB 483: Ship DDG without AI as a bundled search engine. MB 487: Use custom order for search engines. - - - - - 77434824 by Pier Angelo Vendrame at 2025-11-24T16:47:37+01:00 fixup! MB 213: Customize the search engines list. MB 487: Use custom order for search engines. - - - - - 4e498e75 by Beatriz Rizental at 2025-11-24T16:47:37+01:00 fixup! Tweaks to the build system Skip downloading WPT artifacts when generating test artifacts. - - - - - e9ded521 by Henry Wilkes at 2025-11-24T16:47:38+01:00 fixup! MB 39: Add home page about:mullvad-browser MB 486: Delay the update data for preloaded about:mullvad-browser pages. - - - - - d4f44eea by Henry Wilkes at 2025-11-24T16:47:59+01:00 fixup! MB 213: Customize the search engines list. MB 488: Drop Mullvad Leta search engine. - - - - - ba68b6de by Henry Wilkes at 2025-11-24T16:50:04+01:00 MB 488: Adjust search engine removal notification for Mullvad Leta. - - - - - 157bb4f4 by Pier Angelo Vendrame at 2025-11-24T17:36:30+01:00 fixup! BB 43615: Add Gitlab Issue and Merge Request templates Update GitLab templates. Avoid mentioning existing issues/MRs, and update the channels. - - - - - 14 changed files: - .gitlab/issue_templates/040 Feature.md - .gitlab/issue_templates/050 Backport.md - .gitlab/merge_request_templates/Default.md - browser/components/mullvad-browser/AboutMullvadBrowserChild.sys.mjs - browser/components/mullvad-browser/AboutMullvadBrowserParent.sys.mjs - browser/components/search/SearchUIUtils.sys.mjs - browser/components/tabbrowser/NewTabPagePreloading.sys.mjs - testing/testsuite-targets.mk - toolkit/components/search/SearchService.sys.mjs - toolkit/components/search/content/base-browser-search-engine-icons.json - toolkit/components/search/content/base-browser-search-engines.json - − toolkit/components/search/content/mullvad-leta.svg - toolkit/components/search/tests/xpcshell/test_base_browser.js - toolkit/mozapps/update/updater/updater.cpp Changes: ===================================== .gitlab/issue_templates/040 Feature.md ===================================== @@ -18,11 +18,11 @@ Provide an overview of the technical/implementation aspects of this feature ### Proposal <!-- Add links to associated proposal issues (or delete block) --> -- mullvad-browser#123 +- mullvad-browser#xyz ### Design <!-- Add links to associated design issues (or delete block) --> -- tpo/UX/Design#123 +- tpo/UX/Design#xyz <!-- Do not edit beneath this line <3 --> ===================================== .gitlab/issue_templates/050 Backport.md ===================================== @@ -13,12 +13,12 @@ please ensure the title has the following format: ## Bookkeeping ### Issue(s) -- tor-browser#12345 -- mullvad-browser#123 -- https://bugzilla.mozilla.org/show_bug.cgi?id=1234567 +- tor-browser#xxxxx +- mullvad-browser#xyz +- https://bugzilla.mozilla.org/show_bug.cgi?id=xxxxxxx ### Merge Request(s) -- tor-browser!123 +- tor-browser!xxxx ### Target Channels ===================================== .gitlab/merge_request_templates/Default.md ===================================== @@ -27,8 +27,8 @@ #### Target Channels -- [ ] **Alpha**: esr140-15.0 -- [ ] **Stable**: esr128-14.5 +- [ ] **Alpha**: rapid release, 16.0 +- [ ] **Stable**: esr140-15.0 ### Backporting ===================================== browser/components/mullvad-browser/AboutMullvadBrowserChild.sys.mjs ===================================== @@ -5,13 +5,34 @@ export class AboutMullvadBrowserChild extends JSWindowActorChild { handleEvent(event) { switch (event.type) { case "DOMContentLoaded": - this.sendQuery("AboutMullvadBrowser:GetUpdateData").then(data => { - const updateEvent = new this.contentWindow.CustomEvent("UpdateData", { - detail: Cu.cloneInto(data, this.contentWindow), - }); - this.contentWindow.dispatchEvent(updateEvent); + this.sendQuery("AboutMullvadBrowser:GetUpdateData").then(response => { + if (response.delayed) { + // Wait for DelayedUpdateData. + return; + } + this.#dispatchUpdateData(response.updateData); }); break; } } + + receiveMessage(message) { + switch (message.name) { + case "AboutMullvadBrowser:DelayedUpdateData": + this.#dispatchUpdateData(message.data); + break; + } + } + + /** + * Send the update data to the page. + * + * @param {object} data - The data to send. + */ + #dispatchUpdateData(data) { + const updateEvent = new this.contentWindow.CustomEvent("UpdateData", { + detail: Cu.cloneInto(data, this.contentWindow), + }); + this.contentWindow.dispatchEvent(updateEvent); + } } ===================================== browser/components/mullvad-browser/AboutMullvadBrowserParent.sys.mjs ===================================== @@ -2,30 +2,73 @@ * Actor parent class for the about:mullvad-browser page. */ export class AboutMullvadBrowserParent extends JSWindowActorParent { - receiveMessage(message) { + /** + * Whether this instance has a preloaded browser. + * + * @type {boolean} + */ + #preloaded = false; + + /** + * Method to be called when the browser corresponding to this actor has its + * preloadedState attribute removed. + */ + preloadedRemoved() { + if (!this.#preloaded) { + return; + } + this.#preloaded = false; + // Send in the initial data now that the page is actually going to be + // visible. + this.sendAsyncMessage( + "AboutMullvadBrowser:DelayedUpdateData", + this.#getUpdateData() + ); + } + + /** + * Get the update data for the page. + * + * @returns {object?} - The update data, or `null` if no update should be + * shown. + */ + #getUpdateData() { const shouldNotifyPref = "mullvadbrowser.post_update.shouldNotify"; + if (!Services.prefs.getBoolPref(shouldNotifyPref, false)) { + return null; + } + Services.prefs.clearUserPref(shouldNotifyPref); + // Try use the same URL as the about dialog. See mullvad-browser#411. + let updateURL = Services.urlFormatter.formatURLPref( + "app.releaseNotesURL.aboutDialog" + ); + if (updateURL === "about:blank") { + updateURL = Services.urlFormatter.formatURLPref( + "startup.homepage_override_url" + ); + } + + return { + version: Services.prefs.getCharPref( + "browser.startup.homepage_override.mullvadbrowser.version" + ), + url: updateURL, + }; + } + + receiveMessage(message) { switch (message.name) { case "AboutMullvadBrowser:GetUpdateData": { - if (!Services.prefs.getBoolPref(shouldNotifyPref, false)) { - return Promise.resolve(null); - } - Services.prefs.clearUserPref(shouldNotifyPref); - // Try use the same URL as the about dialog. See mullvad-browser#411. - let updateURL = Services.urlFormatter.formatURLPref( - "app.releaseNotesURL.aboutDialog" - ); - if (updateURL === "about:blank") { - updateURL = Services.urlFormatter.formatURLPref( - "startup.homepage_override_url" - ); + const browser = this.browsingContext.top.embedderElement; + if (browser?.getAttribute("preloadedState") === "preloaded") { + // Wait until the page is actually about to be shown before sending + // the initial data. + // Otherwise the preloaded page might grab the updateData even though + // it won't be shown as the landing page. See mullvad-browser#486. + this.#preloaded = true; + return Promise.resolve({ delayed: true }); } - - return Promise.resolve({ - version: Services.prefs.getCharPref( - "browser.startup.homepage_override.mullvadbrowser.version" - ), - url: updateURL, - }); + return Promise.resolve({ updateData: this.#getUpdateData() }); } } return undefined; ===================================== browser/components/search/SearchUIUtils.sys.mjs ===================================== @@ -86,8 +86,12 @@ export var SearchUIUtils = { * name of the engine to be moved and replaced. * @param {string} newEngine * name of the application default engine to replaced the removed engine. + * @param {object} [details] + * Additional details about the removed search engine. + * @param {boolean} [details.removedMullvadLeta] + * Whether we removed Mullvad Leta. */ - async removalOfSearchEngineNotificationBox(oldEngine, newEngine) { + async removalOfSearchEngineNotificationBox(oldEngine, newEngine, details) { let win = lazy.BrowserWindowTracker.getTopWindow({ allowFromInactiveWorkspace: true, }); @@ -103,9 +107,14 @@ export var SearchUIUtils = { win.gNotificationBox.removeNotification(notificationBox); }, }, - { - supportPage: "search-engine-removal", - }, + details?.removedMullvadLeta + ? { + link: "https://leta.mullvad.net/mullvad-browser", + "l10n-id": "moz-support-link-text", + } + : { + supportPage: "search-engine-removal", + }, ]; await win.gNotificationBox.appendNotification( ===================================== browser/components/tabbrowser/NewTabPagePreloading.sys.mjs ===================================== @@ -178,6 +178,17 @@ export let NewTabPagePreloading = { this.browserCounts[countKey]--; browser.removeAttribute("preloadedState"); browser.setAttribute("autocompletepopup", "PopupAutoComplete"); + // Copied from tor-browser. See mullvad-browser#486. + // Let a preloaded about:mullvad-browser page know that it is no longer + // preloaded (about to be shown). + try { + browser.browsingContext?.currentWindowGlobal + ?.getActor("AboutMullvadBrowser") + .preloadedRemoved(); + } catch { + // Not an about:mullvad-browser page with an AboutMullvadBrowserParent + // instance. + } } return browser; ===================================== testing/testsuite-targets.mk ===================================== @@ -151,7 +151,7 @@ download-wpt-manifest: $(call py_action,download_wpt_manifest) define package_archive -package-tests-$(1): stage-all package-tests-prepare-dest download-wpt-manifest +package-tests-$(1): stage-all package-tests-prepare-dest $$(call py_action,test_archive, \ $(1) \ '$$(abspath $$(test_archive_dir))/$$(PKG_BASENAME).$(1).tests.$(2)') ===================================== toolkit/components/search/SearchService.sys.mjs ===================================== @@ -1849,7 +1849,11 @@ export class SearchService { this._showRemovalOfSearchEngineNotificationBox( prevCurrentEngineName || prevAppDefaultEngineName, - newCurrentEngineName + newCurrentEngineName, + { + removedMullvadLeta: + (prevCurrentEngineId || prevAppDefaultEngineId) === "mullvad-leta", + } ); } } @@ -1927,7 +1931,13 @@ export class SearchService { // the user changes their locale it causes a change in engines. // If there is no update to settings metadata then the engine change was // caused by an update to config rather than a user changing their locale. - if (!this.#didSettingsMetaDataUpdate(prevMetaData)) { + // + // For the removal of Mullvad Leta, we show the notification even if the + // locale also changed because this change is not locale-dependant. + if ( + (prevCurrentEngineId || prevAppDefaultEngineId) === "mullvad-leta" || + !this.#didSettingsMetaDataUpdate(prevMetaData) + ) { return true; } } @@ -3821,16 +3831,22 @@ export class SearchService { * The name of the previous default engine that will be replaced. * @param {string} newCurrentEngineName * The name of the engine that will be the new default engine. + * @param {object} [details] + * Additional details about the removed search engine. + * @param {boolean} [details.removedMullvadLeta] + * Whether we removed Mullvad Leta. */ _showRemovalOfSearchEngineNotificationBox( prevCurrentEngineName, - newCurrentEngineName + newCurrentEngineName, + details ) { lazy.BrowserUtils.callModulesFromCategory( { categoryName: "search-service-notification" }, "search-engine-removal", prevCurrentEngineName, - newCurrentEngineName + newCurrentEngineName, + details ); } ===================================== toolkit/components/search/content/base-browser-search-engine-icons.json ===================================== @@ -5,11 +5,8 @@ "ddg-html": [ { "url": "chrome://global/content/search/duckduckgo.ico", "imageSize": 32 } ], - "mullvad-leta": [ - { - "url": "chrome://global/content/search/mullvad-leta.svg", - "imageSize": 16 - } + "ddg-noai": [ + { "url": "chrome://global/content/search/duckduckgo.ico", "imageSize": 32 } ], "mojeek": [ { "url": "chrome://global/content/search/mojeek.ico", "imageSize": 32 } ===================================== toolkit/components/search/content/base-browser-search-engines.json ===================================== @@ -1,55 +1,55 @@ [ { "base": { - "aliases": ["mullvad-leta", "leta", "mullvad", "ml"], + "aliases": ["duckduckgo", "ddg"], "classification": "general", - "name": "Mullvad Leta", + "name": "DuckDuckGo", "urls": { "search": { - "base": "https://leta.mullvad.net/", + "base": "https://duckduckgo.com/", "params": [], "searchTermParamName": "q" } } }, - "id": "ee88d691-6d7a-4adb-9fec-5a205565505a", - "identifier": "mullvad-leta", + "id": "04e99a38-13ee-47d8-8aa4-64482b3dea99", + "identifier": "ddg", "recordType": "engine", "variants": [{ "environment": { "allRegionsAndLocales": true } }] }, { "base": { - "aliases": ["duckduckgo", "ddg"], + "aliases": ["ddg-html", "duckduckgohtml", "ddgh"], "classification": "general", - "name": "DuckDuckGo", + "name": "DuckDuckGo (HTML)", "urls": { "search": { - "base": "https://duckduckgo.com/", + "base": "https://html.duckduckgo.com/html/", "params": [], "searchTermParamName": "q" } } }, - "id": "04e99a38-13ee-47d8-8aa4-64482b3dea99", - "identifier": "ddg", + "id": "98d8c84b-7455-431d-98b9-890e7bcc0041", + "identifier": "ddg-html", "recordType": "engine", "variants": [{ "environment": { "allRegionsAndLocales": true } }] }, { "base": { - "aliases": ["ddg-html", "duckduckgohtml", "ddgh"], + "aliases": ["ddgnoai"], "classification": "general", - "name": "DuckDuckGo (HTML)", + "name": "DuckDuckGo (no AI)", "urls": { "search": { - "base": "https://html.duckduckgo.com/html/", + "base": "https://noai.duckduckgo.com/", "params": [], "searchTermParamName": "q" } } }, - "id": "98d8c84b-7455-431d-98b9-890e7bcc0041", - "identifier": "ddg-html", + "id": "91687f02-56dd-4fef-ba26-bf139dff3166", + "identifier": "ddg-noai", "recordType": "engine", "variants": [{ "environment": { "allRegionsAndLocales": true } }] }, @@ -109,7 +109,16 @@ }, { "recordType": "defaultEngines", - "globalDefault": "mullvad-leta", - "globalDefaultPrivate": "mullvad-leta" + "globalDefault": "ddg", + "globalDefaultPrivate": "dgg" + }, + { + "recordType": "engineOrders", + "orders": [ + { + "environment": { "allRegionsAndLocales": true }, + "order": ["ddg", "ddg-html", "ddg-noai", "mojeek", "brave", "startpage"] + } + ] } ] ===================================== toolkit/components/search/content/mullvad-leta.svg deleted ===================================== @@ -1,25 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg" id="Mullvad_VPN_Logo_Positive" x="0" y="0" version="1.1" - viewBox="0 0 252.70001 252.6" xml:space="preserve"> - <g id="Logo" transform="translate(-566.2 -73.7)"> - <path id="bg" fill="#192e45" fill-rule="evenodd" - d="M566.2 200c0 69.8 56.6 126.3 126.3 126.3 69.7 0 126.4-56.5 126.4-126.3S762.3 73.7 692.5 73.7c-69.8 0-126.3 56.5-126.3 126.3z" - clip-rule="evenodd" /> - <path id="Mullvad_Fur" fill="#d0933a" fill-rule="evenodd" - d="M583.1 184.9l9.6-13.4c0 .1-.6 19.3-.6 19.3l2.7-14.5c8 16.2 27.6 38.6 45.5 50.6 1.9 1.3 3.5 2.7 4.6 4.1 2.3.9 4.6 1.4 6.9 1.8 1.2.2 2.5.3 3.7.4 1.2.1 2.5.1 3.7.1 1.2 0 2.4-.1 3.6-.2 1.2-.1 2.4-.3 3.6-.5 1.2-.2 2.4-.4 3.5-.8 1.2-.3 2.3-.6 3.5-1 1.1-.3 2.3-.8 3.4-1.2 1.1-.5 2.2-.9 3.3-1.5 1.1-.6 2.2-1.1 3.2-1.7 1.1-.5 2.1-1.2 3.2-1.8 1.1-.6 2.1-1.3 3.2-1.9 1.1-.6 2.1-1.3 3.1-1.9 1-.7 2.1-1.3 3.1-2s2.1-1.3 3.2-2l1-.6.5.3 7.2 4.8-7.3-1.9c-.7.8-1.4 1.6-2.2 2.4-.9.9-1.9 1.8-2.8 2.7-1 .8-2 1.7-3.1 2.4-1.1.8-2.1 1.5-3.3 2.2-2.2 1.4-4.6 2.6-7.1 3.6-1.2.5-2.5 1-3.7 1.4-1.3.4-2.5.8-3.8 1.1-1.3.3-2.6.6-3.9.8-1.3.2-2.6.3-3.9.5-2.6.1-5.3.1-7.9-.3-1.3-.2-2.6-.4-3.9-.7-1.3-.3-2.5-.7-3.7-1.1-2.1-.8-4.2-1.8-6.1-3 0 0-6.9 1-4.1 6.2 2.8 5.2 7 4.7 5 10.8-1.4 3.3-3.4 6.5-5.6 9.5-4.6 6.2-11.8 11.7-11.1 15 32.7 40.3 106.4 34.7 134.4-1.3-.4-5.2-8.6-7.7-14.3-20.4 1.6.5 4 1.2 4 1.1 0-.1-6.8-11.1-7.1-12.2l4.4.3s-5.8-7.2-6-7.9l5.9-.8s-7.4-8.5-7.5-9.2l7.5 1.2-8.2-9.9h3.9l-4.6-6.7c-.8-.3-1.6-.5-2.4-.7l-3-.9c-11.2-3.5-21.8-6.7-32-13.1-14.3-8.9-27.1-19.8-36.7-28.3l-19.3-9.4c-18.5-1.4-35.9-.9-46.5 1.2l6.8-11.6-10.4 12.5c-.7-.2-.9-.6-.9-.6l.7-15.4-3.3 13.9c-1-.5-2.2-.7-3.4-.7-4.6 0-8.3 3.7-8.3 8.3 0 4.2 3.1 7.7 7.2 8.2l-7.1 14.4z" - clip-rule="evenodd" /> - <path id="Mullvad_Nose" fill="#ffcc86" fill-rule="evenodd" - d="M594.8 154.5c-1-.4-2.2-.7-3.3-.7-4.6 0-8.3 3.7-8.3 8.3 0 4 2.9 7.4 6.7 8.2h.2c2.5-.8 7.5-7.5 6.7-11.7-.4-1.5-1-2.9-2-4.1z" - clip-rule="evenodd" /> - <path id="Mullvad_Helmet" fill="#fdd321" fill-rule="evenodd" - d="M667.6 143.8c-1.5-4.1-1.1-9.4 1-14.4 3-6.9 8.7-11.5 14.1-11.5 1.1 0 2.1.2 3.1.6 3.1-2.8 6.7-5.1 10.7-6.7 22.1-8.8 54.4 6.9 62.7 28.6 4 10.5 2.8 22-.6 32.5-2.8 8.6-13 21-9.2 30.4-1.5-.4-33.1-10.2-41.9-15.8-14.1-8.8-26.8-19.6-36.3-28l-.3-.3-32.1-15.2c-.4-.2-.8-.4-1.1-.6 4.6 0 22.1 2.1 29.9.4" - clip-rule="evenodd" /> - <g id="Helmet_Lamp"> - <path id="path113" fill="#fff" - d="M677.1 147.4c-.9 0-1.6-.2-2.3-.5-1.6-.7-2.8-2-3.6-4-1.4-3.4-1-8.1.9-12.5 2.5-5.6 7.3-9.7 11.5-9.7.8 0 1.6.2 2.4.5 2.1.9 3.6 3 4.1 6 .6 3.2.1 6.9-1.5 10.4-2.4 5.7-7.3 9.8-11.5 9.8z" /> - <g id="g117"> - <path id="path115" fill="#1d2a3a" - d="M683.6 122.3c.6 0 1.2.1 1.8.4 1.6.7 2.8 2.5 3.2 4.9.5 2.9.1 6.3-1.4 9.5-2.2 5.1-6.5 8.8-10.1 8.8-.6 0-1.2-.1-1.7-.3-1.5-.6-2.3-2-2.7-3.1-1.2-3-.9-7.4.8-11.4 2.2-5.1 6.5-8.8 10.1-8.8m0-3c-4.8 0-10.1 4.4-12.9 10.7-2.1 4.7-2.4 9.8-.9 13.7.9 2.3 2.4 3.9 4.3 4.8.9.4 1.9.6 3 .6 4.8 0 10.1-4.4 12.8-10.7 1.7-3.8 2.2-7.8 1.6-11.3-.6-3.5-2.4-6-5-7.1-.9-.5-1.9-.7-2.9-.7z" /> - </g> - </g> - </g> -</svg> ===================================== toolkit/components/search/tests/xpcshell/test_base_browser.js ===================================== @@ -4,19 +4,21 @@ /** * This tests the SearchService to check our override of the remote settings is * working as expected. + * + * When adding new engines, it should be enough to change expectedURLs below. */ "use strict"; const expectedURLs = { - leta: "https://leta.mullvad.net/?q=test", - ddg: "https://duckduckgo.com/html/?q=test", - "ddg-html": "https://html.duckduckgo.com/html?q=test", + ddg: "https://duckduckgo.com/?q=test", + "ddg-html": "https://html.duckduckgo.com/html/?q=test", + "ddg-noai": "https://noai.duckduckgo.com/?q=test", mojeek: "https://www.mojeek.com/search?q=test", brave: "https://search.brave.com/search?q=test", startpage: "https://www.startpage.com/sp/search?q=test", }; -const defaultEngine = "leta"; +const defaultEngine = "ddg"; add_setup(async function setup() { await Services.search.init(); @@ -49,3 +51,11 @@ add_task(function test_checkSearchURLs() { Assert.equal(foundUrl, url, `The URL of ${engine.name} is not altered.`); } }); + +add_task(async function test_iconsDoesNotFail() { + for (const id of Object.keys(expectedURLs)) { + const engine = Services.search.getEngineById(id); + // No need to assert anything, as in case of error this method should throw. + await engine.getIconURL(); + } +}); ===================================== toolkit/mozapps/update/updater/updater.cpp ===================================== @@ -3326,6 +3326,10 @@ int NS_main(int argc, NS_tchar** argv) { putenv(const_cast<char*>("MOZ_USING_SERVICE=")); #endif +#if defined(XP_UNIX) && !defined(XP_MACOSX) + unsetenv("FONTCONFIG_PATH"); +#endif + if (argc == 2 && NS_tstrcmp(argv[1], NS_T("--channels-allowed")) == 0) { #ifdef MOZ_VERIFY_MAR_SIGNATURE int rv = PopulategMARStrings(); View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/compare/168... -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/compare/168... You're receiving this email because of your account on gitlab.torproject.org.