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
-
ddc85dbe
by Henry Wilkes at 2025-08-20T13:42:47+00:00
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:
1 | -/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2 | - * License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
3 | - * You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
4 | - |
|
5 | -#infoTitle {
|
|
6 | - font-weight: 600;
|
|
7 | -} |
1 | -/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2 | - * License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
3 | - * You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
4 | - |
|
5 | -document.addEventListener("dialogaccept", () => {
|
|
6 | - const retvals = window.arguments[0];
|
|
7 | - retvals.confirmed = true;
|
|
8 | - retvals.neverAskAgain = document.getElementById("neverAskAgain").checked;
|
|
9 | -});
|
|
10 | - |
|
11 | -document.addEventListener("DOMContentLoaded", () => {
|
|
12 | - const dialog = document.getElementById("newIdentityDialog");
|
|
13 | - |
|
14 | - const accept = dialog.getButton("accept");
|
|
15 | - document.l10n.setAttributes(accept, "new-identity-dialog-confirm");
|
|
16 | - accept.classList.add("danger-button");
|
|
17 | -}); |
1 | -<?xml version="1.0"?>
|
|
2 | - |
|
3 | -<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
|
4 | - - License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5 | - - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
|
6 | - |
|
7 | -<!-- based on resetProfile.xhtml -->
|
|
8 | - |
|
9 | -<?csp default-src chrome: ?>
|
|
10 | - |
|
11 | -<window
|
|
12 | - id="newIdentityDialogWindow"
|
|
13 | - xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
|
14 | - xmlns:html="http://www.w3.org/1999/xhtml"
|
|
15 | - xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
|
16 | - aria-labelledby="infoTitle"
|
|
17 | - aria-describedby="infoBody"
|
|
18 | ->
|
|
19 | - <dialog id="newIdentityDialog" buttons="accept,cancel" defaultButton="accept">
|
|
20 | - <linkset>
|
|
21 | - <html:link rel="stylesheet" href="chrome://global/skin/global.css" />
|
|
22 | - <html:link
|
|
23 | - rel="stylesheet"
|
|
24 | - href="chrome://global/content/commonDialog.css"
|
|
25 | - />
|
|
26 | - <html:link
|
|
27 | - rel="stylesheet"
|
|
28 | - href="chrome://global/skin/commonDialog.css"
|
|
29 | - />
|
|
30 | - <html:link
|
|
31 | - rel="stylesheet"
|
|
32 | - href="chrome://browser/content/newIdentityDialog.css"
|
|
33 | - />
|
|
34 | - |
|
35 | - <html:link rel="localization" href="branding/brand.ftl" />
|
|
36 | - <html:link rel="localization" href="toolkit/global/base-browser.ftl" />
|
|
37 | - </linkset>
|
|
38 | - |
|
39 | - <div xmlns="http://www.w3.org/1999/xhtml">
|
|
40 | - <div id="dialogGrid">
|
|
41 | - <div class="dialogRow" id="infoRow">
|
|
42 | - <div id="iconContainer">
|
|
43 | - <xul:image id="infoIcon" />
|
|
44 | - </div>
|
|
45 | - <div id="infoContainer">
|
|
46 | - <xul:description
|
|
47 | - id="infoTitle"
|
|
48 | - data-l10n-id="new-identity-dialog-title"
|
|
49 | - />
|
|
50 | - <xul:description
|
|
51 | - id="infoBody"
|
|
52 | - data-l10n-id="new-identity-dialog-description"
|
|
53 | - />
|
|
54 | - <xul:checkbox
|
|
55 | - id="neverAskAgain"
|
|
56 | - data-l10n-id="new-identity-dialog-never-ask-checkbox"
|
|
57 | - />
|
|
58 | - </div>
|
|
59 | - </div>
|
|
60 | - </div>
|
|
61 | - </div>
|
|
62 | - |
|
63 | - <script src="chrome://browser/content/newIdentityDialog.js" />
|
|
64 | - </dialog>
|
|
65 | -</window> |
... | ... | @@ -513,18 +513,37 @@ ChromeUtils.defineLazyGetter(this, "NewIdentityButton", () => { |
513 | 513 | const prefConfirm = "browser.new_identity.confirm_newnym";
|
514 | 514 | const shouldConfirm = Services.prefs.getBoolPref(prefConfirm, true);
|
515 | 515 | if (shouldConfirm) {
|
516 | - const params = {
|
|
517 | - confirmed: false,
|
|
518 | - neverAskAgain: false,
|
|
519 | - };
|
|
520 | - await window.gDialogBox.open(
|
|
521 | - "chrome://browser/content/newIdentityDialog.xhtml",
|
|
522 | - params
|
|
516 | + const [titleString, bodyString, checkboxString, restartString] =
|
|
517 | + await document.l10n.formatValues([
|
|
518 | + { id: "new-identity-dialog-title" },
|
|
519 | + { id: "new-identity-dialog-description" },
|
|
520 | + { id: "restart-warning-dialog-do-not-warn-checkbox" },
|
|
521 | + { id: "restart-warning-dialog-restart-button" },
|
|
522 | + ]);
|
|
523 | + const flags =
|
|
524 | + Services.prompt.BUTTON_POS_0 *
|
|
525 | + Services.prompt.BUTTON_TITLE_IS_STRING +
|
|
526 | + Services.prompt.BUTTON_POS_0_DEFAULT +
|
|
527 | + Services.prompt.BUTTON_DEFAULT_IS_DESTRUCTIVE +
|
|
528 | + Services.prompt.BUTTON_POS_1 * Services.prompt.BUTTON_TITLE_CANCEL;
|
|
529 | + const propBag = await Services.prompt.asyncConfirmEx(
|
|
530 | + window.browsingContext,
|
|
531 | + Services.prompt.MODAL_TYPE_INTERNAL_WINDOW,
|
|
532 | + titleString,
|
|
533 | + bodyString,
|
|
534 | + flags,
|
|
535 | + restartString,
|
|
536 | + null,
|
|
537 | + null,
|
|
538 | + checkboxString,
|
|
539 | + false
|
|
523 | 540 | );
|
524 | - Services.prefs.setBoolPref(prefConfirm, !params.neverAskAgain);
|
|
525 | - if (!params.confirmed) {
|
|
541 | + if (propBag.get("buttonNumClicked") !== 0) {
|
|
526 | 542 | return;
|
527 | 543 | }
|
544 | + if (propBag.get("checked")) {
|
|
545 | + Services.prefs.setBoolPref(prefConfirm, false);
|
|
546 | + }
|
|
528 | 547 | }
|
529 | 548 | |
530 | 549 | const impl = new NewIdentityImpl();
|
1 | 1 | browser.jar:
|
2 | 2 | content/browser/newidentity.js (content/newidentity.js) |
3 | - content/browser/newIdentityDialog.xhtml (content/newIdentityDialog.xhtml)
|
|
4 | - content/browser/newIdentityDialog.css (content/newIdentityDialog.css)
|
|
5 | - content/browser/newIdentityDialog.js (content/newIdentityDialog.js) |
... | ... | @@ -63,10 +63,6 @@ toolbar-new-identity = |
63 | 63 | |
64 | 64 | new-identity-dialog-title = Reset your identity?
|
65 | 65 | new-identity-dialog-description = { -brand-short-name } will close all windows and tabs. All website sessions will be lost.
|
66 | -new-identity-dialog-never-ask-checkbox =
|
|
67 | - .label = Never ask me again
|
|
68 | -new-identity-dialog-confirm =
|
|
69 | - .label = Restart { -brand-short-name }
|
|
70 | 66 | |
71 | 67 | ## New identity: blocked home page notification.
|
72 | 68 |