morgan pushed to branch tor-browser-128.1.0esr-14.0-1 at The Tor Project / Applications / Tor Browser
Commits:
-
a7f45e05
by Pier Angelo Vendrame at 2024-08-22T14:02:09+02:00
-
d25a948d
by Pier Angelo Vendrame at 2024-08-22T14:03:09+02:00
-
6ca3c329
by Pier Angelo Vendrame at 2024-08-22T14:03:41+02:00
-
da2d11fa
by Pier Angelo Vendrame at 2024-08-22T14:05:24+02:00
9 changed files:
- browser/actors/CryptoSafetyParent.sys.mjs
- browser/base/content/appmenu-viewcache.inc.xhtml
- browser/base/content/browser-menubar.inc
- browser/base/content/browser-sets.inc
- browser/base/content/navigator-toolbox.inc.xhtml
- browser/components/torcircuit/content/torCircuitPanel.js
- mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
- mobile/shared/modules/geckoview/GeckoViewContent.sys.mjs
- toolkit/components/tor-launcher/TorDomainIsolator.sys.mjs
Changes:
... | ... | @@ -67,7 +67,7 @@ export class CryptoSafetyParent extends JSWindowActorParent { |
67 | 67 | const browser = browsingContext.embedderElement;
|
68 | 68 | if (browser) {
|
69 | 69 | lazy.TorDomainIsolator.newCircuitForBrowser(
|
70 | - browser.ownerGlobal.gBrowser
|
|
70 | + browser.ownerGlobal.gBrowser.selectedBrowser
|
|
71 | 71 | );
|
72 | 72 | }
|
73 | 73 | }
|
... | ... | @@ -56,7 +56,7 @@ |
56 | 56 | class="subviewbutton"
|
57 | 57 | key="new-circuit-key"
|
58 | 58 | data-l10n-id="appmenuitem-new-tor-circuit"
|
59 | - oncommand="TorDomainIsolator.newCircuitForBrowser(gBrowser);"/>
|
|
59 | + oncommand="TorDomainIsolator.newCircuitForBrowser(gBrowser.selectedBrowser);"/>
|
|
60 | 60 | <toolbarseparator/>
|
61 | 61 | <toolbarbutton id="appMenu-bookmarks-button"
|
62 | 62 | class="subviewbutton subviewbutton-nav"
|
... | ... | @@ -33,7 +33,7 @@ |
33 | 33 | key="new-identity-key" data-l10n-id="menu-new-identity"/>
|
34 | 34 | <menuitem id="menu_newCircuit"
|
35 | 35 | key="new-circuit-key" data-l10n-id="menu-new-tor-circuit"
|
36 | - oncommand="TorDomainIsolator.newCircuitForBrowser(gBrowser);"/>
|
|
36 | + oncommand="TorDomainIsolator.newCircuitForBrowser(gBrowser.selectedBrowser);"/>
|
|
37 | 37 | <menuseparator/>
|
38 | 38 | <menuitem id="menu_openLocation"
|
39 | 39 | hidden="true"
|
... | ... | @@ -392,5 +392,5 @@ |
392 | 392 | internal="true"/>
|
393 | 393 | #endif
|
394 | 394 | <key id="new-identity-key" modifiers="accel shift" key="U" oncommand="NewIdentityButton.onCommand(event)"/>
|
395 | - <key id="new-circuit-key" modifiers="accel shift" key="L" oncommand="TorDomainIsolator.newCircuitForBrowser(gBrowser)"/>
|
|
395 | + <key id="new-circuit-key" modifiers="accel shift" key="L" oncommand="TorDomainIsolator.newCircuitForBrowser(gBrowser.selectedBrowser)"/>
|
|
396 | 396 | </keyset> |
... | ... | @@ -621,7 +621,7 @@ |
621 | 621 | |
622 | 622 | <toolbarbutton id="new-circuit-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
|
623 | 623 | data-l10n-id="toolbar-new-tor-circuit"
|
624 | - oncommand="TorDomainIsolator.newCircuitForBrowser(gBrowser);"/>
|
|
624 | + oncommand="TorDomainIsolator.newCircuitForBrowser(gBrowser.selectedBrowser);"/>
|
|
625 | 625 | |
626 | 626 | <toolbarbutton id="fullscreen-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
|
627 | 627 | observes="View:FullScreen"
|
... | ... | @@ -127,7 +127,7 @@ var gTorCircuitPanel = { |
127 | 127 | document
|
128 | 128 | .getElementById("tor-circuit-new-circuit")
|
129 | 129 | .addEventListener("command", () => {
|
130 | - TorDomainIsolator.newCircuitForBrowser(gBrowser);
|
|
130 | + TorDomainIsolator.newCircuitForBrowser(gBrowser.selectedBrowser);
|
|
131 | 131 | });
|
132 | 132 | |
133 | 133 | // Update the display just before opening.
|
... | ... | @@ -2610,6 +2610,14 @@ public class GeckoSession { |
2610 | 2610 | return mEventDispatcher.queryBundle("GeckoView:GetTorCircuit");
|
2611 | 2611 | }
|
2612 | 2612 | |
2613 | + /**
|
|
2614 | + * Change the circuit for this session.
|
|
2615 | + */
|
|
2616 | + @UiThread
|
|
2617 | + public void newTorCircuit() {
|
|
2618 | + mEventDispatcher.dispatch("GeckoView:NewTorCircuit");
|
|
2619 | + }
|
|
2620 | + |
|
2613 | 2621 | /**
|
2614 | 2622 | * Set this GeckoSession as active or inactive, which represents if the session is currently
|
2615 | 2623 | * visible or not. Setting a GeckoSession to inactive will significantly reduce its memory
|
... | ... | @@ -40,6 +40,7 @@ export class GeckoViewContent extends GeckoViewModule { |
40 | 40 | "GeckoView:ZoomToInput",
|
41 | 41 | "GeckoView:IsPdfJs",
|
42 | 42 | "GeckoView:GetTorCircuit",
|
43 | + "GeckoView:NewTorCircuit",
|
|
43 | 44 | ]);
|
44 | 45 | }
|
45 | 46 | |
... | ... | @@ -313,6 +314,9 @@ export class GeckoViewContent extends GeckoViewModule { |
313 | 314 | case "GeckoView:GetTorCircuit":
|
314 | 315 | this._getTorCircuit(aCallback);
|
315 | 316 | break;
|
317 | + case "GeckoView:NewTorCircuit":
|
|
318 | + this._newTorCircuit(aCallback);
|
|
319 | + break;
|
|
316 | 320 | }
|
317 | 321 | }
|
318 | 322 | |
... | ... | @@ -437,6 +441,11 @@ export class GeckoViewContent extends GeckoViewModule { |
437 | 441 | }
|
438 | 442 | }
|
439 | 443 | |
444 | + _newTorCircuit(aCallback) {
|
|
445 | + lazy.TorDomainIsolator.newCircuitForBrowser(this.browser);
|
|
446 | + aCallback?.onSuccess();
|
|
447 | + }
|
|
448 | + |
|
440 | 449 | async _containsFormData(aCallback) {
|
441 | 450 | aCallback.onSuccess(await this.actor.containsFormData());
|
442 | 451 | }
|
... | ... | @@ -225,11 +225,9 @@ class TorDomainIsolatorImpl { |
225 | 225 | * Create a new nonce for the FP domain of the selected browser and reload the
|
226 | 226 | * tab with a new circuit.
|
227 | 227 | *
|
228 | - * @param {object} globalBrowser Should be the gBrowser from the context of
|
|
229 | - * the caller
|
|
228 | + * @param {object} browser The browser we want to change the circuit for.
|
|
230 | 229 | */
|
231 | - newCircuitForBrowser(globalBrowser) {
|
|
232 | - const browser = globalBrowser.selectedBrowser;
|
|
230 | + newCircuitForBrowser(browser) {
|
|
233 | 231 | const firstPartyDomain = getDomainForBrowser(browser);
|
234 | 232 | this.newCircuitForDomain(firstPartyDomain);
|
235 | 233 | const { username, password } = this.#getSocksProxyCredentials(
|