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:
Changes:
browser/base/content/appmenu-viewcache.inc.xhtml
| ... |
... |
@@ -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
|
<toolbarbutton id="appMenuNewCircuit"
|
|
63
|
64
|
class="subviewbutton"
|
|
64
|
65
|
key="new-circuit-key"
|
browser/base/content/browser-init.js
| ... |
... |
@@ -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
|
gTorConnectUrlbarButton.init();
|
|
236
|
233
|
gTorConnectTitlebarStatus.init();
|
|
237
|
234
|
|
| ... |
... |
@@ -1065,8 +1062,6 @@ var gBrowserInit = { |
|
1065
|
1062
|
|
|
1066
|
1063
|
SecurityLevelButton.uninit();
|
|
1067
|
1064
|
|
|
1068
|
|
- NewIdentityButton.uninit();
|
|
1069
|
|
-
|
|
1070
|
1065
|
gTorConnectUrlbarButton.uninit();
|
|
1071
|
1066
|
gTorConnectTitlebarStatus.uninit();
|
|
1072
|
1067
|
|
browser/base/content/browser-menubar.inc
| ... |
... |
@@ -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
|
<menuitem id="menu_newCircuit"
|
|
27
|
29
|
key="new-circuit-key" data-l10n-id="menu-new-tor-circuit"
|
|
28
|
30
|
command="cmd_newCircuit"/>
|
browser/base/content/browser-sets.inc
| ... |
... |
@@ -113,7 +113,8 @@ |
|
113
|
113
|
<command id="zoomWindow" data-l10n-id="window-zoom-command" />
|
|
114
|
114
|
#endif
|
|
115
|
115
|
|
|
116
|
|
- <command id ="cmd_newCircuit" />
|
|
|
116
|
+ <command id="cmd_newIdentity" />
|
|
|
117
|
+ <command id="cmd_newCircuit" />
|
|
117
|
118
|
</commandset>
|
|
118
|
119
|
#include ../../components/places/content/placesCommands.inc.xhtml
|
|
119
|
120
|
|
browser/base/content/navigator-toolbox.inc.xhtml
| ... |
... |
@@ -601,10 +601,14 @@ |
|
601
|
601
|
command="cmd_newNavigator"
|
|
602
|
602
|
tooltip="dynamic-shortcut-tooltip"/>
|
|
603
|
603
|
|
|
604
|
|
- <toolbarbutton id="new-identity-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
|
|
|
604
|
+ <toolbarbutton id="new-identity-button"
|
|
|
605
|
+ command="cmd_newIdentity"
|
|
|
606
|
+ class="toolbarbutton-1 chromeclass-toolbar-additional"
|
|
605
|
607
|
data-l10n-id="toolbar-new-identity"/>
|
|
606
|
608
|
|
|
607
|
|
- <toolbarbutton id="new-circuit-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
|
|
|
609
|
+ <toolbarbutton id="new-circuit-button"
|
|
|
610
|
+ command="cmd_newCircuit"
|
|
|
611
|
+ class="toolbarbutton-1 chromeclass-toolbar-additional"
|
|
608
|
612
|
data-l10n-id="toolbar-new-tor-circuit"/>
|
|
609
|
613
|
|
|
610
|
614
|
<toolbarbutton id="fullscreen-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
|
browser/base/content/navigator-toolbox.js
| ... |
... |
@@ -51,8 +51,7 @@ document.addEventListener( |
|
51
|
51
|
#BMB_bookmarksPopup,
|
|
52
|
52
|
#BMB_viewBookmarksSidebar,
|
|
53
|
53
|
#BMB_searchBookmarks,
|
|
54
|
|
- #BMB_viewBookmarksToolbar,
|
|
55
|
|
- #new-circuit-button`);
|
|
|
54
|
+ #BMB_viewBookmarksToolbar`);
|
|
56
|
55
|
if (!element) {
|
|
57
|
56
|
return;
|
|
58
|
57
|
}
|
| ... |
... |
@@ -93,10 +92,6 @@ document.addEventListener( |
|
93
|
92
|
BookmarkingUI.toggleBookmarksToolbar("bookmarks-widget");
|
|
94
|
93
|
break;
|
|
95
|
94
|
|
|
96
|
|
- case "new-circuit-button":
|
|
97
|
|
- TorDomainIsolator.newCircuitForBrowser(gBrowser.selectedBrowser);
|
|
98
|
|
- break;
|
|
99
|
|
-
|
|
100
|
95
|
default:
|
|
101
|
96
|
if (element.classList.contains("content-analysis-indicator")) {
|
|
102
|
97
|
ContentAnalysis.showPanel(element, PanelUI);
|
browser/components/customizableui/CustomizeMode.sys.mjs
| ... |
... |
@@ -251,6 +251,8 @@ export class CustomizeMode { |
|
251
|
251
|
"Browser:NewUserContextTab",
|
|
252
|
252
|
"Tools:PrivateBrowsing",
|
|
253
|
253
|
"zoomWindow",
|
|
|
254
|
+ "cmd_newIdentity",
|
|
|
255
|
+ "cmd_newCircuit",
|
|
254
|
256
|
]);
|
|
255
|
257
|
|
|
256
|
258
|
/**
|
browser/components/newidentity/content/newidentity.js
| ... |
... |
@@ -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
|
|