lists.torproject.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

tbb-commits

Thread Start a new thread
Download
Threads by month
  • ----- 2025 -----
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2018 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2017 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2016 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2015 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2014 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
tbb-commits@lists.torproject.org

June 2023

  • 1 participants
  • 138 discussions
[Git][tpo/applications/tor-browser][tor-browser-102.12.0esr-13.0-1] 12 commits: fixup! Bug 40933: Add tor-launcher functionality
by richard (@richard) 08 Jun '23

08 Jun '23
richard pushed to branch tor-browser-102.12.0esr-13.0-1 at The Tor Project / Applications / Tor Browser Commits: 2bf330d2 by Pier Angelo Vendrame at 2023-06-08T14:56:19+02:00 fixup! Bug 40933: Add tor-launcher functionality Added a newnym function - - - - - ed24f026 by Pier Angelo Vendrame at 2023-06-08T14:56:20+02:00 fixup! Bug 10760: Integrate TorButton to TorBrowser core Bug 40938: Moving the domain isolator out of torbutton - - - - - 4e063afe by Arthur Edelstein at 2023-06-08T14:56:20+02:00 Bug 3455: Add DomainIsolator, for isolating circuit by domain. Add an XPCOM component that registers a ProtocolProxyChannelFilter which sets the username/password for each web request according to url bar domain. Bug 9442: Add New Circuit button Bug 13766: Set a 10 minute circuit dirty timeout for the catch-all circ. Bug 19206: Include a 128 bit random tag as part of the domain isolator nonce. Bug 19206: Clear out the domain isolator state on `New Identity`. Bug 21201.2: Isolate by firstPartyDomain from OriginAttributes Bug 21745: Fix handling of catch-all circuit Bug 41741: Refactor the domain isolator and new circuit - - - - - 9018b2cd by Pier Angelo Vendrame at 2023-06-08T14:56:20+02:00 fixup! Bug 3455: Add DomainIsolator, for isolating circuit by domain. Refactors to the old JS code. - - - - - 47c03bfc by Pier Angelo Vendrame at 2023-06-08T14:56:21+02:00 fixup! Bug 3455: Add DomainIsolator, for isolating circuit by domain. Manage NEWNYM here. - - - - - d33564dd by Pier Angelo Vendrame at 2023-06-08T14:56:21+02:00 fixup! Bug 3455: Add DomainIsolator, for isolating circuit by domain. Removed the XPCOM definition of the domain isolator. - - - - - ae68e4b5 by Pier Angelo Vendrame at 2023-06-08T14:56:22+02:00 fixup! Bug 10760: Integrate TorButton to TorBrowser core Extract the new identity button from torbutton - - - - - 322c6af1 by Pier Angelo Vendrame at 2023-06-08T14:56:22+02:00 fixup! Bug 3455: Add DomainIsolator, for isolating circuit by domain. Actually added the new circuit button. - - - - - 1ba65aa4 by Pier Angelo Vendrame at 2023-06-08T14:56:22+02:00 fixup! Bug 41600: Add a tor circuit display panel. Use the new domain isolator interface. - - - - - beec825e by Pier Angelo Vendrame at 2023-06-08T14:56:23+02:00 fixup! Bug 40209: Implement Basic Crypto Safety Use the new domain isolator interface - - - - - e3478fc9 by Pier Angelo Vendrame at 2023-06-08T14:56:23+02:00 fixup! Bug 10760: Integrate TorButton to TorBrowser core Remove string changes from Torbutton. We will add them back in the TorStrings commit. - - - - - cf8bb1df by Pier Angelo Vendrame at 2023-06-08T14:56:24+02:00 fixup! Add TorStrings module for localization Add our DTDs where needed. These changes were originally in the torbutton commit, but I think they are better fit here, with all the strings files. - - - - - 15 changed files: - browser/actors/CryptoSafetyParent.jsm - browser/base/content/appmenu-viewcache.inc.xhtml - browser/base/content/browser-menubar.inc - browser/base/content/browser-sets.inc - browser/base/content/browser.js - browser/base/content/navigator-toolbox.inc.xhtml - browser/components/torcircuit/content/torCircuitPanel.js - + toolkit/components/tor-launcher/TorDomainIsolator.jsm - toolkit/components/tor-launcher/TorProtocolService.jsm - toolkit/components/tor-launcher/TorStartupService.jsm - toolkit/components/tor-launcher/moz.build - toolkit/torbutton/chrome/content/torbutton.js - − toolkit/torbutton/components/domain-isolator.js - toolkit/torbutton/jar.mn - toolkit/torbutton/modules/utils.js Changes: ===================================== browser/actors/CryptoSafetyParent.jsm ===================================== @@ -12,6 +12,12 @@ const { XPCOMUtils } = ChromeUtils.import( "resource://gre/modules/XPCOMUtils.jsm" ); +ChromeUtils.defineModuleGetter( + this, + "TorDomainIsolator", + "resource://gre/modules/TorDomainIsolator.jsm" +); + XPCOMUtils.defineLazyGetter(this, "cryptoSafetyBundle", () => { return Services.strings.createBundle( "chrome://browser/locale/cryptoSafetyPrompt.properties" @@ -75,7 +81,11 @@ class CryptoSafetyParent extends JSWindowActorParent { ); if (buttonPressed === 0) { - this.browsingContext.topChromeWindow.torbutton_new_circuit(); + const { browsingContext } = this.manager; + const browser = browsingContext.embedderElement; + if (browser) { + TorDomainIsolator.newCircuitForBrowser(browser.ownerGlobal.gBrowser); + } } } } ===================================== browser/base/content/appmenu-viewcache.inc.xhtml ===================================== @@ -63,9 +63,9 @@ key="new-identity-key"/> <toolbarbutton id="appMenuNewCircuit" class="subviewbutton" - key="torbutton-new-circuit-key" + key="new-circuit-key" label="&torbutton.context_menu.new_circuit_sentence_case;" - oncommand="torbutton_new_circuit();"/> + oncommand="TorDomainIsolator.newCircuitForBrowser(gBrowser);"/> <toolbarseparator/> <toolbarbutton id="appMenu-bookmarks-button" class="subviewbutton subviewbutton-nav" ===================================== browser/base/content/browser-menubar.inc ===================================== @@ -33,9 +33,9 @@ key="new-identity-key"/> <menuitem id="menu_newCircuit" accesskey="&torbutton.context_menu.new_circuit_key;" - key="torbutton-new-circuit-key" + key="new-circuit-key" label="&torbutton.context_menu.new_circuit;" - oncommand="torbutton_new_circuit();"/> + oncommand="TorDomainIsolator.newCircuitForBrowser(gBrowser);"/> <menuseparator/> <menuitem id="menu_openLocation" hidden="true" ===================================== browser/base/content/browser-sets.inc ===================================== @@ -389,5 +389,5 @@ internal="true"/> #endif <key id="new-identity-key" modifiers="accel shift" key="U" oncommand="NewIdentityButton.onCommand(event)"/> - <key id="torbutton-new-circuit-key" modifiers="accel shift" key="L" oncommand="torbutton_new_circuit()"/> + <key id="new-circuit-key" modifiers="accel shift" key="L" oncommand="TorDomainIsolator.newCircuitForBrowser(gBrowser)"/> </keyset> ===================================== browser/base/content/browser.js ===================================== @@ -82,6 +82,7 @@ XPCOMUtils.defineLazyModuleGetters(this, { TorConnect: "resource:///modules/TorConnect.jsm", TorConnectState: "resource:///modules/TorConnect.jsm", TorConnectTopics: "resource:///modules/TorConnect.jsm", + TorDomainIsolator: "resource://gre/modules/TorDomainIsolator.jsm", Translation: "resource:///modules/translation/TranslationParent.jsm", UITour: "resource:///modules/UITour.jsm", UpdateUtils: "resource://gre/modules/UpdateUtils.jsm", ===================================== browser/base/content/navigator-toolbox.inc.xhtml ===================================== @@ -569,7 +569,7 @@ <toolbarbutton id="new-circuit-button" class="toolbarbutton-1 chromeclass-toolbar-additional" label="&torbutton.context_menu.new_circuit;" - oncommand="torbutton_new_circuit();" + oncommand="TorDomainIsolator.newCircuitForBrowser(gBrowser);" tooltiptext="&torbutton.context_menu.new_circuit;"/> <toolbarbutton id="fullscreen-button" class="toolbarbutton-1 chromeclass-toolbar-additional" ===================================== browser/components/torcircuit/content/torCircuitPanel.js ===================================== @@ -193,7 +193,7 @@ var gTorCircuitPanel = { document .getElementById("tor-circuit-new-circuit") .addEventListener("command", () => { - torbutton_new_circuit(); + TorDomainIsolator.newCircuitForBrowser(gBrowser); // And hide. // NOTE: focus should return to the toolbar button, which we expect to // remain visible during reload. @@ -415,20 +415,14 @@ var gTorCircuitPanel = { */ _updateCurrentBrowser(matchingCredentials = null) { const browser = gBrowser.selectedBrowser; - const { getDomainForBrowser } = ChromeUtils.import( - "resource://torbutton/modules/utils.js" - ); - const domain = getDomainForBrowser(browser); + const domain = TorDomainIsolator.getDomainForBrowser(browser); // We choose the currentURI, which matches what is shown in the URL bar and // will match up with the domain. // In contrast, documentURI corresponds to the shown page. E.g. it could // point to "about:certerror". const scheme = browser.currentURI?.scheme; - const domainIsolator = Cc["@torproject.org/domain-isolator;1"].getService( - Ci.nsISupports - ).wrappedJSObject; - let credentials = domainIsolator.getSocksProxyCredentials( + let credentials = TorDomainIsolator.getSocksProxyCredentials( domain, browser.contentPrincipal.originAttributes.userContextId ); ===================================== toolkit/components/tor-launcher/TorDomainIsolator.jsm ===================================== @@ -0,0 +1,362 @@ +// A component for Tor Browser that puts requests from different +// first party domains on separate Tor circuits. + +var EXPORTED_SYMBOLS = ["TorDomainIsolator"]; + +const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); +const { XPCOMUtils } = ChromeUtils.import( + "resource://gre/modules/XPCOMUtils.jsm" +); +const { ConsoleAPI } = ChromeUtils.import("resource://gre/modules/Console.jsm"); + +Cu.importGlobalProperties(["crypto"]); + +XPCOMUtils.defineLazyServiceGetters(this, { + ProtocolProxyService: [ + "@mozilla.org/network/protocol-proxy-service;1", + "nsIProtocolProxyService", + ], +}); + +ChromeUtils.defineModuleGetter( + this, + "TorProtocolService", + "resource://gre/modules/TorProtocolService.jsm" +); + +const logger = new ConsoleAPI({ + prefix: "TorDomainIsolator", + maxLogLevel: "warn", + maxLogLevelPref: "browser.tordomainisolator.loglevel", +}); + +// The string to use instead of the domain when it is not known. +const CATCHALL_DOMAIN = "--unknown--"; + +// The preference to observe, to know whether isolation should be enabled or +// disabled. +const NON_TOR_PROXY_PREF = "extensions.torbutton.use_nontor_proxy"; + +// The topic of new identity, to observe to cleanup all the nonces. +const NEW_IDENTITY_TOPIC = "new-identity-requested"; + +class TorDomainIsolatorImpl { + // A mutable map that records what nonce we are using for each domain. + #noncesForDomains = new Map(); + + // A mutable map that records what nonce we are using for each tab container. + #noncesForUserContextId = new Map(); + + // A bool that controls if we use SOCKS auth for isolation or not. + #isolationEnabled = true; + + // Specifies when the current catch-all circuit was first used + #catchallDirtySince = Date.now(); + + /** + * Initialize the domain isolator. + * This function will setup the proxy filter that injects the credentials and + * register some observers. + */ + init() { + logger.info("Setup circuit isolation by domain and user context"); + + if (Services.prefs.getBoolPref(NON_TOR_PROXY_PREF)) { + this.#isolationEnabled = false; + } + this.#setupProxyFilter(); + + Services.prefs.addObserver(NON_TOR_PROXY_PREF, this); + Services.obs.addObserver(this, NEW_IDENTITY_TOPIC); + } + + /** + * Removes the observers added in the initialization. + */ + uninit() { + Services.prefs.removeObserver(NON_TOR_PROXY_PREF, this); + Services.obs.removeObserver(this, NEW_IDENTITY_TOPIC); + } + + enable() { + logger.trace("Domain isolation enabled"); + this.#isolationEnabled = true; + } + + disable() { + logger.trace("Domain isolation disabled"); + this.#isolationEnabled = false; + } + + /** + * Return the credentials to use as username and password for the SOCKS proxy, + * given a certain domain and userContextId. Optionally, create them. + * + * @param firstPartyDomain The first party domain associated to the requests + * @param userContextId The context ID associated to the request + * @param create Whether to create the nonce, if it is not available + * @return Either the credential, or null if we do not have them and create is + * false. + */ + getSocksProxyCredentials(firstPartyDomain, userContextId, create = false) { + if (!this.#noncesForDomains.has(firstPartyDomain)) { + if (!create) { + return null; + } + const nonce = this.#nonce(); + logger.info(`New nonce for first party ${firstPartyDomain}: ${nonce}`); + this.#noncesForDomains.set(firstPartyDomain, nonce); + } + if (!this.#noncesForUserContextId.has(userContextId)) { + if (!create) { + return null; + } + const nonce = this.#nonce(); + logger.info(`New nonce for userContextId ${userContextId}: ${nonce}`); + this.#noncesForUserContextId.set(userContextId, nonce); + } + return { + username: this.#makeUsername(firstPartyDomain, userContextId), + password: + this.#noncesForDomains.get(firstPartyDomain) + + this.#noncesForUserContextId.get(userContextId), + }; + } + + /** + * Create a new nonce for the FP domain of the selected browser and reload the + * tab with a new circuit. + * + * @param browser Should be the gBrowser from the context of the caller + */ + newCircuitForBrowser(browser) { + const firstPartyDomain = getDomainForBrowser(browser.selectedBrowser); + this.#newCircuitForDomain(firstPartyDomain); + // TODO: How to properly handle the user context? Should we use + // (domain, userContextId) pairs, instead of concatenating nonces? + browser.reloadWithFlags(Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE); + } + + /** + * Clear the isolation state cache, forcing new circuits to be used for all + * subsequent requests. + */ + clearIsolation() { + logger.trace("Clearing isolation nonces."); + + // Per-domain and per contextId nonces are stored in maps, so simply clear + // them. + this.#noncesForDomains.clear(); + this.#noncesForUserContextId.clear(); + + // Force a rotation on the next catch-all circuit use by setting the + // creation time to the epoch. + this.#catchallDirtySince = 0; + } + + async observe(subject, topic, data) { + if (topic === "nsPref:changed" && data === NON_TOR_PROXY_PREF) { + if (Services.prefs.getBoolPref(NON_TOR_PROXY_PREF)) { + this.disable(); + } else { + this.enable(); + } + } else if (topic === NEW_IDENTITY_TOPIC) { + logger.info( + "New identity has been requested, clearing isolation tokens." + ); + this.clearIsolation(); + try { + await TorProtocolService.newnym(); + } catch (e) { + logger.error("Could not send the newnym command", e); + // TODO: What UX to use here? See tor-browser#41708 + } + } + } + + /** + * Setup a filter that for every HTTPChannel, replaces the default SOCKS proxy + * with one that authenticates to the SOCKS server (the tor client process) + * with a username (the first party domain and userContextId) and a nonce + * password. + * Tor provides a separate circuit for each username+password combination. + */ + #setupProxyFilter() { + const filterFunction = (aChannel, aProxy) => { + if (!this.#isolationEnabled) { + return aProxy; + } + try { + const channel = aChannel.QueryInterface(Ci.nsIChannel); + let firstPartyDomain = + channel.loadInfo.originAttributes.firstPartyDomain; + const userContextId = channel.loadInfo.originAttributes.userContextId; + if (firstPartyDomain === "") { + firstPartyDomain = CATCHALL_DOMAIN; + if (Date.now() - this.#catchallDirtySince > 1000 * 10 * 60) { + logger.info( + "tor catchall circuit has been dirty for over 10 minutes. Rotating." + ); + this.#newCircuitForDomain(CATCHALL_DOMAIN); + this.#catchallDirtySince = Date.now(); + } + } + const replacementProxy = this.#applySocksProxyCredentials( + aProxy, + firstPartyDomain, + userContextId + ); + logger.debug( + `Requested ${channel.URI.spec} via ${replacementProxy.username}:${replacementProxy.password}` + ); + return replacementProxy; + } catch (e) { + logger.error("Error while setting a new proxy", e); + return null; + } + }; + + ProtocolProxyService.registerChannelFilter( + { + applyFilter(aChannel, aProxy, aCallback) { + aCallback.onProxyFilterResult(filterFunction(aChannel, aProxy)); + }, + }, + 0 + ); + } + + /** + * Takes a proxyInfo object (originalProxy) and returns a new proxyInfo + * object with the same properties, except the username is set to the + * the domain and userContextId, and the password is a nonce. + */ + #applySocksProxyCredentials(originalProxy, domain, userContextId) { + const proxy = originalProxy.QueryInterface(Ci.nsIProxyInfo); + const { username, password } = this.getSocksProxyCredentials( + domain, + userContextId, + true + ); + return ProtocolProxyService.newProxyInfoWithAuth( + "socks", + proxy.host, + proxy.port, + username, + password, + "", // aProxyAuthorizationHeader + "", // aConnectionIsolationKey + proxy.flags, + proxy.failoverTimeout, + proxy.failoverProxy + ); + } + + /** + * Combine the needed data into a username for the proxy. + */ + #makeUsername(domain, userContextId) { + if (!domain) { + domain = CATCHALL_DOMAIN; + } + return `${domain}:${userContextId}`; + } + + /** + * Generate a new 128 bit random tag. + * + * Strictly speaking both using a cryptographic entropy source and using 128 + * bits of entropy for the tag are likely overkill, as correct behavior only + * depends on how unlikely it is for there to be a collision. + */ + #nonce() { + return Array.from(crypto.getRandomValues(new Uint8Array(16)), byte => + byte.toString(16).padStart(2, "0") + ).join(""); + } + + /** + * Re-generate the nonce for a certain domain. + */ + #newCircuitForDomain(domain) { + if (!domain) { + domain = CATCHALL_DOMAIN; + } + this.#noncesForDomains.set(domain, this.#nonce()); + logger.info( + `New domain isolation for ${domain}: ${this.#noncesForDomains.get( + domain + )}` + ); + } + + /** + * Re-generate the nonce for a userContextId. + * + * Currently, this function is not hooked to anything. + */ + #newCircuitForUserContextId(userContextId) { + this.#noncesForUserContextId.set(userContextId, this.#nonce()); + logger.info( + `New container isolation for ${userContextId}: ${this.#noncesForUserContextId.get( + userContextId + )}` + ); + } +} + +/** + * Get the first party domain for a certain browser. + * + * @param browser The browser to get the FP-domain for. + * + * Please notice that it should be gBrowser.selectedBrowser, because + * browser.documentURI is the actual shown page, and might be an error page. + * In this case, we rely on currentURI, which for gBrowser is an alias of + * gBrowser.selectedBrowser.currentURI. + * See browser/base/content/tabbrowser.js and tor-browser#31562. + */ +function getDomainForBrowser(browser) { + let fpd = browser.contentPrincipal.originAttributes.firstPartyDomain; + + // Bug 31562: For neterror or certerror, get the original URL from + // browser.currentURI and use it to calculate the firstPartyDomain. + const knownErrors = [ + "about:neterror", + "about:certerror", + "about:httpsonlyerror", + ]; + const { documentURI } = browser; + if ( + documentURI && + documentURI.schemeIs("about") && + knownErrors.some(x => documentURI.spec.startsWith(x)) + ) { + const knownSchemes = ["http", "https"]; + const currentURI = browser.currentURI; + if (currentURI && knownSchemes.some(x => currentURI.schemeIs(x))) { + try { + fpd = Services.eTLD.getBaseDomainFromHost(currentURI.host); + } catch (e) { + if ( + e.result === Cr.NS_ERROR_HOST_IS_IP_ADDRESS || + e.result === Cr.NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS + ) { + fpd = currentURI.host; + } else { + logger.error( + `Failed to get first party domain for host ${currentURI.host}`, + e + ); + } + } + } + } + + return fpd; +} + +const TorDomainIsolator = new TorDomainIsolatorImpl(); +// Reduce global vars pollution +TorDomainIsolator.getDomainForBrowser = getDomainForBrowser; ===================================== toolkit/components/tor-launcher/TorProtocolService.jsm ===================================== @@ -4,6 +4,7 @@ var EXPORTED_SYMBOLS = ["TorProtocolService"]; +const { ConsoleAPI } = ChromeUtils.import("resource://gre/modules/Console.jsm"); const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); const { setTimeout } = ChromeUtils.import("resource://gre/modules/Timer.jsm"); ChromeUtils.defineModuleGetter( @@ -11,9 +12,6 @@ ChromeUtils.defineModuleGetter( "FileUtils", "resource://gre/modules/FileUtils.jsm" ); -const { XPCOMUtils } = ChromeUtils.import( - "resource://gre/modules/XPCOMUtils.jsm" -); Cu.importGlobalProperties(["crypto"]); @@ -45,18 +43,9 @@ const TorTopics = Object.freeze({ ProcessRestarted: "TorProcessRestarted", }); -// Logger adapted from CustomizableUI.jsm -XPCOMUtils.defineLazyGetter(this, "logger", () => { - const { ConsoleAPI } = ChromeUtils.import( - "resource://gre/modules/Console.jsm" - ); - // TODO: Use a preference to set the log level. - const consoleOptions = { - // maxLogLevel: "warn", - maxLogLevel: "all", - prefix: "TorProtocolService", - }; - return new ConsoleAPI(consoleOptions); +const logger = new ConsoleAPI({ + maxLogLevel: "warn", + prefix: "TorProtocolService", }); // Manage the connection to tor's control port, to update its settings and query @@ -194,6 +183,10 @@ const TorProtocolService = { TorMonitorService.retrieveBootstrapStatus(); }, + async newnym() { + return this.sendCommand("SIGNAL NEWNYM"); + }, + // TODO: transform the following 4 functions in getters. At the moment they // are also used in torbutton. ===================================== toolkit/components/tor-launcher/TorStartupService.jsm ===================================== @@ -33,6 +33,12 @@ ChromeUtils.defineModuleGetter( "resource:///modules/TorSettings.jsm" ); +ChromeUtils.defineModuleGetter( + this, + "TorDomainIsolator", + "resource://gre/modules/TorDomainIsolator.jsm" +); + /* Browser observer topis */ const BrowserTopics = Object.freeze({ ProfileAfterChange: "profile-after-change", @@ -67,12 +73,16 @@ class TorStartupService { TorSettings.init(); TorConnect.init(); + TorDomainIsolator.init(); + gInited = true; } _uninit() { Services.obs.removeObserver(this, BrowserTopics.QuitApplicationGranted); + TorDomainIsolator.uninit(); + // Close any helper connection first... TorProtocolService.uninit(); // ... and only then closes the event monitor connection, which will cause ===================================== toolkit/components/tor-launcher/moz.build ===================================== @@ -1,5 +1,6 @@ EXTRA_JS_MODULES += [ "TorBootstrapRequest.jsm", + "TorDomainIsolator.jsm", "TorLauncherUtil.jsm", "TorMonitorService.jsm", "TorParsers.jsm", ===================================== toolkit/torbutton/chrome/content/torbutton.js ===================================== @@ -1,6 +1,5 @@ // window globals var torbutton_init; -var torbutton_new_circuit; (() => { // Bug 1506 P1-P5: This is the main Torbutton overlay file. Much needs to be @@ -16,9 +15,7 @@ var torbutton_new_circuit; let { unescapeTorString, - getDomainForBrowser, torbutton_log, - torbutton_get_property_string, } = ChromeUtils.import("resource://torbutton/modules/utils.js"); let { configureControlPortModule, wait_for_controller } = ChromeUtils.import( "resource://torbutton/modules/tor-control-port.js" @@ -46,32 +43,22 @@ var torbutton_new_circuit; // in a component, not the XUL overlay. var torbutton_unique_pref_observer = { register() { - this.forced_ua = false; - m_tb_prefs.addObserver("extensions.torbutton", this); - m_tb_prefs.addObserver("browser.privatebrowsing.autostart", this); - m_tb_prefs.addObserver("javascript", this); + Services.prefs.addObserver("browser.privatebrowsing.autostart", this); }, unregister() { - m_tb_prefs.removeObserver("extensions.torbutton", this); - m_tb_prefs.removeObserver("browser.privatebrowsing.autostart", this); - m_tb_prefs.removeObserver("javascript", this); + Services.prefs.removeObserver("browser.privatebrowsing.autostart", this); }, // topic: what event occurred // subject: what nsIPrefBranch we're observing // data: which pref has been changed (relative to subject) observe(subject, topic, data) { - if (topic !== "nsPref:changed") { - return; - } - switch (data) { - case "browser.privatebrowsing.autostart": - torbutton_update_disk_prefs(); - break; - case "extensions.torbutton.use_nontor_proxy": - torbutton_use_nontor_proxy(); - break; + if ( + topic === "nsPref:changed" && + data === "browser.privatebrowsing.autostart" + ) { + torbutton_update_disk_prefs(); } }, }; @@ -113,62 +100,6 @@ var torbutton_new_circuit; }, }; - var torbutton_new_identity_observers = { - register() { - Services.obs.addObserver(this, "new-identity-requested"); - }, - - observe(aSubject, aTopic, aData) { - if (aTopic !== "new-identity-requested") { - return; - } - - // Clear the domain isolation state. - torbutton_log(3, "Clearing domain isolator"); - const domainIsolator = Cc["@torproject.org/domain-isolator;1"].getService( - Ci.nsISupports - ).wrappedJSObject; - domainIsolator.clearIsolation(); - - torbutton_log(3, "New Identity: Sending NEWNYM"); - // We only support TBB for newnym. - if ( - !m_tb_control_pass || - (!m_tb_control_ipc_file && !m_tb_control_port) - ) { - const warning = torbutton_get_property_string( - "torbutton.popup.no_newnym" - ); - torbutton_log( - 5, - "Torbutton cannot safely newnym. It does not have access to the Tor Control Port." - ); - window.alert(warning); - } else { - const warning = torbutton_get_property_string( - "torbutton.popup.no_newnym" - ); - torbutton_send_ctrl_cmd("SIGNAL NEWNYM") - .then(res => { - if (!res) { - torbutton_log( - 5, - "Torbutton was unable to request a new circuit from Tor" - ); - window.alert(warning); - } - }) - .catch(e => { - torbutton_log( - 5, - "Torbutton was unable to request a new circuit from Tor " + e - ); - window.alert(warning); - }); - } - }, - }; - // Bug 1506 P2-P4: This code sets some version variables that are irrelevant. // It does read out some important environment variables, though. It is // called once per browser window.. This might belong in a component. @@ -258,8 +189,6 @@ var torbutton_new_circuit; true ); - torbutton_new_identity_observers.register(); - torbutton_log(3, "init completed"); }; @@ -374,36 +303,6 @@ var torbutton_new_circuit; return response; } - // Bug 1506 P4: Needed for New IP Address - torbutton_new_circuit = function() { - let firstPartyDomain = getDomainForBrowser(gBrowser.selectedBrowser); - - let domainIsolator = Cc["@torproject.org/domain-isolator;1"].getService( - Ci.nsISupports - ).wrappedJSObject; - - domainIsolator.newCircuitForDomain(firstPartyDomain); - - gBrowser.reloadWithFlags(Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE); - }; - - /* Called when we switch the use_nontor_proxy pref in either direction. - * - * Enables/disables domain isolation and then does new identity - */ - function torbutton_use_nontor_proxy() { - let domainIsolator = Cc["@torproject.org/domain-isolator;1"].getService( - Ci.nsISupports - ).wrappedJSObject; - - if (m_tb_prefs.getBoolPref("extensions.torbutton.use_nontor_proxy")) { - // Disable domain isolation - domainIsolator.disableIsolation(); - } else { - domainIsolator.enableIsolation(); - } - } - async function torbutton_do_tor_check() { let checkSvc = Cc["@torproject.org/torbutton-torCheckService;1"].getService( Ci.nsISupports ===================================== toolkit/torbutton/components/domain-isolator.js deleted ===================================== @@ -1,312 +0,0 @@ -// # domain-isolator.js -// A component for TorBrowser that puts requests from different -// first party domains on separate tor circuits. - -// This file is written in call stack order (later functions -// call earlier functions). The code file can be processed -// with docco.js to provide clear documentation. - -// ### Abbreviations - -const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); -const { XPCOMUtils } = ChromeUtils.import( - "resource://gre/modules/XPCOMUtils.jsm" -); - -XPCOMUtils.defineLazyModuleGetters(this, { - ComponentUtils: "resource://gre/modules/ComponentUtils.jsm", -}); - -// Make the logger available. -let logger = Cc["@torproject.org/torbutton-logger;1"].getService(Ci.nsISupports) - .wrappedJSObject; - -// Import crypto object (FF 37+). -Cu.importGlobalProperties(["crypto"]); - -// ## mozilla namespace. -// Useful functionality for interacting with Mozilla services. -let mozilla = {}; - -// __mozilla.protocolProxyService__. -// Mozilla's protocol proxy service, useful for managing proxy connections made -// by the browser. -mozilla.protocolProxyService = Cc[ - "@mozilla.org/network/protocol-proxy-service;1" -].getService(Ci.nsIProtocolProxyService); - -// __mozilla.registerProxyChannelFilter(filterFunction, positionIndex)__. -// Registers a proxy channel filter with the Mozilla Protocol Proxy Service, -// which will help to decide the proxy to be used for a given channel. -// The filterFunction should expect two arguments, (aChannel, aProxy), -// where aProxy is the proxy or list of proxies that would be used by default -// for the given channel, and should return a new Proxy or list of Proxies. -mozilla.registerProxyChannelFilter = function(filterFunction, positionIndex) { - let proxyFilter = { - applyFilter(aChannel, aProxy, aCallback) { - aCallback.onProxyFilterResult(filterFunction(aChannel, aProxy)); - }, - }; - mozilla.protocolProxyService.registerChannelFilter( - proxyFilter, - positionIndex - ); -}; - -// ## tor functionality. -let tor = {}; - -// __tor.noncesForDomains__. -// A mutable map that records what nonce we are using for each domain. -tor.noncesForDomains = new Map(); - -// __tor.noncesForUserContextId__. -// A mutable map that records what nonce we are using for each tab container. -tor.noncesForUserContextId = new Map(); - -// __tor.isolationEabled__. -// A bool that controls if we use SOCKS auth for isolation or not. -tor.isolationEnabled = true; - -// __tor.unknownDirtySince__. -// Specifies when the current catch-all circuit was first used -tor.unknownDirtySince = Date.now(); - -tor.passwordForDomainAndUserContextId = function( - domain, - userContextId, - create -) { - // Check if we already have a nonce. If not, possibly create one for this - // domain and userContextId. - if (!tor.noncesForDomains.has(domain)) { - if (!create) { - return null; - } - tor.noncesForDomains.set(domain, tor.nonce()); - } - if (!tor.noncesForUserContextId.has(userContextId)) { - if (!create) { - return null; - } - tor.noncesForUserContextId.set(userContextId, tor.nonce()); - } - return ( - tor.noncesForDomains.get(domain) + - tor.noncesForUserContextId.get(userContextId) - ); -}; - -tor.usernameForDomainAndUserContextId = function(domain, userContextId) { - return `${domain}:${userContextId}`; -}; - -// __tor.socksProxyCredentials(originalProxy, domain, userContextId)__. -// Takes a proxyInfo object (originalProxy) and returns a new proxyInfo -// object with the same properties, except the username is set to the -// the domain and userContextId, and the password is a nonce. -tor.socksProxyCredentials = function(originalProxy, domain, userContextId) { - let proxy = originalProxy.QueryInterface(Ci.nsIProxyInfo); - let proxyUsername = tor.usernameForDomainAndUserContextId( - domain, - userContextId - ); - let proxyPassword = tor.passwordForDomainAndUserContextId( - domain, - userContextId, - true - ); - return mozilla.protocolProxyService.newProxyInfoWithAuth( - "socks", - proxy.host, - proxy.port, - proxyUsername, - proxyPassword, - "", // aProxyAuthorizationHeader - "", // aConnectionIsolationKey - proxy.flags, - proxy.failoverTimeout, - proxy.failoverProxy - ); -}; - -tor.nonce = function() { - // Generate a new 128 bit random tag. Strictly speaking both using a - // cryptographic entropy source and using 128 bits of entropy for the - // tag are likely overkill, as correct behavior only depends on how - // unlikely it is for there to be a collision. - let tag = new Uint8Array(16); - crypto.getRandomValues(tag); - - // Convert the tag to a hex string. - let tagStr = ""; - for (let i = 0; i < tag.length; i++) { - tagStr += (tag[i] >>> 4).toString(16); - tagStr += (tag[i] & 0x0f).toString(16); - } - - return tagStr; -}; - -tor.newCircuitForDomain = function(domain) { - // Re-generate the nonce for the domain. - if (domain === "") { - domain = "--unknown--"; - } - tor.noncesForDomains.set(domain, tor.nonce()); - logger.eclog( - 3, - `New domain isolation for ${domain}: ${tor.noncesForDomains.get(domain)}` - ); -}; - -tor.newCircuitForUserContextId = function(userContextId) { - // Re-generate the nonce for the context. - tor.noncesForUserContextId.set(userContextId, tor.nonce()); - logger.eclog( - 3, - `New container isolation for ${userContextId}: ${tor.noncesForUserContextId.get( - userContextId - )}` - ); -}; - -// __tor.clearIsolation()_. -// Clear the isolation state cache, forcing new circuits to be used for all -// subsequent requests. -tor.clearIsolation = function() { - // Per-domain and per contextId nonces are stored in maps, so simply clear them. - tor.noncesForDomains.clear(); - tor.noncesForUserContextId.clear(); - - // Force a rotation on the next catch-all circuit use by setting the creation - // time to the epoch. - tor.unknownDirtySince = 0; -}; - -// __tor.isolateCircuitsByDomain()__. -// For every HTTPChannel, replaces the default SOCKS proxy with one that authenticates -// to the SOCKS server (the tor client process) with a username (the first party domain -// and userContextId) and a nonce password. Tor provides a separate circuit for each -// username+password combination. -tor.isolateCircuitsByDomain = function() { - mozilla.registerProxyChannelFilter(function(aChannel, aProxy) { - if (!tor.isolationEnabled) { - return aProxy; - } - try { - let channel = aChannel.QueryInterface(Ci.nsIChannel), - firstPartyDomain = channel.loadInfo.originAttributes.firstPartyDomain, - userContextId = channel.loadInfo.originAttributes.userContextId; - if (firstPartyDomain === "") { - firstPartyDomain = "--unknown--"; - if (Date.now() - tor.unknownDirtySince > 1000 * 10 * 60) { - logger.eclog( - 3, - "tor catchall circuit has been dirty for over 10 minutes. Rotating." - ); - tor.newCircuitForDomain("--unknown--"); - tor.unknownDirtySince = Date.now(); - } - } - let replacementProxy = tor.socksProxyCredentials( - aProxy, - firstPartyDomain, - userContextId - ); - logger.eclog( - 3, - `tor SOCKS: ${channel.URI.spec} via - ${replacementProxy.username}:${replacementProxy.password}` - ); - return replacementProxy; - } catch (e) { - logger.eclog(4, `tor domain isolator error: ${e.message}`); - return null; - } - }, 0); -}; - -// ## XPCOM component construction. -// Module specific constants -const kMODULE_NAME = "TorBrowser Domain Isolator"; -const kMODULE_CONTRACTID = "@torproject.org/domain-isolator;1"; -const kMODULE_CID = Components.ID("e33fd6d4-270f-475f-a96f-ff3140279f68"); - -// DomainIsolator object. -function DomainIsolator() { - this.wrappedJSObject = this; -} - -// Firefox component requirements -DomainIsolator.prototype = { - QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver]), - classDescription: kMODULE_NAME, - classID: kMODULE_CID, - contractID: kMODULE_CONTRACTID, - observe(subject, topic, data) { - if (topic === "profile-after-change") { - logger.eclog(3, "domain isolator: set up isolating circuits by domain"); - - if (Services.prefs.getBoolPref("extensions.torbutton.use_nontor_proxy")) { - tor.isolationEnabled = false; - } - tor.isolateCircuitsByDomain(); - } - }, - - newCircuitForDomain(domain) { - tor.newCircuitForDomain(domain); - }, - - /** - * Return the stored SOCKS proxy username and password for the given domain - * and user context ID. - * - * @param {string} firstPartyDomain - The domain to lookup credentials for. - * @param {integer} userContextId - The ID for the user context. - * - * @return {{ username: string, password: string }?} - The SOCKS credentials, - * or null if none are found. - */ - getSocksProxyCredentials(firstPartyDomain, userContextId) { - if (firstPartyDomain == "") { - firstPartyDomain = "--unknown--"; - } - let proxyPassword = tor.passwordForDomainAndUserContextId( - firstPartyDomain, - userContextId, - // Do not create a new entry if it does not exist. - false - ); - if (!proxyPassword) { - return null; - } - return { - username: tor.usernameForDomainAndUserContextId( - firstPartyDomain, - userContextId - ), - password: proxyPassword, - }; - }, - - enableIsolation() { - tor.isolationEnabled = true; - }, - - disableIsolation() { - tor.isolationEnabled = false; - }, - - clearIsolation() { - tor.clearIsolation(); - }, - - wrappedJSObject: null, -}; - -// Assign factory to global object. -const NSGetFactory = XPCOMUtils.generateNSGetFactory - ? XPCOMUtils.generateNSGetFactory([DomainIsolator]) - : ComponentUtils.generateNSGetFactory([DomainIsolator]); ===================================== toolkit/torbutton/jar.mn ===================================== @@ -43,9 +43,5 @@ torbutton.jar: % component {f36d72c9-9718-4134-b550-e109638331d7} %components/torbutton-logger.js % contract @torproject.org/torbutton-logger;1 {f36d72c9-9718-4134-b550-e109638331d7} -% component {e33fd6d4-270f-475f-a96f-ff3140279f68} %components/domain-isolator.js -% contract @torproject.org/domain-isolator;1 {e33fd6d4-270f-475f-a96f-ff3140279f68} - % category profile-after-change StartupObserver @torproject.org/startup-observer;1 -% category profile-after-change DomainIsolator @torproject.org/domain-isolator;1 % category profile-after-change DragDropFilter @torproject.org/torbutton-dragDropFilter;1 ===================================== toolkit/torbutton/modules/utils.js ===================================== @@ -213,45 +213,6 @@ var unescapeTorString = function(str) { return _torControl._strUnescape(str); }; -var getFPDFromHost = hostname => { - try { - return Services.eTLD.getBaseDomainFromHost(hostname); - } catch (e) { - if ( - e.result == Cr.NS_ERROR_HOST_IS_IP_ADDRESS || - e.result == Cr.NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS - ) { - return hostname; - } - } - return null; -}; - -// Assuming this is called with gBrowser.selectedBrowser -var getDomainForBrowser = browser => { - let fpd = browser.contentPrincipal.originAttributes.firstPartyDomain; - // Bug 31562: For neterror or certerror, get the original URL from - // browser.currentURI and use it to calculate the firstPartyDomain. - let knownErrors = [ - "about:neterror", - "about:certerror", - "about:httpsonlyerror", - ]; - let documentURI = browser.documentURI; - if ( - documentURI && - documentURI.schemeIs("about") && - knownErrors.some(x => documentURI.spec.startsWith(x)) - ) { - let knownSchemes = ["http", "https", "ftp"]; - let currentURI = browser.currentURI; - if (currentURI && knownSchemes.some(x => currentURI.schemeIs(x))) { - fpd = getFPDFromHost(currentURI.host) || fpd; - } - } - return fpd; -}; - var m_tb_torlog = Cc["@torproject.org/torbutton-logger;1"].getService( Ci.nsISupports ).wrappedJSObject; @@ -310,7 +271,6 @@ let EXPORTED_SYMBOLS = [ "bindPrefAndInit", "getEnv", "getLocale", - "getDomainForBrowser", "getPrefValue", "observe", "showDialog", View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/2165eb… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/2165eb… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser] Pushed new tag tor-browser-102.12.0esr-12.5-1-build2
by richard (@richard) 08 Jun '23

08 Jun '23
richard pushed new tag tor-browser-102.12.0esr-12.5-1-build2 at The Tor Project / Applications / Tor Browser -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/tree/tor-brows… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser] Pushed new tag base-browser-102.12.0esr-12.5-1-build2
by richard (@richard) 08 Jun '23

