henry pushed to branch base-browser-140.0esr-15.0-1 at The Tor Project / Applications / Tor Browser
Commits:
-
35f56812
by Henry Wilkes at 2025-07-17T14:06:34+01:00
7 changed files:
- browser/base/content/appmenu-viewcache.inc.xhtml
- browser/base/content/browser-init.js
- browser/base/content/browser-menubar.inc
- browser/base/content/browser-sets.inc
- browser/base/content/navigator-toolbox.inc.xhtml
- browser/components/customizableui/CustomizeMode.sys.mjs
- browser/components/newidentity/content/newidentity.js
Changes:
| ... | ... | @@ -58,7 +58,8 @@ |
| 58 | 58 | <toolbarbutton id="appMenu-new-identity"
|
| 59 | 59 | class="subviewbutton"
|
| 60 | 60 | data-l10n-id="appmenuitem-new-identity"
|
| 61 | - key="new-identity-key"/>
|
|
| 61 | + key="new-identity-key"
|
|
| 62 | + command="cmd_newIdentity"/>
|
|
| 62 | 63 | <toolbarseparator/>
|
| 63 | 64 | <toolbarbutton id="appMenu-bookmarks-button"
|
| 64 | 65 | class="subviewbutton subviewbutton-nav"
|
| ... | ... | @@ -229,9 +229,6 @@ var gBrowserInit = { |
| 229 | 229 | // Init the SecurityLevelButton
|
| 230 | 230 | SecurityLevelButton.init();
|
| 231 | 231 | |
| 232 | - // Init the NewIdentityButton
|
|
| 233 | - NewIdentityButton.init();
|
|
| 234 | - |
|
| 235 | 232 | // Certain kinds of automigration rely on this notification to complete
|
| 236 | 233 | // their tasks BEFORE the browser window is shown. SessionStore uses it to
|
| 237 | 234 | // restore tabs into windows AFTER important parts like gMultiProcessBrowser
|
| ... | ... | @@ -1043,8 +1040,6 @@ var gBrowserInit = { |
| 1043 | 1040 | |
| 1044 | 1041 | SecurityLevelButton.uninit();
|
| 1045 | 1042 | |
| 1046 | - NewIdentityButton.uninit();
|
|
| 1047 | - |
|
| 1048 | 1043 | if (gToolbarKeyNavEnabled) {
|
| 1049 | 1044 | ToolbarKeyboardNavigator.uninit();
|
| 1050 | 1045 | }
|
| ... | ... | @@ -22,7 +22,9 @@ |
| 22 | 22 | key="key_privatebrowsing" data-l10n-id="menu-file-new-private-window"/>
|
| 23 | 23 | <menuseparator/>
|
| 24 | 24 | <menuitem id="menu_newIdentity"
|
| 25 | - key="new-identity-key" data-l10n-id="menu-new-identity"/>
|
|
| 25 | + command="cmd_newIdentity"
|
|
| 26 | + key="new-identity-key"
|
|
| 27 | + data-l10n-id="menu-new-identity"/>
|
|
| 26 | 28 | <menuseparator/>
|
| 27 | 29 | <menuitem id="menu_openLocation"
|
| 28 | 30 | hidden="true"
|
| ... | ... | @@ -112,6 +112,8 @@ |
| 112 | 112 | #ifdef XP_MACOSX
|
| 113 | 113 | <command id="zoomWindow" data-l10n-id="window-zoom-command" />
|
| 114 | 114 | #endif
|
| 115 | + |
|
| 116 | + <command id="cmd_newIdentity" />
|
|
| 115 | 117 | </commandset>
|
| 116 | 118 | #include ../../components/places/content/placesCommands.inc.xhtml
|
| 117 | 119 |
| ... | ... | @@ -574,7 +574,9 @@ |
| 574 | 574 | command="cmd_newNavigator"
|
| 575 | 575 | tooltip="dynamic-shortcut-tooltip"/>
|
| 576 | 576 | |
| 577 | - <toolbarbutton id="new-identity-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
|
|
| 577 | + <toolbarbutton id="new-identity-button"
|
|
| 578 | + command="cmd_newIdentity"
|
|
| 579 | + class="toolbarbutton-1 chromeclass-toolbar-additional"
|
|
| 578 | 580 | data-l10n-id="toolbar-new-identity"/>
|
| 579 | 581 | |
| 580 | 582 | <toolbarbutton id="fullscreen-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
|
| ... | ... | @@ -251,6 +251,7 @@ export class CustomizeMode { |
| 251 | 251 | "Browser:NewUserContextTab",
|
| 252 | 252 | "Tools:PrivateBrowsing",
|
| 253 | 253 | "zoomWindow",
|
| 254 | + "cmd_newIdentity",
|
|
| 254 | 255 | ]);
|
| 255 | 256 | |
| 256 | 257 | /**
|
| ... | ... | @@ -501,34 +501,6 @@ ChromeUtils.defineLazyGetter(this, "NewIdentityButton", () => { |
| 501 | 501 | |
| 502 | 502 | let newIdentityInProgress = false;
|
| 503 | 503 | return {
|
| 504 | - topics,
|
|
| 505 | - |
|
| 506 | - init() {
|
|
| 507 | - // We first search in the DOM for the identity button. If it does not
|
|
| 508 | - // exist it may be in the toolbox palette. In the latter case we still
|
|
| 509 | - // need to initialize the button in case it is added back later through
|
|
| 510 | - // customization.
|
|
| 511 | - const button =
|
|
| 512 | - document.getElementById("new-identity-button") ||
|
|
| 513 | - window.gNavToolbox.palette.querySelector("#new-identity-button");
|
|
| 514 | - button?.addEventListener("command", () => {
|
|
| 515 | - this.onCommand();
|
|
| 516 | - });
|
|
| 517 | - document
|
|
| 518 | - .getElementById("appMenu-viewCache")
|
|
| 519 | - .content.querySelector("#appMenu-new-identity")
|
|
| 520 | - ?.addEventListener("command", () => {
|
|
| 521 | - this.onCommand();
|
|
| 522 | - });
|
|
| 523 | - document
|
|
| 524 | - .getElementById("menu_newIdentity")
|
|
| 525 | - ?.addEventListener("command", () => {
|
|
| 526 | - this.onCommand();
|
|
| 527 | - });
|
|
| 528 | - },
|
|
| 529 | - |
|
| 530 | - uninit() {},
|
|
| 531 | - |
|
| 532 | 504 | async onCommand() {
|
| 533 | 505 | try {
|
| 534 | 506 | // Ignore if there's a New Identity in progress to avoid race
|