
morgan pushed to branch mullvad-browser-140.2.0esr-15.0-1 at The Tor Project / Applications / Mullvad Browser Commits: 7535773c by Henry Wilkes at 2025-08-20T13:42:42+00:00 fixup! BB 40926: Implemented the New Identity feature TB 44034: Update new identity checkbox string. TB 44040: Use the prompt API for new identity. - - - - - ddc85dbe by Henry Wilkes at 2025-08-20T13:42:47+00:00 fixup! Base Browser strings TB 44034: Update new identity checkbox string. - - - - - 6 changed files: - − browser/components/newidentity/content/newIdentityDialog.css - − browser/components/newidentity/content/newIdentityDialog.js - − browser/components/newidentity/content/newIdentityDialog.xhtml - browser/components/newidentity/content/newidentity.js - browser/components/newidentity/jar.mn - toolkit/locales/en-US/toolkit/global/base-browser.ftl Changes: ===================================== browser/components/newidentity/content/newIdentityDialog.css deleted ===================================== @@ -1,7 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#infoTitle { - font-weight: 600; -} ===================================== browser/components/newidentity/content/newIdentityDialog.js deleted ===================================== @@ -1,17 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -document.addEventListener("dialogaccept", () => { - const retvals = window.arguments[0]; - retvals.confirmed = true; - retvals.neverAskAgain = document.getElementById("neverAskAgain").checked; -}); - -document.addEventListener("DOMContentLoaded", () => { - const dialog = document.getElementById("newIdentityDialog"); - - const accept = dialog.getButton("accept"); - document.l10n.setAttributes(accept, "new-identity-dialog-confirm"); - accept.classList.add("danger-button"); -}); ===================================== browser/components/newidentity/content/newIdentityDialog.xhtml deleted ===================================== @@ -1,65 +0,0 @@ -<?xml version="1.0"?> - -<!-- This Source Code Form is subject to the terms of the Mozilla Public - - License, v. 2.0. If a copy of the MPL was not distributed with this - - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> - -<!-- based on resetProfile.xhtml --> - -<?csp default-src chrome: ?> - -<window - id="newIdentityDialogWindow" - xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" - xmlns:html="http://www.w3.org/1999/xhtml" - xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" - aria-labelledby="infoTitle" - aria-describedby="infoBody" -> - <dialog id="newIdentityDialog" buttons="accept,cancel" defaultButton="accept"> - <linkset> - <html:link rel="stylesheet" href="chrome://global/skin/global.css" /> - <html:link - rel="stylesheet" - href="chrome://global/content/commonDialog.css" - /> - <html:link - rel="stylesheet" - href="chrome://global/skin/commonDialog.css" - /> - <html:link - rel="stylesheet" - href="chrome://browser/content/newIdentityDialog.css" - /> - - <html:link rel="localization" href="branding/brand.ftl" /> - <html:link rel="localization" href="toolkit/global/base-browser.ftl" /> - </linkset> - - <div xmlns="http://www.w3.org/1999/xhtml"> - <div id="dialogGrid"> - <div class="dialogRow" id="infoRow"> - <div id="iconContainer"> - <xul:image id="infoIcon" /> - </div> - <div id="infoContainer"> - <xul:description - id="infoTitle" - data-l10n-id="new-identity-dialog-title" - /> - <xul:description - id="infoBody" - data-l10n-id="new-identity-dialog-description" - /> - <xul:checkbox - id="neverAskAgain" - data-l10n-id="new-identity-dialog-never-ask-checkbox" - /> - </div> - </div> - </div> - </div> - - <script src="chrome://browser/content/newIdentityDialog.js" /> - </dialog> -</window> ===================================== browser/components/newidentity/content/newidentity.js ===================================== @@ -513,18 +513,37 @@ ChromeUtils.defineLazyGetter(this, "NewIdentityButton", () => { const prefConfirm = "browser.new_identity.confirm_newnym"; const shouldConfirm = Services.prefs.getBoolPref(prefConfirm, true); if (shouldConfirm) { - const params = { - confirmed: false, - neverAskAgain: false, - }; - await window.gDialogBox.open( - "chrome://browser/content/newIdentityDialog.xhtml", - params + const [titleString, bodyString, checkboxString, restartString] = + await document.l10n.formatValues([ + { id: "new-identity-dialog-title" }, + { id: "new-identity-dialog-description" }, + { id: "restart-warning-dialog-do-not-warn-checkbox" }, + { id: "restart-warning-dialog-restart-button" }, + ]); + const flags = + Services.prompt.BUTTON_POS_0 * + Services.prompt.BUTTON_TITLE_IS_STRING + + Services.prompt.BUTTON_POS_0_DEFAULT + + Services.prompt.BUTTON_DEFAULT_IS_DESTRUCTIVE + + Services.prompt.BUTTON_POS_1 * Services.prompt.BUTTON_TITLE_CANCEL; + const propBag = await Services.prompt.asyncConfirmEx( + window.browsingContext, + Services.prompt.MODAL_TYPE_INTERNAL_WINDOW, + titleString, + bodyString, + flags, + restartString, + null, + null, + checkboxString, + false ); - Services.prefs.setBoolPref(prefConfirm, !params.neverAskAgain); - if (!params.confirmed) { + if (propBag.get("buttonNumClicked") !== 0) { return; } + if (propBag.get("checked")) { + Services.prefs.setBoolPref(prefConfirm, false); + } } const impl = new NewIdentityImpl(); ===================================== browser/components/newidentity/jar.mn ===================================== @@ -1,5 +1,2 @@ browser.jar: content/browser/newidentity.js (content/newidentity.js) - content/browser/newIdentityDialog.xhtml (content/newIdentityDialog.xhtml) - content/browser/newIdentityDialog.css (content/newIdentityDialog.css) - content/browser/newIdentityDialog.js (content/newIdentityDialog.js) ===================================== toolkit/locales/en-US/toolkit/global/base-browser.ftl ===================================== @@ -63,10 +63,6 @@ toolbar-new-identity = new-identity-dialog-title = Reset your identity? new-identity-dialog-description = { -brand-short-name } will close all windows and tabs. All website sessions will be lost. -new-identity-dialog-never-ask-checkbox = - .label = Never ask me again -new-identity-dialog-confirm = - .label = Restart { -brand-short-name } ## New identity: blocked home page notification. View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/compare/8f2... -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/compare/8f2... You're receiving this email because of your account on gitlab.torproject.org.
participants (1)
-
morgan (@morgan)