08 Jun '23
richard pushed new tag base-browser-102.12.0esr-12.5-1-build2 at The Tor Project / Applications / Tor Browser -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/tree/base-brow… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-102.12.0esr-13.0-1] 24 commits: fixup! Bug 40597: Implement TorSettings module
by Pier Angelo Vendrame (@pierov) 08 Jun '23

08 Jun '23
Pier Angelo Vendrame pushed to branch tor-browser-102.12.0esr-13.0-1 at The Tor Project / Applications / Tor Browser Commits: 014f6414 by Pier Angelo Vendrame at 2023-06-01T22:03:04+02:00 fixup! Bug 40597: Implement TorSettings module Bug 41801: Fix handleProcessReady in TorSettings.init - - - - - f8d0eb2d by Pier Angelo Vendrame at 2023-06-05T18:52:53+02:00 fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#connection Bug 40552: Improve the description of the modal to provide a bridge manually. - - - - - fc0557ed by Pier Angelo Vendrame at 2023-06-05T18:52:54+02:00 fixup! Add TorStrings module for localization Bug 40552: New texts for the add a bridge manually modal - - - - - 423f239c by cypherpunks1 at 2023-06-05T11:07:29-08:00 fixup! Bug 8324: Prevent DNS proxy bypasses caused by Drag&amp;Drop Bug 41792: Allow dragging downloads from about:downloads and the download panel - - - - - e6cc145a by Pier Angelo Vendrame at 2023-06-05T19:46:15+00:00 fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#connection Bug 41802: Improve the regex on parseBridgeLine The previous version of the regex took for granted the bridge fingerprint was always available, but it is actually optional. So, parsing some bridge lines (e.g., Conjure) failed, and vanilla bridge was displayed instead of the actual transport. - - - - - ae4c538d by Henry Wilkes at 2023-06-05T19:47:48+00:00 Bug 41803 - Add some developer tools for working on tor-browser. - - - - - 7ece5b1d by John Lin at 2023-06-06T16:11:52+00:00 Bug 1832832 - protect encoder accesses in Java callbacks. r=media-playback-reviewers,alwu a=pascalc Differential Revision: https://phabricator.services.mozilla.com/D178564 - - - - - 968655c2 by Richard Pospesel at 2023-06-06T18:18:14+00:00 fixup! Bug 1832832 - protect encoder accesses in Java callbacks. r=media-playback-reviewers,alwu a=pascalc - MOZ_GUARDED_BY is just GUARDED_BY in esr 102 - - - - - 787ac906 by Dan Ballard at 2023-06-06T20:52:51+00:00 amend! Bug 40701: Add in pane security warning when downloading a file Bug 40701: Add security warning when downloading a file Shown in the downloads panel, about:downloads and places.xhtml. - - - - - 8b558745 by Dan Ballard at 2023-06-06T21:52:27+00:00 fixup! Bug 27476: Implement about:torconnect captive portal within Tor Browser Bug 41623: Update connection assist&#39;s iconography - - - - - 975fe2aa by Dan Ballard at 2023-06-06T21:52:27+00:00 fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#connection Bug 41623: Update connection assist&#39;s iconography - - - - - c2d6837d by Dan Ballard at 2023-06-06T21:52:27+00:00 fixup! fixup! Bug 27476: Implement about:torconnect captive portal within Tor Browser Bug 41623: Update connection assist&#39;s iconography - - - - - db0a953f by Henry Wilkes at 2023-06-07T14:09:59+01:00 fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#connection Bug 41734 - Add a connected label to the built-in bridge dialog. - - - - - e86c7eaf by Henry Wilkes at 2023-06-07T14:09:59+01:00 fixup! Add TorStrings module for localization Bug 41734 - Add a connected label to the built-in bridge dialog. - - - - - f4d9efee by Pier Angelo Vendrame at 2023-06-07T16:39:10+02:00 fixup! Bug 27476: Implement about:torconnect captive portal within Tor Browser Bug 41815: Wrong connect icons Swapped a couple of icons in about:torconnect, and split the offline CSS class from the connection assist/final error, since they now need a different icon. Also, removed the stroke property, since the new icons do not need it. - - - - - 6ed4a3c6 by Pier Angelo Vendrame at 2023-06-07T17:02:21+02:00 fixup! Bug 27476: Implement about:torconnect captive portal within Tor Browser Bug 41816: Workaround to fix the top navigation Using the top navigation does not always work as expected, because we pass a null connection state, instead of the actual state. We could start storing the state as a member, however further refactors are planned (see tor-browser#41710), so also directly asking the parent for the current state works as a quick&amp;dirty workaround. - - - - - 66f647aa by Henry Wilkes at 2023-06-07T19:02:40+00:00 fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#connection Bug 41618 - Remove connect bar, and swap internet and connection icons in tor connection preferences. - - - - - 02ddc74a by Henry Wilkes at 2023-06-07T19:02:40+00:00 fixup! Add TorStrings module for localization Bug 41618 - Remove connect bar, and swap internet and connection icons in tor connection preferences. - - - - - 01f3492c by Henry Wilkes at 2023-06-07T20:39:37+01:00 fixup! Bug 27476: Implement about:torconnect captive portal within Tor Browser Bug 41726 - Animate the connection icon. - - - - - 338b3317 by Henry Wilkes at 2023-06-07T19:58:06+00:00 fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#connection Bug 41810 - Add &quot;Connect&quot; button instead of the &quot;Submit&quot; and &quot;OK&quot; button in the bridge request dialog and the manual bridge dialog, respectively. - - - - - e5dc109a by Dan Ballard at 2023-06-07T20:49:28+00:00 fixup! fixup! Bug 2176: Rebrand Firefox to TorBrowser Bug 41809: restore onion glyph in locations outside location bar - - - - - 082bb93a by Dan Ballard at 2023-06-07T20:49:28+00:00 fixup! Bug 23247: Communicating security expectations for .onion Bug 41809: restore onion glyph in locations outside location bar - - - - - 1dd00f22 by Dan Ballard at 2023-06-07T20:49:28+00:00 fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#connection Bug 41809: restore onion glyph in locations outside location bar - - - - - 2165eb00 by Pier Angelo Vendrame at 2023-06-08T10:47:48+02:00 fixup! Add TorStrings module for localization Bug 41818: Remove YEC 2022 strings - - - - - 30 changed files: - browser/base/content/navigator-toolbox.inc.xhtml - browser/components/downloads/content/allDownloadsView.js - browser/components/downloads/content/contentAreaDownloadsView.js - browser/components/downloads/content/contentAreaDownloadsView.xhtml - browser/components/downloads/content/downloads.css - browser/components/downloads/content/downloads.js - browser/components/downloads/content/downloadsPanel.inc.xhtml - browser/components/places/content/places.css - browser/components/places/content/places.js - browser/components/places/content/places.xhtml - browser/components/torconnect/content/aboutTorConnect.css - browser/components/torconnect/content/aboutTorConnect.js - browser/components/torconnect/content/connection-failure.svg - browser/components/torconnect/content/connection-location.svg - − browser/components/torconnect/content/onion-slash-fillable.svg - + browser/components/torconnect/content/tor-connect-broken.svg - + browser/components/torconnect/content/tor-connect.svg - + browser/components/torconnect/content/tor-not-connected-to-connected-animated.svg - browser/components/torconnect/content/torConnectTitlebarStatus.css - browser/components/torconnect/content/torConnectTitlebarStatus.js - browser/components/torconnect/jar.mn - browser/components/torconnect/content/onion.svg → browser/components/torpreferences/content/bridge-qr-onion-mask.svg - browser/components/torpreferences/content/builtinBridgeDialog.jsm - browser/components/torpreferences/content/builtinBridgeDialog.xhtml - − browser/components/torpreferences/content/check.svg - browser/components/torpreferences/content/connectionPane.js - browser/components/torpreferences/content/connectionPane.xhtml - + browser/components/torpreferences/content/network-broken.svg - browser/components/torpreferences/content/network.svg - browser/components/torpreferences/content/provideBridgeDialog.jsm The diff was not included because it is too large. View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/282e5c… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/282e5c… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-102.12.0esr-12.5-1] fixup! Add TorStrings module for localization
by ma1 (@ma1) 08 Jun '23

