This is an automated email from the git hooks/post-receive script.
richard pushed a change to branch main in repository torbutton.
from 829fab42 Translation updates new 12c59736 Bug 40730: Do not register localizations in 102 new d96a8864 Bug 40933: Moved tor-launcher to tor-browser.git
The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
Summary of changes: chrome/content/torbutton.js | 26 ++++++-------- components/startup-observer.js | 78 ++++++++++++++++++++++++------------------ modules/tor-control-port.js | 12 +++---- 3 files changed, 61 insertions(+), 55 deletions(-)
This is an automated email from the git hooks/post-receive script.
richard pushed a commit to branch main in repository torbutton.
commit 12c59736333027b44e28b0f04f0000eaa6741598 Author: Pier Angelo Vendrame pierov@torproject.org AuthorDate: Wed Aug 24 15:57:20 2022 +0200
Bug 40730: Do not register localizations in 102 --- components/startup-observer.js | 69 ++++++++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 30 deletions(-)
diff --git a/components/startup-observer.js b/components/startup-observer.js index 77df172a..f89bbe08 100644 --- a/components/startup-observer.js +++ b/components/startup-observer.js @@ -12,6 +12,9 @@ * *************************************************************************/
+const { AppConstants } = ChromeUtils.import( + "resource://gre/modules/AppConstants.jsm" +); const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); const { XPCOMUtils } = ChromeUtils.import( "resource://gre/modules/XPCOMUtils.jsm" @@ -21,11 +24,41 @@ XPCOMUtils.defineLazyModuleGetters(this, { ComponentUtils: "resource://gre/modules/ComponentUtils.jsm", });
-XPCOMUtils.defineLazyModuleGetters(this, { - FileUtils: "resource://gre/modules/FileUtils.jsm", - FileSource: "resource://gre/modules/L10nRegistry.jsm", - L10nRegistry: "resource://gre/modules/L10nRegistry.jsm", -}); +let registerTranslations = () => {}; +if (parseInt(AppConstants.TOR_BROWSER_VERSION) < 102) { + XPCOMUtils.defineLazyModuleGetters(this, { + FileUtils: "resource://gre/modules/FileUtils.jsm", + FileSource: "resource://gre/modules/L10nRegistry.jsm", + L10nRegistry: "resource://gre/modules/L10nRegistry.jsm", + }); + registerTranslations = () => { + // Using all possible locales so that we do not have to change this list every time we support + // a new one. + /* eslint-disable */ + const allLocales = [ + "en-US", "ach", "af", "an", "ar", "ast", "az", "be", "bg", "bn", "br", "bs", "ca", "cak", + "crh", "cs", "cy", "da", "de", "dsb", "el", "en-CA", "en-GB", "eo", "es-AR", "es-CL", + "es-ES", "es-MX", "et", "eu", "fa", "ff", "fi", "fr", "fy-NL", "ga-IE", "gd", "gl", "gn", + "gu-IN", "he", "hi-IN", "hr", "hsb", "hu", "hy-AM", "ia", "id", "is", "it", "ja", + "ja-JP-mac", "ka", "kab", "kk", "km", "kn", "ko", "lij", "lo", "lt", "ltg", "lv", "mk", "mr", + "ms", "my", "nb-NO", "ne-NP", "nl", "nn-NO", "oc", "pa-IN", "pl", "pt-BR", "pt-PT", "rm", + "ro", "ru", "si", "sk", "sl", "son", "sq", "sr", "sv-SE", "ta", "te", "th", "tl", "tr", + "trs", "uk", "ur", "uz", "vi", "wo", "xh", "zh-CN", "zh-TW" + ]; + /* eslint-enable */ + let torSource = new FileSource( + "torbutton", + allLocales, + "resource://torbutton/locale/{locale}/", + true // skip this FileSource locales when computing Services.locale.availableLocales + ); + if (L10nRegistry.registerSources) { + L10nRegistry.registerSources([torSource]); + } else { + L10nRegistry.registerSource(torSource); + } + }; +}
// Module specific constants const kMODULE_NAME = "Startup"; @@ -82,31 +115,7 @@ function StartupObserver() {
cleanupCookies();
- // Using all possible locales so that we do not have to change this list every time we support - // a new one. - /* eslint-disable */ - const allLocales = [ - "en-US", "ach", "af", "an", "ar", "ast", "az", "be", "bg", "bn", "br", "bs", "ca", "cak", - "crh", "cs", "cy", "da", "de", "dsb", "el", "en-CA", "en-GB", "eo", "es-AR", "es-CL", - "es-ES", "es-MX", "et", "eu", "fa", "ff", "fi", "fr", "fy-NL", "ga-IE", "gd", "gl", "gn", - "gu-IN", "he", "hi-IN", "hr", "hsb", "hu", "hy-AM", "ia", "id", "is", "it", "ja", - "ja-JP-mac", "ka", "kab", "kk", "km", "kn", "ko", "lij", "lo", "lt", "ltg", "lv", "mk", "mr", - "ms", "my", "nb-NO", "ne-NP", "nl", "nn-NO", "oc", "pa-IN", "pl", "pt-BR", "pt-PT", "rm", - "ro", "ru", "si", "sk", "sl", "son", "sq", "sr", "sv-SE", "ta", "te", "th", "tl", "tr", - "trs", "uk", "ur", "uz", "vi", "wo", "xh", "zh-CN", "zh-TW" - ]; - /* eslint-enable */ - let torSource = new FileSource( - "torbutton", - allLocales, - "resource://torbutton/locale/{locale}/", - true // skip this FileSource locales when computing Services.locale.availableLocales - ); - if (L10nRegistry.registerSources) { - L10nRegistry.registerSources([torSource]); - } else { - L10nRegistry.registerSource(torSource); - } + registerTranslations(); }
StartupObserver.prototype = {
This is an automated email from the git hooks/post-receive script.
richard pushed a commit to branch main in repository torbutton.
commit d96a88641bf94ae926bdf326978ce799ddbedb89 Author: Pier Angelo Vendrame pierov@torproject.org AuthorDate: Wed Aug 24 16:00:39 2022 +0200
Bug 40933: Moved tor-launcher to tor-browser.git
Updated paths to tor-launcher modules and use TorProtocolService, instead of referencing the component with @torproject.org/torlauncher-protocol-service;1. --- chrome/content/torbutton.js | 26 +++++++++++--------------- components/startup-observer.js | 9 +++++---- modules/tor-control-port.js | 12 ++++++------ 3 files changed, 22 insertions(+), 25 deletions(-)
diff --git a/chrome/content/torbutton.js b/chrome/content/torbutton.js index ec2680f2..d89e5d55 100644 --- a/chrome/content/torbutton.js +++ b/chrome/content/torbutton.js @@ -30,6 +30,10 @@ var torbutton_new_circuit; "resource://torbutton/modules/tor-control-port.js" );
+ const { TorProtocolService } = ChromeUtils.import( + "resource://gre/modules/TorProtocolService.jsm" + ); + const k_tb_tor_check_failed_topic = "Torbutton:TorCheckFailed";
var m_tb_prefs = Services.prefs; @@ -197,13 +201,6 @@ var torbutton_new_circuit; } m_tb_wasinited = true;
- let tlps; - try { - tlps = Cc["@torproject.org/torlauncher-protocol-service;1"].getService( - Ci.nsISupports - ).wrappedJSObject; - } catch (e) {} - // Bug 1506 P4: These vars are very important for New Identity var environ = Cc["@mozilla.org/process/environment;1"].getService( Ci.nsIEnvironment @@ -223,7 +220,7 @@ var torbutton_new_circuit; } else { try { // Try to get password from Tor Launcher. - m_tb_control_pass = tlps.TorGetPassword(false); + m_tb_control_pass = TorProtocolService.torGetPassword(false); } catch (e) {} }
@@ -231,7 +228,7 @@ var torbutton_new_circuit; // since Tor Launcher knows how to handle its own preferences and how to // resolve relative paths. try { - m_tb_control_ipc_file = tlps.TorGetControlIPCFile(); + m_tb_control_ipc_file = TorProtocolService.torGetControlIPCFile(); } catch (e) {}
if (!m_tb_control_ipc_file) { @@ -278,12 +275,6 @@ var torbutton_new_circuit; torbutton_log(1, "registering Tor check observer"); torbutton_tor_check_observer.register();
- try { - createTorCircuitDisplay("extensions.torbutton.display_circuit"); - } catch (e) { - torbutton_log(4, "Error creating the tor circuit display " + e); - } - try { torbutton_init_user_manual_links(); } catch (e) { @@ -306,6 +297,11 @@ var torbutton_new_circuit; async receiveMessage(aMessage) { switch (aMessage.name) { case "AboutTor:Loaded": + try { + createTorCircuitDisplay("extensions.torbutton.display_circuit"); + } catch (e) { + torbutton_log(4, "Error creating the tor circuit display " + e); + } aMessage.target.messageManager.sendAsyncMessage( "AboutTor:ChromeData", await this.getChromeData(true) diff --git a/components/startup-observer.js b/components/startup-observer.js index f89bbe08..090eb7b8 100644 --- a/components/startup-observer.js +++ b/components/startup-observer.js @@ -20,6 +20,10 @@ const { XPCOMUtils } = ChromeUtils.import( "resource://gre/modules/XPCOMUtils.jsm" );
+const { TorProtocolService } = ChromeUtils.import( + "resource://gre/modules/TorProtocolService.jsm" +); + XPCOMUtils.defineLazyModuleGetters(this, { ComponentUtils: "resource://gre/modules/ComponentUtils.jsm", }); @@ -141,10 +145,7 @@ StartupObserver.prototype = { // Try to retrieve SOCKS proxy settings from Tor Launcher. let socksPortInfo; try { - let tlps = Cc[ - "@torproject.org/torlauncher-protocol-service;1" - ].getService(Ci.nsISupports).wrappedJSObject; - socksPortInfo = tlps.TorGetSOCKSPortInfo(); + socksPortInfo = TorProtocolService.torGetSOCKSPortInfo(); } catch (e) { this.logger.log(3, "tor launcher failed " + e); } diff --git a/modules/tor-control-port.js b/modules/tor-control-port.js index dc59c8da..374ff5fd 100644 --- a/modules/tor-control-port.js +++ b/modules/tor-control-port.js @@ -26,9 +26,12 @@ // ### Import Mozilla Services const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const { TorProtocolService, TorProcessStatus } = ChromeUtils.import( - "resource:///modules/TorProtocolService.jsm" +ChromeUtils.defineModuleGetter( + this, + "TorMonitorService", + "resource://gre/modules/TorMonitorService.jsm" ); + // tor-launcher observer topics const TorTopics = Object.freeze({ ProcessIsReady: "TorProcessIsReady", @@ -949,10 +952,7 @@ var controller = async function(avoidCache) { // tor daemon) var wait_for_controller = function(avoidCache) { // if tor process is running (either ours or system) immediately return controller - if ( - !TorProtocolService.ownsTorDaemon || - TorProtocolService.torProcessStatus == TorProcessStatus.Running - ) { + if (!TorMonitorService.ownsTorDaemon || TorMonitorService.isRunning) { return controller(avoidCache); }
tbb-commits@lists.torproject.org