
henry pushed to branch tor-browser-140.0esr-15.0-1 at The Tor Project / Applications / Tor Browser Commits: b2905b2c by Henry Wilkes at 2025-07-17T13:01:51+00:00 fixup! BB 40926: Implemented the New Identity feature TB 43638: Add the cmd_newIdentity command element and use it. - - - - - b6c948ee by Henry Wilkes at 2025-07-17T13:01:51+00:00 fixup! TB 3455: Add DomainIsolator, for isolating circuit by domain. TB 43638: Update the usage of cmd_newCircuit. - - - - - 8 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/base/content/navigator-toolbox.js - browser/components/customizableui/CustomizeMode.sys.mjs - browser/components/newidentity/content/newidentity.js Changes: ===================================== browser/base/content/appmenu-viewcache.inc.xhtml ===================================== @@ -58,7 +58,8 @@ <toolbarbutton id="appMenu-new-identity" class="subviewbutton" data-l10n-id="appmenuitem-new-identity" - key="new-identity-key"/> + key="new-identity-key" + command="cmd_newIdentity"/> <toolbarbutton id="appMenuNewCircuit" class="subviewbutton" key="new-circuit-key" ===================================== browser/base/content/browser-init.js ===================================== @@ -229,9 +229,6 @@ var gBrowserInit = { // Init the SecurityLevelButton SecurityLevelButton.init(); - // Init the NewIdentityButton - NewIdentityButton.init(); - gTorConnectUrlbarButton.init(); gTorConnectTitlebarStatus.init(); @@ -1065,8 +1062,6 @@ var gBrowserInit = { SecurityLevelButton.uninit(); - NewIdentityButton.uninit(); - gTorConnectUrlbarButton.uninit(); gTorConnectTitlebarStatus.uninit(); ===================================== browser/base/content/browser-menubar.inc ===================================== @@ -22,7 +22,9 @@ key="key_privatebrowsing" data-l10n-id="menu-file-new-private-window"/> <menuseparator/> <menuitem id="menu_newIdentity" - key="new-identity-key" data-l10n-id="menu-new-identity"/> + command="cmd_newIdentity" + key="new-identity-key" + data-l10n-id="menu-new-identity"/> <menuitem id="menu_newCircuit" key="new-circuit-key" data-l10n-id="menu-new-tor-circuit" command="cmd_newCircuit"/> ===================================== browser/base/content/browser-sets.inc ===================================== @@ -113,7 +113,8 @@ <command id="zoomWindow" data-l10n-id="window-zoom-command" /> #endif - <command id ="cmd_newCircuit" /> + <command id="cmd_newIdentity" /> + <command id="cmd_newCircuit" /> </commandset> #include ../../components/places/content/placesCommands.inc.xhtml ===================================== browser/base/content/navigator-toolbox.inc.xhtml ===================================== @@ -601,10 +601,14 @@ command="cmd_newNavigator" tooltip="dynamic-shortcut-tooltip"/> - <toolbarbutton id="new-identity-button" class="toolbarbutton-1 chromeclass-toolbar-additional" + <toolbarbutton id="new-identity-button" + command="cmd_newIdentity" + class="toolbarbutton-1 chromeclass-toolbar-additional" data-l10n-id="toolbar-new-identity"/> - <toolbarbutton id="new-circuit-button" class="toolbarbutton-1 chromeclass-toolbar-additional" + <toolbarbutton id="new-circuit-button" + command="cmd_newCircuit" + class="toolbarbutton-1 chromeclass-toolbar-additional" data-l10n-id="toolbar-new-tor-circuit"/> <toolbarbutton id="fullscreen-button" class="toolbarbutton-1 chromeclass-toolbar-additional" ===================================== browser/base/content/navigator-toolbox.js ===================================== @@ -51,8 +51,7 @@ document.addEventListener( #BMB_bookmarksPopup, #BMB_viewBookmarksSidebar, #BMB_searchBookmarks, - #BMB_viewBookmarksToolbar, - #new-circuit-button`); + #BMB_viewBookmarksToolbar`); if (!element) { return; } @@ -93,10 +92,6 @@ document.addEventListener( BookmarkingUI.toggleBookmarksToolbar("bookmarks-widget"); break; - case "new-circuit-button": - TorDomainIsolator.newCircuitForBrowser(gBrowser.selectedBrowser); - break; - default: if (element.classList.contains("content-analysis-indicator")) { ContentAnalysis.showPanel(element, PanelUI); ===================================== browser/components/customizableui/CustomizeMode.sys.mjs ===================================== @@ -251,6 +251,8 @@ export class CustomizeMode { "Browser:NewUserContextTab", "Tools:PrivateBrowsing", "zoomWindow", + "cmd_newIdentity", + "cmd_newCircuit", ]); /** ===================================== browser/components/newidentity/content/newidentity.js ===================================== @@ -501,34 +501,6 @@ ChromeUtils.defineLazyGetter(this, "NewIdentityButton", () => { let newIdentityInProgress = false; return { - topics, - - init() { - // We first search in the DOM for the identity button. If it does not - // exist it may be in the toolbox palette. In the latter case we still - // need to initialize the button in case it is added back later through - // customization. - const button = - document.getElementById("new-identity-button") || - window.gNavToolbox.palette.querySelector("#new-identity-button"); - button?.addEventListener("command", () => { - this.onCommand(); - }); - document - .getElementById("appMenu-viewCache") - .content.querySelector("#appMenu-new-identity") - ?.addEventListener("command", () => { - this.onCommand(); - }); - document - .getElementById("menu_newIdentity") - ?.addEventListener("command", () => { - this.onCommand(); - }); - }, - - uninit() {}, - async onCommand() { try { // Ignore if there's a New Identity in progress to avoid race View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/360585a... -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/360585a... You're receiving this email because of your account on gitlab.torproject.org.