08 Jun '23
ma1 pushed to branch tor-browser-102.12.0esr-12.5-1 at The Tor Project / Applications / Tor Browser Commits: 2165eb00 by Pier Angelo Vendrame at 2023-06-08T10:47:48+02:00 fixup! Add TorStrings module for localization Bug 41818: Remove YEC 2022 strings - - - - - 1 changed file: - toolkit/torbutton/chrome/locale/en-US/aboutTor.dtd Changes: ===================================== toolkit/torbutton/chrome/locale/en-US/aboutTor.dtd ===================================== @@ -38,22 +38,3 @@ <!ENTITY aboutTor.nightly.ready2.label "You’re ready to test the world’s most private browsing experience."> <!ENTITY aboutTor.nightly.bannerDescription "Tor Browser Nightly is an unstable version of Tor Browser you can use to preview new features, test their performance and provide feedback before release."> <!ENTITY aboutTor.nightly.bannerLink "Report a bug on the Tor Forum"> - -<!-- YEC 2022 campaign https://gitlab.torproject.org/tpo/applications/tor-browser/-/issues/41303 --> -<!-- LOCALIZATION NOTE (aboutTor.yec2022.powered_by_privacy): a header for a list of things which are powered by/enabled by/possible due to privacy (each item should have positive connotations/associations in the translated languages) --> -<!ENTITY aboutTor.yec2022.powered_by_privacy "POWERED BY PRIVACY:"> -<!-- LOCALIZATION NOTE (aboutTor.yec2022.resistance): resistance as in social/political resistance to opression, injustice, etc --> -<!ENTITY aboutTor.yec2022.resistance "RESISTANCE"> -<!-- LOCALIZATION NOTE (aboutTor.yec2022.change): change as in the process of social/political progress toward a better/more equitable society --> -<!ENTITY aboutTor.yec2022.change "CHANGE"> -<!-- LOCALIZATION NOTE (aboutTor.yec2022.freedom): freedom as in liberty, protection against exploition, imprisonment, etc --> -<!ENTITY aboutTor.yec2022.freedom "FREEDOM"> -<!-- LOCALIZATION NOTE (aboutTor.yec2022.donate_now): Label for a button directing user to donation page--> -<!ENTITY aboutTor.yec2022.donate_now "DONATE NOW"> -<!-- LOCALIZATION NOTE (aboutTor.yec2022.donation_matching): Please translate the 'Friends of Tor' phrase, but -also format it like the name of an organization in whichever way that is appropriate for your locale. - -Please keep the currency in USD. -Thank you! ---> -<!ENTITY aboutTor.yec2022.donation_matching "Your donation will be matched by Friends of Tor, up to $100,000."> View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/2165eb0… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/2165eb0… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser-update-responses][main] release: new version, 12.0.7
by boklm (@boklm) 08 Jun '23

08 Jun '23
boklm pushed to branch main at The Tor Project / Applications / Tor Browser update responses Commits: 99cc7315 by Nicolas Vigier at 2023-06-08T13:49:15+02:00 release: new version, 12.0.7 - - - - - 30 changed files: - update_3/release/.htaccess - − update_3/release/12.0.4-12.0.6-linux32-ALL.xml - − update_3/release/12.0.4-12.0.6-linux64-ALL.xml - − update_3/release/12.0.4-12.0.6-macos-ALL.xml - − update_3/release/12.0.4-12.0.6-win32-ALL.xml - − update_3/release/12.0.4-12.0.6-win64-ALL.xml - + update_3/release/12.0.4-12.0.7-linux32-ALL.xml - + update_3/release/12.0.4-12.0.7-linux64-ALL.xml - + update_3/release/12.0.4-12.0.7-macos-ALL.xml - + update_3/release/12.0.4-12.0.7-win32-ALL.xml - + update_3/release/12.0.4-12.0.7-win64-ALL.xml - − update_3/release/12.0.5-12.0.6-linux32-ALL.xml - − update_3/release/12.0.5-12.0.6-linux64-ALL.xml - − update_3/release/12.0.5-12.0.6-macos-ALL.xml - − update_3/release/12.0.5-12.0.6-win32-ALL.xml - − update_3/release/12.0.5-12.0.6-win64-ALL.xml - + update_3/release/12.0.5-12.0.7-linux32-ALL.xml - + update_3/release/12.0.5-12.0.7-linux64-ALL.xml - + update_3/release/12.0.5-12.0.7-macos-ALL.xml - + update_3/release/12.0.5-12.0.7-win32-ALL.xml - + update_3/release/12.0.5-12.0.7-win64-ALL.xml - + update_3/release/12.0.6-12.0.7-linux32-ALL.xml - + update_3/release/12.0.6-12.0.7-linux64-ALL.xml - + update_3/release/12.0.6-12.0.7-macos-ALL.xml - + update_3/release/12.0.6-12.0.7-win32-ALL.xml - + update_3/release/12.0.6-12.0.7-win64-ALL.xml - − update_3/release/12.0.6-linux32-ALL.xml - − update_3/release/12.0.6-linux64-ALL.xml - − update_3/release/12.0.6-macos-ALL.xml - − update_3/release/12.0.6-win32-ALL.xml The diff was not included because it is too large. View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-update-responses… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-update-responses… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser-build][main] Bug 40874: Include the commit information in GeckoView
by ma1 (@ma1) 08 Jun '23

08 Jun '23
ma1 pushed to branch main at The Tor Project / Applications / tor-browser-build Commits: f4227713 by Pier Angelo Vendrame at 2023-06-07T19:10:03+02:00 Bug 40874: Include the commit information in GeckoView Add the commit hash and GitLab URL to the mozconfig to make them appear in about:buildconfig on Android, too. - - - - - 2 changed files: - projects/geckoview/build - projects/geckoview/config Changes: ===================================== projects/geckoview/build ===================================== @@ -41,7 +41,13 @@ export PATH="/var/tmp/dist/rust/bin:/var/tmp/dist/cbindgen:/var/tmp/dist/nasm/bi tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz cd /var/tmp/build/[% project %]-[% c("version") %] -ln -s mozconfig-[% c("var/osname") %] .mozconfig +cat > .mozconfig << 'MOZCONFIG_EOF' +. $topsrcdir/mozconfig-[% c("var/osname") %] + +export MOZ_INCLUDE_SOURCE_INFO=1 +export MOZ_SOURCE_REPO="[% c('var/gitlab_project') %]" +export MOZ_SOURCE_CHANGESET=[% c("var/git_commit") %] +MOZCONFIG_EOF eval $(perl $rootdir/get-moz-build-date [% c("var/copyright_year") %] [% c("var/torbrowser_version") %]) if [ -z $MOZ_BUILD_DATE ] ===================================== projects/geckoview/config ===================================== @@ -15,6 +15,8 @@ var: browser_branch: 12.5-1 browser_build: 3 copyright_year: '[% exec("git show -s --format=%ci").remove("-.*") %]' + gitlab_project: https://gitlab.torproject.org/tpo/applications/tor-browser + git_commit: '[% exec("git rev-parse HEAD") %]' deps: - build-essential - unzip View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/f… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/f… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-102.12.0esr-12.5-1] 3 commits: fixup! fixup! Bug 2176: Rebrand Firefox to TorBrowser
by richard (@richard) 07 Jun '23

07 Jun '23
richard pushed to branch tor-browser-102.12.0esr-12.5-1 at The Tor Project / Applications / Tor Browser Commits: e5dc109a by Dan Ballard at 2023-06-07T20:49:28+00:00 fixup! fixup! Bug 2176: Rebrand Firefox to TorBrowser Bug 41809: restore onion glyph in locations outside location bar - - - - - 082bb93a by Dan Ballard at 2023-06-07T20:49:28+00:00 fixup! Bug 23247: Communicating security expectations for .onion Bug 41809: restore onion glyph in locations outside location bar - - - - - 1dd00f22 by Dan Ballard at 2023-06-07T20:49:28+00:00 fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#connection Bug 41809: restore onion glyph in locations outside location bar - - - - - 6 changed files: - + browser/components/torpreferences/content/bridge-qr-onion-mask.svg - browser/components/torpreferences/content/torPreferences.css - browser/components/torpreferences/jar.mn - browser/themes/shared/identity-block/identity-block.css - browser/themes/shared/identity-block/onion.svg → browser/themes/shared/identity-block/onion-site.svg - browser/themes/shared/jar.inc.mn Changes: ===================================== browser/components/torpreferences/content/bridge-qr-onion-mask.svg ===================================== @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg viewBox="0 0 16 16" width="16" height="16" xmlns="http://www.w3.org/2000/svg"> + <path d="M 8 0.5 C 3.85786 0.5 0.5 3.85786 0.5 8 C 0.5 12.1421 3.85786 15.5 8 15.5 C 12.1421 15.5 15.5 12.1421 15.5 8 C 15.5 3.85786 12.1421 0.5 8 0.5 z M 8 1.671875 C 11.4949 1.671875 14.328125 4.50507 14.328125 8 C 14.328125 11.4949 11.4949 14.328125 8 14.328125 L 8 13.25 C 10.89951 13.25 13.25 10.89951 13.25 8 C 13.25 5.10051 10.89951 2.75 8 2.75 L 8 1.671875 z M 8 3.921875 C 10.25231 3.921875 12.078125 5.74772 12.078125 8 C 12.078125 10.25231 10.25231 12.078125 8 12.078125 L 8 11 C 9.65686 11 11 9.65686 11 8 C 11 6.34315 9.65686 5 8 5 L 8 3.921875 z M 8 6.171875 C 9.00965 6.171875 9.828125 6.99036 9.828125 8 C 9.828125 9.00965 9.00965 9.828125 8 9.828125 L 8 6.171875 z " clip-rule="evenodd" fill-rule="evenodd" fill="#000000"/> +</svg> ===================================== browser/components/torpreferences/content/torPreferences.css ===================================== @@ -291,7 +291,7 @@ html:dir(rtl) input[type="checkbox"].toggle-button::before { top: calc(50% - 8px); inset-inline-start: calc(50% - 8px); - mask: url("chrome://browser/skin/onion.svg"); + mask: url("chrome://browser/content/torpreferences/bridge-qr-onion-mask.svg"); mask-repeat: no-repeat; mask-size: 16px; background: var(--qr-one); @@ -436,7 +436,7 @@ dialog#torPreferences-requestBridge-dialog > hbox { height: 38px; top: calc(50% - 19px); left: calc(50% - 19px); - mask: url("chrome://browser/skin/onion.svg"); + mask: url("chrome://browser/content/torpreferences/bridge-qr-onion-mask.svg"); mask-repeat: no-repeat; mask-size: 38px; background: var(--qr-one); ===================================== browser/components/torpreferences/jar.mn ===================================== @@ -17,6 +17,7 @@ browser.jar: content/browser/torpreferences/connectionPane.js (content/connectionPane.js) content/browser/torpreferences/connectionPane.xhtml (content/connectionPane.xhtml) content/browser/torpreferences/torPreferences.css (content/torPreferences.css) + content/browser/torpreferences/bridge-qr-onion-mask.svg (content/bridge-qr-onion-mask.svg) content/browser/torpreferences/bridgemoji/bridge-emojis.json (content/bridgemoji/bridge-emojis.json) content/browser/torpreferences/bridgemoji/annotations.json (content/bridgemoji/annotations.json) content/browser/torpreferences/bridgemoji/svgs/ (content/bridgemoji/svgs/*.svg) ===================================== browser/themes/shared/identity-block/identity-block.css ===================================== @@ -196,7 +196,7 @@ #identity-box[pageproxystate="valid"].onionUnknownIdentity #identity-icon, #identity-box[pageproxystate="valid"].onionVerifiedDomain #identity-icon, #identity-box[pageproxystate="valid"].onionMixedActiveBlocked #identity-icon { - list-style-image: url(chrome://browser/skin/onion.svg); + list-style-image: url(chrome://browser/skin/onion-site.svg); visibility: visible; } ===================================== browser/themes/shared/identity-block/onion.svg → browser/themes/shared/identity-block/onion-site.svg ===================================== ===================================== browser/themes/shared/jar.inc.mn ===================================== @@ -71,7 +71,7 @@ skin/classic/browser/downloads/progressmeter.css (../shared/downloads/progressmeter.css) skin/classic/browser/drm-icon.svg (../shared/drm-icon.svg) skin/classic/browser/identity-block/identity-block.css (../shared/identity-block/identity-block.css) - skin/classic/browser/onion.svg (../shared/identity-block/onion.svg) + skin/classic/browser/onion-site.svg (../shared/identity-block/onion-site.svg) skin/classic/browser/onion-slash.svg (../shared/identity-block/onion-slash.svg) skin/classic/browser/onion-warning.svg (../shared/identity-block/onion-warning.svg) skin/classic/browser/permissions.svg (../shared/identity-block/permissions.svg) View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/338b33… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/338b33… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-102.12.0esr-12.5-1] fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in...
by ma1 (@ma1) 07 Jun '23

07 Jun '23
ma1 pushed to branch tor-browser-102.12.0esr-12.5-1 at The Tor Project / Applications / Tor Browser Commits: 338b3317 by Henry Wilkes at 2023-06-07T19:58:06+00:00 fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#connection Bug 41810 - Add &quot;Connect&quot; button instead of the &quot;Submit&quot; and &quot;OK&quot; button in the bridge request dialog and the manual bridge dialog, respectively. - - - - - 4 changed files: - browser/components/torpreferences/content/builtinBridgeDialog.jsm - browser/components/torpreferences/content/connectionPane.js - browser/components/torpreferences/content/provideBridgeDialog.jsm - browser/components/torpreferences/content/requestBridgeDialog.jsm Changes: ===================================== browser/components/torpreferences/content/builtinBridgeDialog.jsm ===================================== @@ -36,9 +36,6 @@ class BuiltinBridgeDialog { "#torPreferences-builtinBridge-description" ).textContent = TorStrings.settings.builtinBridgeDescription2; - this._acceptButton = dialog.getButton("accept"); - this.onTorStateChange(); - const radioGroup = dialog.querySelector( "#torPreferences-builtinBridge-typeSelection" ); @@ -102,20 +99,26 @@ class BuiltinBridgeDialog { dialog.style.minWidth = "0"; dialog.style.minHeight = "0"; + this._acceptButton = dialog.getButton("accept"); + Services.obs.addObserver(this, TorConnectTopics.StateChange); + this.onAcceptStateChange(); } - onTorStateChange() { - if (TorConnect.canBeginBootstrap) { - this._acceptButton.setAttribute( - "label", - TorStrings.settings.bridgeButtonConnect - ); - } else { - this._acceptButton.setAttribute( - "label", - TorStrings.settings.bridgeButtonAccept - ); + onAcceptStateChange() { + this._acceptButton.setAttribute( + "label", + TorConnect.canBeginBootstrap + ? TorStrings.settings.bridgeButtonConnect + : TorStrings.settings.bridgeButtonAccept + ); + } + + observe(subject, topic, data) { + switch (topic) { + case TorConnectTopics.StateChange: + this.onAcceptStateChange(); + break; } } @@ -126,16 +129,8 @@ class BuiltinBridgeDialog { }, 0); } - observe(subject, topic, data) { - switch (topic) { - case TorConnectTopics.StateChange: - this.onTorStateChange(); - break; - } - } - close() { - // unregister our observer topics + // Unregister our observer topics. Services.obs.removeObserver(this, TorConnectTopics.StateChange); } ===================================== browser/components/torpreferences/content/connectionPane.js ===================================== @@ -1047,9 +1047,47 @@ const gConnectionPane = (function() { }); }, + /** + * Save and apply settings, then optionally open about:torconnect and start + * bootstrapping. + * + * @param {boolean} connect - Whether to open about:torconnect and start + * bootstrapping if possible. + */ + async saveBridgeSettings(connect) { + TorSettings.saveToPrefs(); + // FIXME: This can throw if the user adds a bridge manually with invalid + // content. Should be addressed by tor-browser#40552. + await TorSettings.applySettings(); + + this._populateBridgeCards(); + + if (!connect) { + return; + } + + // The bridge dialog button is "connect" when Tor is not bootstrapped, + // so do the connect. + + // Start Bootstrapping, which should use the configured bridges. + // NOTE: We do this regardless of any previous TorConnect Error. + if (TorConnect.canBeginBootstrap) { + TorConnect.beginBootstrap(); + } + // Open "about:torconnect". + // FIXME: If there has been a previous bootstrapping error then + // "about:torconnect" will be trying to get the user to use + // AutoBootstrapping. It is not set up to handle a forced direct + // entry to plain Bootstrapping from this dialog so the UI will not + // be aligned. In particular the + // AboutTorConnect.uiState.bootstrapCause will be aligned to + // whatever was shown previously in "about:torconnect" instead. + TorConnect.openTorConnect(); + }, + onAddBuiltinBridge() { const builtinBridgeDialog = new BuiltinBridgeDialog( - async (bridgeType, connect) => { + (bridgeType, connect) => { if (!bridgeType) { TorSettings.bridges.enabled = false; TorSettings.bridges.builtin_type = ""; @@ -1058,29 +1096,8 @@ const gConnectionPane = (function() { TorSettings.bridges.source = TorBridgeSource.BuiltIn; TorSettings.bridges.builtin_type = bridgeType; } - TorSettings.saveToPrefs(); - await TorSettings.applySettings(); - - this._populateBridgeCards(); - // The bridge dialog button is "connect" when Tor is not bootstrapped, - // so do the connect. - if (connect) { - // Start Bootstrapping, which should use the configured bridges. - // NOTE: We do this regardless of any previous TorConnect Error. - if (TorConnect.canBeginBootstrap) { - TorConnect.beginBootstrap(); - } - // Open "about:torconnect". - // FIXME: If there has been a previous bootstrapping error then - // "about:torconnect" will be trying to get the user to use - // AutoBootstrapping. It is not set up to handle a forced direct - // entry to plain Bootstrapping from this dialog so the UI will not - // be aligned. In particular the - // AboutTorConnect.uiState.bootstrapCause will be aligned to - // whatever was shown previously in "about:torconnect" instead. - TorConnect.openTorConnect(); - } + this.saveBridgeSettings(connect); } ); builtinBridgeDialog.openDialog(gSubDialog); @@ -1088,37 +1105,38 @@ const gConnectionPane = (function() { // called when the request bridge button is activated onRequestBridge() { - const requestBridgeDialog = new RequestBridgeDialog(aBridges => { - if (aBridges.length) { + const requestBridgeDialog = new RequestBridgeDialog( + (aBridges, connect) => { + if (!aBridges.length) { + return; + } const bridgeStrings = aBridges.join("\n"); TorSettings.bridges.enabled = true; TorSettings.bridges.source = TorBridgeSource.BridgeDB; TorSettings.bridges.bridge_strings = bridgeStrings; - TorSettings.saveToPrefs(); - TorSettings.applySettings().then(result => { - this._populateBridgeCards(); - }); + + this.saveBridgeSettings(connect); } - }); + ); requestBridgeDialog.openDialog(gSubDialog); }, onAddBridgeManually() { - const provideBridgeDialog = new ProvideBridgeDialog(aBridgeString => { - if (aBridgeString.length) { - TorSettings.bridges.enabled = true; - TorSettings.bridges.source = TorBridgeSource.UserProvided; - TorSettings.bridges.bridge_strings = aBridgeString; - } else { - TorSettings.bridges.enabled = false; - TorSettings.bridges.source = TorBridgeSource.Invalid; - TorSettings.bridges.bridge_strings = ""; + const provideBridgeDialog = new ProvideBridgeDialog( + (aBridgeString, connect) => { + if (aBridgeString) { + TorSettings.bridges.enabled = true; + TorSettings.bridges.source = TorBridgeSource.UserProvided; + TorSettings.bridges.bridge_strings = aBridgeString; + } else { + TorSettings.bridges.enabled = false; + TorSettings.bridges.source = TorBridgeSource.Invalid; + TorSettings.bridges.bridge_strings = ""; + } + + this.saveBridgeSettings(connect); } - TorSettings.saveToPrefs(); - TorSettings.applySettings().then(result => { - this._populateBridgeCards(); - }); - }); + ); provideBridgeDialog.openDialog(gSubDialog); }, ===================================== browser/components/torpreferences/content/provideBridgeDialog.jsm ===================================== @@ -2,17 +2,24 @@ var EXPORTED_SYMBOLS = ["ProvideBridgeDialog"]; +const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); + const { TorStrings } = ChromeUtils.import("resource:///modules/TorStrings.jsm"); const { TorSettings, TorBridgeSource } = ChromeUtils.import( "resource:///modules/TorSettings.jsm" ); +const { TorConnect, TorConnectTopics } = ChromeUtils.import( + "resource:///modules/TorConnect.jsm" +); + class ProvideBridgeDialog { constructor(onSubmit) { this.onSubmit = onSubmit; this._dialog = null; this._textarea = null; + this._acceptButton = null; } static get selectors() { @@ -49,14 +56,43 @@ class ProvideBridgeDialog { "placeholder", TorStrings.settings.provideBridgePlaceholder ); + this._textarea.addEventListener("input", () => { + this.onAcceptStateChange(); + }); if (TorSettings.bridges.source == TorBridgeSource.UserProvided) { this._textarea.value = TorSettings.bridges.bridge_strings.join("\n"); } this._dialog.addEventListener("dialogaccept", e => { - this.onSubmit(this._textarea.value); + let value = this._textarea.value; + if (!value.trim()) { + value = null; + } + this.onSubmit(value, value && TorConnect.canBeginBootstrap); }); this._dialog.addEventListener("dialoghelp", openHelp); + + this._acceptButton = this._dialog.getButton("accept"); + + Services.obs.addObserver(this, TorConnectTopics.StateChange); + this.onAcceptStateChange(); + } + + onAcceptStateChange() { + this._acceptButton.setAttribute( + "label", + this._textarea.value.trim() && TorConnect.canBeginBootstrap + ? TorStrings.settings.bridgeButtonConnect + : TorStrings.settings.bridgeButtonAccept + ); + } + + observe(subject, topic, data) { + switch (topic) { + case TorConnectTopics.StateChange: + this.onAcceptStateChange(); + break; + } } init(window, aDialog) { @@ -66,10 +102,20 @@ class ProvideBridgeDialog { }, 0); } + close() { + // Unregister our observer topics. + Services.obs.removeObserver(this, TorConnectTopics.StateChange); + } + openDialog(gSubDialog) { gSubDialog.open( "chrome://browser/content/torpreferences/provideBridgeDialog.xhtml", - { features: "resizable=yes" }, + { + features: "resizable=yes", + closingCallback: () => { + this.close(); + }, + }, this ); } ===================================== browser/components/torpreferences/content/requestBridgeDialog.jsm ===================================== @@ -2,9 +2,15 @@ var EXPORTED_SYMBOLS = ["RequestBridgeDialog"]; +const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); + const { BridgeDB } = ChromeUtils.import("resource:///modules/BridgeDB.jsm"); const { TorStrings } = ChromeUtils.import("resource:///modules/TorStrings.jsm"); +const { TorConnect, TorConnectTopics } = ChromeUtils.import( + "resource:///modules/TorConnect.jsm" +); + class RequestBridgeDialog { constructor(onSubmit) { this.onSubmit = onSubmit; @@ -20,8 +26,6 @@ class RequestBridgeDialog { static get selectors() { return { - submitButton: - "accept" /* not really a selector but a key for dialog's getButton */, dialogHeader: "h3#torPreferences-requestBridge-header", captchaImage: "image#torPreferences-requestBridge-captchaImage", captchaEntryTextbox: "input#torPreferences-requestBridge-captchaTextbox", @@ -57,8 +61,7 @@ class RequestBridgeDialog { } }); - this._submitButton = this._dialog.getButton(selectors.submitButton); - this._submitButton.setAttribute("label", TorStrings.settings.submitCaptcha); + this._submitButton = this._dialog.getButton("accept"); this._submitButton.disabled = true; this._dialog.addEventListener("dialogaccept", e => { e.preventDefault(); @@ -110,7 +113,25 @@ class RequestBridgeDialog { TorStrings.settings.incorrectCaptcha ); - return true; + Services.obs.addObserver(this, TorConnectTopics.StateChange); + this.onAcceptStateChange(); + } + + onAcceptStateChange() { + this._submitButton.setAttribute( + "label", + TorConnect.canBeginBootstrap + ? TorStrings.settings.bridgeButtonConnect + : TorStrings.settings.submitCaptcha + ); + } + + observe(subject, topic, data) { + switch (topic) { + case TorConnectTopics.StateChange: + this.onAcceptStateChange(); + break; + } } _setcaptchaImage(uri) { @@ -142,6 +163,8 @@ class RequestBridgeDialog { close() { BridgeDB.close(); + // Unregister our observer topics. + Services.obs.removeObserver(this, TorConnectTopics.StateChange); } /* @@ -161,7 +184,7 @@ class RequestBridgeDialog { BridgeDB.submitCaptchaGuess(captchaText) .then(aBridges => { if (aBridges) { - this.onSubmit(aBridges); + this.onSubmit(aBridges, TorConnect.canBeginBootstrap); this._submitButton.disabled = false; // This was successful, but use cancelDialog() to close, since // we intercept the `dialogaccept` event. View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/338b331… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/338b331… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-102.12.0esr-12.5-1] fixup! Bug 27476: Implement about:torconnect captive portal within Tor Browser
by richard (@richard) 07 Jun '23

07 Jun '23
richard pushed to branch tor-browser-102.12.0esr-12.5-1 at The Tor Project / Applications / Tor Browser Commits: 01f3492c by Henry Wilkes at 2023-06-07T20:39:37+01:00 fixup! Bug 27476: Implement about:torconnect captive portal within Tor Browser Bug 41726 - Animate the connection icon. - - - - - 5 changed files: - browser/base/content/navigator-toolbox.inc.xhtml - + browser/components/torconnect/content/tor-not-connected-to-connected-animated.svg - browser/components/torconnect/content/torConnectTitlebarStatus.css - browser/components/torconnect/content/torConnectTitlebarStatus.js - browser/components/torconnect/jar.mn Changes: ===================================== browser/base/content/navigator-toolbox.inc.xhtml ===================================== @@ -94,7 +94,9 @@ <hbox class="private-browsing-indicator"/> <html:div id="tor-connect-titlebar-status" role="status"> - <html:img alt="" id="tor-connect-titlebar-status-icon" /> + <html:img id="tor-connect-titlebar-status-icon" + alt="" + src="chrome://browser/content/torconnect/tor-not-connected-to-connected-animated.svg" /> <html:span id="tor-connect-titlebar-status-label"></html:span> </html:div> ===================================== browser/components/torconnect/content/tor-not-connected-to-connected-animated.svg ===================================== @@ -0,0 +1,27 @@ +<svg width="176" height="16" viewBox="0 0 176 16" xmlns="http://www.w3.org/2000/svg"> + <path d="M 3.32745,2.13475 C 4.60904,1.11241 6.23317,0.50133 8,0.50133 c 4.1414,0 7.4987,3.35732 7.4987,7.49867 0,1.7671 -0.6111,3.3911 -1.6335,4.6725 L 13.0315,11.8388 C 13.8448,10.7747 14.328,9.4444 14.328,8 14.328,4.504 11.496,1.67199 8,1.67199 c -1.4438,0 -2.77436,0.48303 -3.83895,1.29636 z" fill="context-fill" /> + <path d="M 6.56042,5.36771 7.44805,6.25534 C 7.6222,6.20033 7.80763,6.17067 8,6.17067 c 1.0107,0 1.8294,0.81867 1.8294,1.82933 0,0.1924 -0.0297,0.3779 -0.0847,0.552 l 0.8877,0.8877 C 10.8667,9.0122 11,8.5216 11,8 11,6.34399 9.656,5 8,5 7.47846,5 6.98784,5.13332 6.56042,5.36771 Z" fill="context-fill" /> + <path d="M 12.2609,11.0682 C 12.8837,10.2055 13.2507,9.1457 13.2507,8 c 0,-2.89867 -2.352,-5.25067 -5.25073,-5.25067 -1.14511,0 -2.20491,0.36706 -3.06809,0.98988 l 0.84285,0.84286 c 0.6397,-0.41709 1.40395,-0.6594 2.22524,-0.6594 2.25333,0 4.07733,1.82399 4.07733,4.07733 0,0.8206 -0.2425,1.585 -0.6598,2.2248 z" fill="context-fill" /> + <path fill-rule="evenodd" d="M 14.0906,14.7921 1.15536,1.85684 c -0.26058,-0.26058 -0.68307,-0.26058 -0.94365,0 -0.26059,0.26059 -0.26059,0.68308 -1e-5,0.94366 L 1.56286,4.15166 C 0.88882,5.2767 0.50135,6.59311 0.50135,8 c 0,3.5867 2.51734,6.584 5.88267,7.3227 0.352,0.0773 0.70932,0.1306 1.07733,0.1546 v -5.4272 l 1.07735,1.0774 v 4.3498 C 8.9067,15.4533 9.264,15.4 9.616,15.3227 c 0.7992,-0.1755 1.5506,-0.4783 2.2318,-0.8861 l 1.2991,1.2991 c 0.2606,0.2606 0.6831,0.2606 0.9437,0 0.2606,-0.2606 0.2606,-0.683 0,-0.9436 z m -3.1017,-1.2144 -0.804,-0.804 c -0.1841,0.0843 -0.374,0.1582 -0.5689,0.221 v -0.7899 1.9125 c 0.4826,-0.1267 0.9427,-0.309 1.3729,-0.5396 z M 5.02472,7.6135 4.12828,6.71707 C 3.99487,7.1204 3.92268,7.5517 3.92268,8 c 0,1.6773 1.01333,3.12 2.46133,3.744 v 1.2507 C 4.27468,12.3147 2.74934,10.336 2.74934,8 c 0,-0.78002 0.17031,-1.52045 0.47575,-2.18611 L 2.42112,5.00992 C 1.94312,5.90024 1.67202,6.91834 1.67202,8 c 0,2.9387 2,5.4053 4.712,6.1173 V 10.528 C 5.55202,9.9947 5.00002,9.0613 5.00002,8 c 0,-0.1309 0.0084,-0.2599 0.0247,-0.3865 z" fill="context-fill" /> + <path d="m 26.5604,5.36771 0.8877,0.88763 C 27.6222,6.20033 27.8076,6.17067 28,6.17067 c 1.0107,0 1.8294,0.81867 1.8294,1.82933 0,0.1924 -0.0297,0.3779 -0.0847,0.552 l 0.8877,0.8877 C 30.8667,9.0122 31,8.5216 31,8 31,6.34399 29.656,5 28,5 27.4785,5 26.9878,5.13332 26.5604,5.36771 Z" fill="context-fill" /> + <path d="M 32.2609,11.0682 C 32.8837,10.2055 33.2507,9.1457 33.2507,8 33.2507,5.10133 30.8987,2.74933 28,2.74933 c -1.1451,0 -2.2049,0.36706 -3.0681,0.98988 l 0.8428,0.84286 c 0.6397,-0.41709 1.404,-0.6594 2.2253,-0.6594 2.2533,0 4.0773,1.82399 4.0773,4.07733 0,0.8206 -0.2425,1.585 -0.6598,2.2248 z" fill="context-fill" /> + <path fill-rule="evenodd" d="M 25.1667,1.05506 C 26.0409,0.69808 26.9975,0.50133 28,0.50133 c 4.1414,0 7.4987,3.35732 7.4987,7.49867 0,1.7671 -0.6111,3.3911 -1.6335,4.6725 L 33.0315,11.8388 C 33.8448,10.7747 34.328,9.4444 34.328,8 34.328,4.504 31.496,1.67199 28,1.67199 c -1.4438,0 -2.7744,0.48303 -3.8389,1.29636 L 24.1597,2.96703 c -0.3568,0.27263 -0.6838,0.58239 -0.9752,0.9235 l 0.0014,0.00134 C 22.2419,4.99718 21.672,6.43179 21.672,8 c 0,1.7592 0.7167,3.3492 1.8739,4.4949 0.473,0.4681 1.0196,0.862 1.6208,1.1628 0.385,0.1928 0.7924,0.3481 1.2173,0.4596 V 10.528 C 25.552,9.9947 25,9.0613 25,8 25,7.8685 25.0085,7.7389 25.0249,7.6118 L 24.1287,6.71563 C 23.995,7.11937 23.9227,7.5512 23.9227,8 c 0,1.6773 1.0133,3.12 2.4613,3.744 v 1.2507 C 24.2747,12.3147 22.7493,10.336 22.7493,8 c 0,-0.78053 0.1706,-1.52142 0.4764,-2.18742 L 22.8632,5.45009 c -0.2597,-0.2597 -0.2597,-0.68075 0,-0.94045 0.2597,-0.2597 0.6808,-0.2597 0.9405,0 L 34.0943,14.8002 c 0.2597,0.2597 0.2597,0.6808 0,0.9405 -0.2597,0.2597 -0.6808,0.2597 -0.9405,0 L 31.849,14.4359 c -0.6815,0.4082 -1.4333,0.7112 -2.233,0.8868 -0.352,0.0773 -0.7093,0.1306 -1.0773,0.1546 v -4.3518 l -1.0774,-1.0773 v 5.4291 C 27.0933,15.4533 26.736,15.4 26.384,15.3227 24.9758,15.0136 23.7161,14.309 22.7272,13.3313 21.3519,11.9723 20.5,10.0852 20.5,7.9987 20.5,4.85935 22.4292,2.17055 25.1667,1.05319 Z M 29.616,14.1173 v -1.9144 0.7918 c 0.1953,-0.063 0.3857,-0.1371 0.5702,-0.2216 l 0.804,0.804 c -0.4306,0.2309 -0.8911,0.4134 -1.3742,0.5402 z" fill="context-fill" /> + <path d="m 46.5604,5.36771 0.8877,0.88763 C 47.6222,6.20033 47.8076,6.17067 48,6.17067 c 1.0107,0 1.8294,0.81867 1.8294,1.82933 0,0.1924 -0.0297,0.3779 -0.0847,0.552 l 0.8877,0.8877 C 50.8667,9.0122 51,8.5216 51,8 51,6.34399 49.656,5 48,5 47.4785,5 46.9878,5.13332 46.5604,5.36771 Z" fill="context-fill" /> + <path fill-rule="evenodd" d="m 48,0.50133 c -1.0025,0 -1.9591,0.19675 -2.8333,0.55373 V 1.05319 C 42.4292,2.17055 40.5,4.85935 40.5,7.9987 c 0,2.0865 0.8519,3.9736 2.2272,5.3326 0.9889,0.9777 2.2486,1.6823 3.6568,1.9914 0.352,0.0773 0.7093,0.1306 1.0773,0.1546 v -5.4291 l 1.0774,1.0773 v 4.3518 c 0.368,-0.024 0.7253,-0.0773 1.0773,-0.1546 0.7997,-0.1756 1.5515,-0.4786 2.233,-0.8868 l 1.3048,1.3048 c 0.2597,0.2597 0.6808,0.2597 0.9405,0 0.2597,-0.2597 0.2597,-0.6808 0,-0.9405 L 45.5277,6.23361 c -0.2597,-0.2597 -0.6808,-0.2597 -0.9405,0 -0.2597,0.2597 -0.2597,0.68075 0,0.94045 L 45.0249,7.6118 C 45.0085,7.7389 45,7.8684 45,8 c 0,1.0613 0.552,1.9947 1.384,2.528 v 1.2164 c -1.4476,-0.6242 -2.4607,-2.0667 -2.4607,-3.7437 0,-2.25337 1.824,-4.07736 4.0774,-4.07736 0.0919,0 0.1832,0.00304 0.2736,0.00902 2.1252,0.1409 3.803,1.90649 3.803,4.06764 0,0.8206 -0.2425,1.585 -0.6598,2.2248 l 0.8434,0.8434 C 52.8837,10.2055 53.2507,9.1457 53.2507,8 53.2507,5.10133 50.8987,2.74933 48,2.74933 c -1.1451,0 -2.2049,0.36706 -3.0681,0.98988 C 43.6101,4.69295 42.75,6.24712 42.75,8.0007 c 0,2.3357 1.525,4.3143 3.634,4.9945 v 1.1221 C 45.9591,14.0058 45.5517,13.8511 45.1667,13.6584 44.5655,13.3575 44.0189,12.963 43.5459,12.4949 42.3887,11.3492 41.672,9.7592 41.672,8 c 0,-1.56821 0.5699,-3.00282 1.5139,-4.10813 L 43.1845,3.89053 c 0.2914,-0.34111 0.6184,-0.65087 0.9752,-0.9235 l 0.0014,0.00132 C 45.2256,2.15502 46.5562,1.67199 48,1.67199 c 3.496,0 6.328,2.83201 6.328,6.32801 0,1.4444 -0.4832,2.7747 -1.2965,3.8388 l 0.8337,0.8337 C 54.8876,11.3911 55.4987,9.7671 55.4987,8 55.4987,3.85865 52.1414,0.50133 48,0.50133 Z m 1.616,11.70147 v 1.9145 c 0.4831,-0.1268 0.9436,-0.3093 1.3742,-0.5402 l -0.8039,-0.804 c -0.1846,0.0845 -0.375,0.1586 -0.5703,0.2216 z" fill="context-fill" /> + <path d="m 48,8.21 c 0.116,0 0.21,-0.094 0.21,-0.21 0,-0.116 -0.094,-0.21 -0.21,-0.21 -0.116,0 -0.21,0.094 -0.21,0.21 0,0.116 0.094,0.21 0.21,0.21 z" fill="context-fill" /> + <path fill-rule="evenodd" d="M 67.9987,0.5 H 68 v 0.00133 c 4.1414,0 7.4987,3.35732 7.4987,7.49867 0,1.7671 -0.6111,3.3911 -1.6335,4.6725 L 73.0315,11.8388 C 73.8448,10.7747 74.328,9.4444 74.328,8 74.328,4.504 71.496,1.67199 68,1.67199 c -1.4438,0 -2.7744,0.48303 -3.8389,1.29636 L 64.1597,2.96703 c -1.5132,1.15605 -2.489,2.97944 -2.489,5.03167 0,2.204 1.125,4.1425 2.8316,5.2743 0.5689,0.3773 1.2024,0.665 1.8804,0.843 V 12.9947 C 64.2744,12.3141 62.75,10.3359 62.75,8.0007 62.75,6.24712 63.6107,4.69363 64.9326,3.73989 65.7957,3.11707 66.8549,2.74933 68,2.74933 c 2.8987,0 5.2507,2.352 5.2507,5.25067 0,1.1457 -0.367,2.2055 -0.9898,3.0682 L 71.4175,10.2248 C 71.8348,9.585 72.0773,8.8206 72.0773,8 c 0,-2.16115 -1.6778,-3.92736 -3.803,-4.06827 -0.0904,-0.00598 -0.1817,-0.00839 -0.2736,-0.00839 -2.2534,0 -4.0774,1.82399 -4.0774,4.07736 0,1.6765 1.0124,3.1186 2.4594,3.7431 v -1.2171 c -0.832,-0.5334 -1.384,-1.4667 -1.384,-2.528 0,-1.65603 1.344,-3.00003 3,-3.00003 H 68 V 5 c 1.656,0 3,1.34399 3,3 0,0.5216 -0.1333,1.0122 -0.3676,1.4397 L 69.7447,8.552 C 69.7997,8.3778 69.8294,8.1924 69.8294,8 69.8294,6.98934 69.0107,6.17067 68,6.17067 c -0.1924,0 -0.3778,0.02966 -0.5519,0.08467 L 67.4467,6.254 c -0.7407,0.23396 -1.2774,0.92639 -1.2774,1.7447 0,0.3258 0.0851,0.6317 0.2342,0.8966 -0.0799,-0.2328 -0.027,-0.501 0.1587,-0.6867 0.2597,-0.2597 0.6807,-0.2597 0.9404,0 l 6.5917,6.5916 c 0.2597,0.2597 0.2597,0.6808 0,0.9405 -0.2597,0.2597 -0.6808,0.2597 -0.9405,0 L 71.849,14.4359 c -0.6815,0.4082 -1.4333,0.7112 -2.233,0.8868 -0.352,0.0773 -0.7093,0.1306 -1.0773,0.1546 V 11.1255 L 67.46,10.0469 V 15.476 C 67.092,15.452 66.7347,15.3987 66.3827,15.3214 65.9631,15.2293 65.5567,15.1021 65.1667,14.943 62.4288,13.8261 60.5,11.1382 60.5,7.9987 60.5,4.89266 62.3885,2.22766 65.0799,1.08929 65.977,0.70983 66.9633,0.5 67.9987,0.5 Z m 1.6173,11.7028 v 1.9145 c 0.4831,-0.1268 0.9436,-0.3093 1.3742,-0.5402 l -0.804,-0.804 c -0.1845,0.0845 -0.3749,0.1586 -0.5702,0.2216 z" fill="context-fill" /> + <path d="m 68,8.42 c 0.2319,0 0.42,-0.188 0.42,-0.42 0,-0.232 -0.1881,-0.42 -0.42,-0.42 -0.232,0 -0.42,0.188 -0.42,0.42 0,0.232 0.188,0.42 0.42,0.42 z" fill="context-fill" /> + <path d="M 87.9987,0.5 H 88 v 0.00133 c 4.1414,0 7.4987,3.35732 7.4987,7.49867 0,1.7671 -0.6111,3.3911 -1.6335,4.6725 L 93.0315,11.8388 C 93.8448,10.7747 94.328,9.4444 94.328,8 94.328,4.504 91.496,1.67199 88,1.67199 c -1.4438,0 -2.7744,0.48303 -3.8389,1.29636 L 84.1597,2.96703 c -1.5132,1.15605 -2.489,2.97944 -2.489,5.03167 0,2.204 1.125,4.1425 2.8316,5.2743 0.5689,0.3773 1.2024,0.665 1.8804,0.843 V 12.9947 C 84.2744,12.3141 82.75,10.3359 82.75,8.0007 82.75,6.24712 83.6107,4.69363 84.9326,3.73989 85.7957,3.11707 86.8549,2.74933 88,2.74933 c 2.8987,0 5.2507,2.352 5.2507,5.25067 0,1.1457 -0.367,2.2055 -0.9898,3.0682 L 91.4175,10.2248 C 91.8348,9.585 92.0773,8.8206 92.0773,8 c 0,-2.16115 -1.6778,-3.92736 -3.803,-4.06827 -0.0904,-0.00598 -0.1817,-0.00839 -0.2736,-0.00839 -2.2534,0 -4.0774,1.82399 -4.0774,4.07736 0,1.6765 1.0124,3.1186 2.4594,3.7431 v -1.2171 c -0.832,-0.5334 -1.384,-1.4667 -1.384,-2.528 0,-1.65603 1.344,-3.00003 3,-3.00003 H 88 V 5 c 1.656,0 3,1.34399 3,3 0,0.5216 -0.1333,1.0122 -0.3676,1.4397 L 89.7447,8.552 C 89.7997,8.3778 89.8294,8.1924 89.8294,8 89.8294,6.98934 89.0107,6.17067 88,6.17067 c -0.1924,0 -0.3778,0.02966 -0.5519,0.08467 L 87.4467,6.254 c -0.7407,0.23396 -1.2774,0.92639 -1.2774,1.7447 0,0.824 0.544,1.52 1.2907,1.7493 v 5.728 C 87.092,15.452 86.7347,15.3987 86.3827,15.3214 85.9631,15.2293 85.5567,15.1021 85.1667,14.943 82.4288,13.8261 80.5,11.1382 80.5,7.9987 80.5,4.89266 82.3885,2.22766 85.0799,1.08929 85.977,0.70983 86.9633,0.5 87.9987,0.5 Z" fill="context-fill" /> + <path fill-rule="evenodd" d="m 88.5387,11.1255 -0.7798,-0.7798 c -0.2597,-0.2597 -0.2597,-0.6807 0,-0.9404 0.2597,-0.2597 0.6807,-0.2597 0.9404,0 l 5.395,5.3949 c 0.2597,0.2597 0.2597,0.6808 0,0.9405 -0.2597,0.2597 -0.6808,0.2597 -0.9405,0 L 91.849,14.4359 c -0.6815,0.4082 -1.4333,0.7112 -2.233,0.8868 -0.352,0.0773 -0.7093,0.1306 -1.0773,0.1546 z m 1.0773,1.0774 v 1.9144 c 0.4831,-0.1268 0.9436,-0.3093 1.3742,-0.5402 l -0.804,-0.804 c -0.1845,0.0845 -0.3749,0.1586 -0.5702,0.2216 z" fill="context-fill" /> + <path d="m 88,8.63 c 0.3479,0 0.63,-0.2821 0.63,-0.63 0,-0.3479 -0.2821,-0.63 -0.63,-0.63 -0.3479,0 -0.63,0.2821 -0.63,0.63 0,0.3479 0.2821,0.63 0.63,0.63 z" fill="context-fill" /> + <path fill-rule="evenodd" d="m 100.5,7.9987 c 0,-4.14137 3.357,-7.4987 7.499,-7.4987 2.061,0 3.927,0.83143 5.283,2.17715 1.369,1.35859 2.217,3.24172 2.217,5.32285 0,1.7671 -0.611,3.3911 -1.634,4.6725 l -0.834,-0.8337 c 0.413,-0.5403 0.741,-1.1493 0.964,-1.807 h -0.002 c 0.216,-0.6379 0.334,-1.3217 0.334,-2.0331 0,-1.75964 -0.718,-3.35103 -1.876,-4.49778 -1.143,-1.13084 -2.715,-1.82893 -4.451,-1.82893 -1.444,0 -2.774,0.48303 -3.839,1.29636 L 104.16,2.96702 c -1.513,1.15606 -2.489,2.97945 -2.489,5.03168 0,2.9387 2,5.4053 4.712,6.1173 v -1.1213 c -2.109,-0.6806 -3.633,-2.6588 -3.633,-4.994 0,-1.75358 0.861,-3.30707 2.183,-4.26081 0.863,-0.62282 1.922,-0.99056 3.067,-0.99056 2.899,0 5.251,2.352 5.251,5.25067 0,1.1457 -0.367,2.2055 -0.99,3.0682 l -0.844,-0.8434 c 0.418,-0.6398 0.66,-1.4042 0.66,-2.2248 0,-2.16115 -1.678,-3.92736 -3.803,-4.06827 -0.09,-0.00598 -0.181,-0.00839 -0.273,-0.00839 -2.254,0 -4.078,1.82399 -4.078,4.07736 0,1.6765 1.013,3.1186 2.46,3.7431 v -1.2171 c -0.832,-0.5334 -1.384,-1.4667 -1.384,-2.528 0,-1.65603 1.344,-3.00003 3,-3.00003 1.656,0 3,1.344 3,3.00003 0,1.0081 -0.498,1.9008 -1.261,2.4449 l 0.001,0.0013 c -0.04,0.0287 -0.081,0.0564 -0.123,0.0831 v 0.1942 c 0.206,-0.036 0.426,0.0257 0.585,0.1848 l 3.893,3.8932 c 0.26,0.2597 0.26,0.6808 0,0.9405 -0.259,0.2597 -0.68,0.2597 -0.94,0 l -1.305,-1.3048 c -0.682,0.4082 -1.433,0.7112 -2.233,0.8868 -0.352,0.0773 -0.709,0.1306 -1.077,0.1546 v -0.0014 l -0.002,1e-4 V 9.748 c 0.747,-0.2293 1.291,-0.9253 1.291,-1.7493 0,-1.01069 -0.819,-1.82936 -1.829,-1.82936 -1.011,0 -1.83,0.81867 -1.83,1.82936 0,0.824 0.544,1.52 1.291,1.7493 v 5.728 c -0.368,-0.024 -0.725,-0.0773 -1.077,-0.1546 -3.366,-0.7387 -5.883,-3.736 -5.883,-7.3227 z m 9.116,6.1169 v -1.9127 0.7918 c 0.195,-0.063 0.386,-0.1371 0.57,-0.2216 l 0.804,0.804 c -0.179,0.0963 -0.364,0.1842 -0.554,0.2631 v -0.0019 c -0.265,0.1104 -0.538,0.2033 -0.82,0.2773 z" fill="context-fill" /> + <path d="m 108,8.84 c 0.464,0 0.84,-0.3761 0.84,-0.84 0,-0.4639 -0.376,-0.84 -0.84,-0.84 -0.464,0 -0.84,0.3761 -0.84,0.84 0,0.4639 0.376,0.84 0.84,0.84 z" fill="context-fill" /> + <path d="m 127.999,0.5 c -4.142,0 -7.499,3.35733 -7.499,7.4987 0,3.5867 2.517,6.584 5.883,7.3227 0.352,0.0773 0.709,0.1306 1.077,0.1546 V 9.748 c -0.747,-0.2293 -1.291,-0.9253 -1.291,-1.7493 0,-1.01069 0.819,-1.82936 1.83,-1.82936 1.01,0 1.829,0.81867 1.829,1.82936 0,0.824 -0.544,1.52 -1.291,1.7493 v 5.728 l 0.002,-1e-4 v 0.0014 c 0.368,-0.024 0.725,-0.0773 1.077,-0.1546 0.8,-0.1756 1.551,-0.4786 2.233,-0.8868 l 1.305,1.3048 c 0.26,0.2597 0.681,0.2597 0.94,0 0.26,-0.2597 0.26,-0.6808 0,-0.9405 l -2.132,-2.1327 c -0.26,-0.2597 -0.681,-0.2597 -0.941,0 -0.249,0.2494 -0.259,0.6477 -0.03,0.9089 -0.18,0.0966 -0.365,0.1847 -0.555,0.2638 v -0.0019 c -0.265,0.1104 -0.538,0.2033 -0.82,0.2773 V 10.528 c 0.042,-0.0267 0.083,-0.0544 0.123,-0.0831 l -0.001,-0.0013 c 0.763,-0.5441 1.261,-1.4368 1.261,-2.4449 0,-1.65603 -1.344,-3.00003 -3,-3.00003 -1.656,0 -3,1.344 -3,3.00003 0,1.0613 0.552,1.9946 1.384,2.528 v 1.2171 c -1.447,-0.6245 -2.46,-2.0666 -2.46,-3.7431 0,-2.25337 1.824,-4.07736 4.078,-4.07736 2.253,0 4.077,1.82399 4.077,4.07736 0,1.3054 -0.614,2.4688 -1.569,3.2146 -0.272,0.2125 -0.572,0.3904 -0.893,0.5287 v 1.2507 c 0,-10e-5 0,10e-5 0,0 2.109,-0.68 3.635,-2.658 3.635,-4.994 0,-2.8987 -2.352,-5.2507 -5.25,-5.2507 -2.899,0 -5.251,2.35201 -5.251,5.2507 0,2.3352 1.524,4.3134 3.633,4.994 v 1.1213 c -2.712,-0.712 -4.712,-3.1786 -4.712,-6.1173 0,-2.05223 0.976,-3.87562 2.489,-5.03168 l 0.001,0.00133 c 1.065,-0.81333 2.395,-1.29636 3.839,-1.29636 1.736,0 3.308,0.69809 4.451,1.82893 1.158,1.14675 1.876,2.73814 1.876,4.49778 0,0.7114 -0.118,1.3952 -0.334,2.0331 h 0.002 c -0.223,0.6577 -0.551,1.2667 -0.964,1.807 l 0.834,0.8337 c 1.023,-1.2814 1.634,-2.9054 1.634,-4.6725 0,-2.08113 -0.848,-3.96426 -2.217,-5.32285 C 131.926,1.33143 130.06,0.5 127.999,0.5 Z" fill="context-fill" /> + <path d="m 128,8.84 c 0.464,0 0.84,-0.3761 0.84,-0.84 0,-0.4639 -0.376,-0.84 -0.84,-0.84 -0.464,0 -0.84,0.3761 -0.84,0.84 0,0.4639 0.376,0.84 0.84,0.84 z" fill="context-fill" /> + <path fill-rule="evenodd" d="m 152.493,14.139 c 0.259,-0.2597 0.68,-0.2597 0.94,0 l 0.661,0.6612 c 0.26,0.2597 0.26,0.6808 0,0.9405 -0.259,0.2597 -0.68,0.2597 -0.94,0 l -0.661,-0.6612 c -0.26,-0.2597 -0.26,-0.6808 0,-0.9405 z" fill="context-fill" /> + <path fill-rule="evenodd" d="m 140.5,7.9987 c 0,-4.14137 3.357,-7.4987 7.499,-7.4987 4.141,0 7.498,3.35733 7.498,7.4987 0,3.5867 -2.517,6.584 -5.882,7.3227 -0.352,0.0773 -0.71,0.1306 -1.078,0.1546 V 9.748 c 0.747,-0.2293 1.291,-0.9253 1.291,-1.7493 0,-1.01069 -0.819,-1.82936 -1.829,-1.82936 -1.011,0 -1.83,0.81867 -1.83,1.82936 0,0.824 0.544,1.52 1.291,1.7493 v 5.728 c -0.368,-0.024 -0.725,-0.0773 -1.077,-0.1546 -3.366,-0.7387 -5.883,-3.736 -5.883,-7.3227 z m 9.115,2.528 v 3.5893 c 2.712,-0.712 4.712,-3.1786 4.712,-6.1173 0,-3.49602 -2.832,-6.32802 -6.328,-6.32802 -3.496,0 -6.328,2.83199 -6.328,6.32802 0,2.9387 2,5.4053 4.712,6.1173 v -1.1213 c -2.109,-0.6806 -3.633,-2.6588 -3.633,-4.994 0,-2.89869 2.352,-5.2507 5.251,-5.2507 2.898,0 5.25,2.352 5.25,5.2507 0,2.336 -1.525,4.3147 -3.634,4.9947 v -1.2507 c 1.448,-0.624 2.461,-2.0667 2.461,-3.744 0,-2.25337 -1.824,-4.07736 -4.077,-4.07736 -2.254,0 -4.078,1.82399 -4.078,4.07736 0,1.6765 1.013,3.1186 2.46,3.7431 v -1.2171 c -0.832,-0.5334 -1.384,-1.4667 -1.384,-2.528 0,-1.65603 1.344,-3.00003 3,-3.00003 1.656,0 3,1.344 3,3.00003 0,1.0613 -0.552,1.9946 -1.384,2.528 z" fill="context-fill" /> + <path d="m 148,8.84 c 0.464,0 0.84,-0.3761 0.84,-0.84 0,-0.4639 -0.376,-0.84 -0.84,-0.84 -0.464,0 -0.84,0.3761 -0.84,0.84 0,0.4639 0.376,0.84 0.84,0.84 z" fill="context-fill" /> + <path fill-rule="evenodd" d="m 168.001,2.75 c -2.899,0 -5.251,2.35201 -5.251,5.2507 0,2.336 1.525,4.3147 3.635,4.9947 v -1.2507 c -1.448,-0.624 -2.462,-2.0667 -2.462,-3.744 0,-2.25337 1.824,-4.07736 4.078,-4.07736 2.253,0 4.077,1.82399 4.077,4.07736 0,1.6773 -1.013,3.12 -2.461,3.744 v 1.2507 c 2.109,-0.68 3.634,-2.6587 3.634,-4.9947 0,-2.8987 -2.352,-5.2507 -5.25,-5.2507 z" fill="context-fill" /> + <path fill-rule="evenodd" d="m 167.999,0.5 c -4.142,0 -7.499,3.35733 -7.499,7.4987 0,3.5867 2.517,6.584 5.883,7.3227 0.352,0.0773 0.709,0.1306 1.077,0.1546 V 9.748 c -0.747,-0.2293 -1.291,-0.9253 -1.291,-1.7493 0,-1.01069 0.819,-1.82936 1.83,-1.82936 1.01,0 1.829,0.81867 1.829,1.82936 0,0.824 -0.544,1.52 -1.291,1.7493 v 5.728 c 0.368,-0.024 0.726,-0.0773 1.078,-0.1546 3.365,-0.7387 5.882,-3.736 5.882,-7.3227 0,-4.14137 -3.357,-7.4987 -7.498,-7.4987 z m 1.616,13.616 v -3.5893 c 0.832,-0.5334 1.384,-1.4667 1.384,-2.528 0,-1.65603 -1.344,-3.00003 -3,-3.00003 -1.656,0 -3,1.344 -3,3.00003 0,1.0613 0.552,1.9946 1.384,2.528 v 3.5893 c -2.712,-0.712 -4.712,-3.1786 -4.712,-6.1173 0,-3.49603 2.832,-6.32802 6.328,-6.32802 3.496,0 6.328,2.832 6.328,6.32802 0,2.9387 -2,5.4053 -4.712,6.1173 z" fill="context-fill" /> + <path d="m 168,8.84 c 0.464,0 0.84,-0.3761 0.84,-0.84 0,-0.4639 -0.376,-0.84 -0.84,-0.84 -0.464,0 -0.84,0.3761 -0.84,0.84 0,0.4639 0.376,0.84 0.84,0.84 z" fill="context-fill" /> +</svg> ===================================== browser/components/torconnect/content/torConnectTitlebarStatus.css ===================================== @@ -15,10 +15,32 @@ fill: currentColor; width: 16px; height: 16px; + object-fit: none; + --num-animation-steps: 8; + /* First frame has no offset. */ + --tor-not-connected-offset: 0; + /* Each frame/step is offset by 20px from the previous. */ + --tor-connected-offset: calc(-20px * var(--num-animation-steps)); + object-position: var(--tor-not-connected-offset); +} + +#tor-connect-titlebar-status-icon.tor-connect-status-potentially-blocked:not( + .tor-connect-status-connected +) { + fill: #c50042; +} + +@media (prefers-color-scheme: dark) { + #tor-connect-titlebar-status-icon.tor-connect-status-potentially-blocked:not( + .tor-connect-status-connected + ){ + fill: #ff9aa2; + } } #tor-connect-titlebar-status-icon.tor-connect-status-connected { fill: var(--purple-60); + object-position: var(--tor-connected-offset); } @media (prefers-color-scheme: dark) { @@ -27,12 +49,24 @@ } } -#tor-connect-titlebar-status-icon.tor-connect-status-potentially-blocked { - fill: #c50042; +@keyframes onion-not-connected-to-connected { + from { + object-position: var(--tor-not-connected-offset); + } + + to { + object-position: var(--tor-connected-offset); + } } -@media (prefers-color-scheme: dark) { - #tor-connect-titlebar-status-icon.tor-connect-status-potentially-blocked { - fill: #ff9aa2; +@media (prefers-reduced-motion: no-preference) { + #tor-connect-titlebar-status-icon.tor-connect-status-connected { + transition: fill 1000ms; + animation-name: onion-not-connected-to-connected; + animation-delay: 200ms; + animation-fill-mode: both; + /* Run animation at 60 frames-per-second. */ + animation-duration: calc(var(--num-animation-steps) * 1000ms / 60); + animation-timing-function: steps(var(--num-animation-steps)); } } ===================================== browser/components/torconnect/content/torConnectTitlebarStatus.js ===================================== @@ -91,12 +91,6 @@ var gTorConnectTitlebarStatus = { break; } this.label.textContent = this._strings[textId]; - this.icon.setAttribute( - "src", - connected - ? "chrome://browser/content/torconnect/tor-connect.svg" - : "chrome://browser/content/torconnect/tor-connect-broken.svg" - ); this.icon.classList.toggle("tor-connect-status-connected", connected); this.icon.classList.toggle( "tor-connect-status-potentially-blocked", ===================================== browser/components/torconnect/jar.mn ===================================== @@ -1,13 +1,14 @@ browser.jar: - content/browser/torconnect/torConnectUrlbarButton.js (content/torConnectUrlbarButton.js) - content/browser/torconnect/torConnectTitlebarStatus.js (content/torConnectTitlebarStatus.js) - content/browser/torconnect/torConnectTitlebarStatus.css (content/torConnectTitlebarStatus.css) - content/browser/torconnect/aboutTorConnect.css (content/aboutTorConnect.css) -* content/browser/torconnect/aboutTorConnect.xhtml (content/aboutTorConnect.xhtml) - content/browser/torconnect/aboutTorConnect.js (content/aboutTorConnect.js) - content/browser/torconnect/arrow-right.svg (content/arrow-right.svg) - content/browser/torconnect/bridge.svg (content/bridge.svg) - content/browser/torconnect/connection-failure.svg (content/connection-failure.svg) - content/browser/torconnect/connection-location.svg (content/connection-location.svg) - content/browser/torconnect/tor-connect.svg (content/tor-connect.svg) - content/browser/torconnect/tor-connect-broken.svg (content/tor-connect-broken.svg) + content/browser/torconnect/torConnectUrlbarButton.js (content/torConnectUrlbarButton.js) + content/browser/torconnect/torConnectTitlebarStatus.js (content/torConnectTitlebarStatus.js) + content/browser/torconnect/torConnectTitlebarStatus.css (content/torConnectTitlebarStatus.css) + content/browser/torconnect/aboutTorConnect.css (content/aboutTorConnect.css) +* content/browser/torconnect/aboutTorConnect.xhtml (content/aboutTorConnect.xhtml) + content/browser/torconnect/aboutTorConnect.js (content/aboutTorConnect.js) + content/browser/torconnect/arrow-right.svg (content/arrow-right.svg) + content/browser/torconnect/bridge.svg (content/bridge.svg) + content/browser/torconnect/connection-failure.svg (content/connection-failure.svg) + content/browser/torconnect/connection-location.svg (content/connection-location.svg) + content/browser/torconnect/tor-connect.svg (content/tor-connect.svg) + content/browser/torconnect/tor-not-connected-to-connected-animated.svg (content/tor-not-connected-to-connected-animated.svg) + content/browser/torconnect/tor-connect-broken.svg (content/tor-connect-broken.svg) View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/01f3492… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/01f3492… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.