This is an automated email from the git hooks/post-receive script.
pierov pushed a change to branch tor-browser-102.4.0esr-12.0-2 in repository tor-browser.
from cc33275d46e5 fixup! Add TorStrings module for localization new 0561dad276ac fixup! Bug 40562: Added Tor-related preferences to 000-tor-browser.js new 6aac3873c280 fixup! Bug 40597: Implement TorSettings module new c7057d8e2a05 fixup! Bug 40926: Implemented the New Identity feature new 6e7b1c47758e fixup! Bug 40925: Implemented the Security Level component new e30289861b52 fixup! Bug 40933: Add tor-launcher functionality new ceb40dd8151b fixup! Bug 10760: Integrate TorButton to TorBrowser core
The 6 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: browser/app/profile/000-tor-browser.js | 36 +++-------- .../components/newidentity/content/newidentity.js | 6 +- .../securitylevel/content/securityLevel.js | 10 +-- browser/modules/Moat.jsm | 6 -- .../mozilla/geckoview/GeckoRuntimeSettings.java | 12 ++-- toolkit/components/securitylevel/SecurityLevel.jsm | 71 +++++++++++++++------- .../components/tor-launcher/TorLauncherUtil.jsm | 34 ----------- .../components/tor-launcher/TorStartupService.jsm | 6 -- toolkit/torproject/torbutton | 2 +- 9 files changed, 74 insertions(+), 109 deletions(-)
This is an automated email from the git hooks/post-receive script.
pierov pushed a commit to branch tor-browser-102.4.0esr-12.0-2 in repository tor-browser.
commit 0561dad276ac59272890cc577cf7d009a622d970 Author: Pier Angelo Vendrame pierov@torproject.org AuthorDate: Thu Nov 17 18:27:00 2022 +0100
fixup! Bug 40562: Added Tor-related preferences to 000-tor-browser.js
Bug 41460: Removed old security level/new identity preferences --- browser/app/profile/000-tor-browser.js | 36 +++++++++------------------------- 1 file changed, 9 insertions(+), 27 deletions(-)
diff --git a/browser/app/profile/000-tor-browser.js b/browser/app/profile/000-tor-browser.js index b8fd6e4e239d..08db037faeb0 100644 --- a/browser/app/profile/000-tor-browser.js +++ b/browser/app/profile/000-tor-browser.js @@ -53,20 +53,20 @@ pref("network.http.connection-retry-timeout", 0); // Old torbutton prefs
// debug prefs -pref("extensions.torbutton.loglevel",4); -pref("extensions.torbutton.logmethod",1); // 0=stdout, 1=errorconsole, 2=debuglog +pref("extensions.torbutton.loglevel", 4); +pref("extensions.torbutton.logmethod", 1); // 0=stdout, 1=errorconsole, 2=debuglog
// Display prefs pref("extensions.torbutton.display_circuit", true);
// Tor check and proxy prefs -pref("extensions.torbutton.test_enabled",true); -pref("extensions.torbutton.test_url","https://check.torproject.org/?TorButton=true"); -pref("extensions.torbutton.local_tor_check",true); -pref("extensions.torbutton.use_nontor_proxy",false); +pref("extensions.torbutton.test_enabled", true); +pref("extensions.torbutton.test_url", "https://check.torproject.org/?TorButton=true"); +pref("extensions.torbutton.local_tor_check", true); +pref("extensions.torbutton.use_nontor_proxy", false);
// State prefs: -pref("extensions.torbutton.startup",false); +pref("extensions.torbutton.startup", false);
// This is only used when letterboxing is disabled. // See #7255 for details. We display the warning three times to make sure the @@ -74,19 +74,8 @@ pref("extensions.torbutton.startup",false); pref("extensions.torbutton.maximize_warnings_remaining", 3);
// Security prefs: -pref("extensions.torbutton.clear_http_auth",true); -pref("extensions.torbutton.close_newnym",true); -pref("extensions.torbutton.resize_new_windows",false); -pref("extensions.torbutton.launch_warning",true); - -// Security Slider -pref("extensions.torbutton.security_slider", 4); -pref("extensions.torbutton.security_custom", false); - -pref("extensions.torbutton.confirm_newnym", true); - -pref("extensions.torbutton.noscript_inited", false); -pref("extensions.torbutton.noscript_persist", false); +pref("extensions.torbutton.resize_new_windows", false); +pref("extensions.torbutton.launch_warning", true);
// Browser home page: pref("browser.startup.homepage", "about:tor"); @@ -103,13 +92,6 @@ pref("extensions.torlauncher.start_tor", true); pref("extensions.torlauncher.prompt_at_startup", true); pref("extensions.torlauncher.quickstart", false);
-// This pref controls whether Tor Launcher will try to remove the old -// meek and moat http helper browser profiles. This only has an effect -// on macOS; for Windows and Linux profile removal is handled by the -// updater (since on those platforms the profiles are embedded within -// the browser install directory). -pref("extensions.torlauncher.should_remove_meek_helper_profiles", true); - pref("extensions.torlauncher.loglevel", 4); // 1=verbose, 2=debug, 3=info, 4=note, 5=warn pref("extensions.torlauncher.logmethod", 1); // 0=stdout, 1=errorconsole, 2=debuglog pref("extensions.torlauncher.max_tor_log_entries", 1000);
This is an automated email from the git hooks/post-receive script.
pierov pushed a commit to branch tor-browser-102.4.0esr-12.0-2 in repository tor-browser.
commit 6aac3873c280c0840eb9ae17220dc90e99943105 Author: Pier Angelo Vendrame pierov@torproject.org AuthorDate: Thu Nov 17 18:30:07 2022 +0100
fixup! Bug 40597: Implement TorSettings module
Bug 41460: Removed references to the meek helper --- browser/modules/Moat.jsm | 6 ------ 1 file changed, 6 deletions(-)
diff --git a/browser/modules/Moat.jsm b/browser/modules/Moat.jsm index 28f177e27b3b..2527e0db5551 100644 --- a/browser/modules/Moat.jsm +++ b/browser/modules/Moat.jsm @@ -137,19 +137,13 @@ class MeekTransport {
// Setup env and start meek process let ptStateDir = TorLauncherUtil.getTorFile("tordatadir", false); - let meekHelperProfileDir = TorLauncherUtil.getTorFile( - "pt-profiles-dir", - true - ); ptStateDir.append("pt_state"); // Match what tor uses. - meekHelperProfileDir.appendRelativePath("profile.moat-http-helper");
let envAdditions = { TOR_PT_MANAGED_TRANSPORT_VER: "1", TOR_PT_STATE_LOCATION: ptStateDir.path, TOR_PT_EXIT_ON_STDIN_CLOSE: "1", TOR_PT_CLIENT_TRANSPORTS: meekTransport, - TOR_BROWSER_MEEK_PROFILE: meekHelperProfileDir.path, }; if (TorSettings.proxy.enabled) { envAdditions.TOR_PT_PROXY = TorSettings.proxy.uri;
This is an automated email from the git hooks/post-receive script.
pierov pushed a commit to branch tor-browser-102.4.0esr-12.0-2 in repository tor-browser.
commit c7057d8e2a0550d5c30d6eedb427c571e64c9f1f Author: Pier Angelo Vendrame pierov@torproject.org AuthorDate: Thu Nov 17 18:27:44 2022 +0100
fixup! Bug 40926: Implemented the New Identity feature
Bug 41460: Renamed preferences --- browser/components/newidentity/content/newidentity.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/browser/components/newidentity/content/newidentity.js b/browser/components/newidentity/content/newidentity.js index 0d5ddaa53529..cad74e9cddf9 100644 --- a/browser/components/newidentity/content/newidentity.js +++ b/browser/components/newidentity/content/newidentity.js @@ -162,7 +162,7 @@ XPCOMUtils.defineLazyGetter(this, "NewIdentityButton", () => { closeTabs() { logger.info("Closing tabs"); if ( - !Services.prefs.getBoolPref("extensions.torbutton.close_newnym", true) + !Services.prefs.getBoolPref("browser.new_identity.close_newnym", true) ) { logger.info("Not closing tabs"); return; @@ -241,7 +241,7 @@ XPCOMUtils.defineLazyGetter(this, "NewIdentityButton", () => { clearHTTPAuths() { if ( !Services.prefs.getBoolPref( - "extensions.torbutton.clear_http_auth", + "browser.new_identity.clear_http_auth", true ) ) { @@ -525,7 +525,7 @@ XPCOMUtils.defineLazyGetter(this, "NewIdentityButton", () => { } newIdentityInProgress = true;
- const prefConfirm = "extensions.torbutton.confirm_newnym"; + const prefConfirm = "browser.new_identity.confirm_newnym"; const shouldConfirm = Services.prefs.getBoolPref(prefConfirm, true); if (shouldConfirm) { // Display two buttons, both with string titles.
This is an automated email from the git hooks/post-receive script.
pierov pushed a commit to branch tor-browser-102.4.0esr-12.0-2 in repository tor-browser.
commit 6e7b1c47758ef21e3c5f0882100b078853b405ee Author: Pier Angelo Vendrame pierov@torproject.org AuthorDate: Thu Nov 17 18:28:54 2022 +0100
fixup! Bug 40925: Implemented the Security Level component
Bug 41460: Renamed preferences --- .../securitylevel/content/securityLevel.js | 10 +-- .../mozilla/geckoview/GeckoRuntimeSettings.java | 12 ++-- toolkit/components/securitylevel/SecurityLevel.jsm | 71 +++++++++++++++------- 3 files changed, 61 insertions(+), 32 deletions(-)
diff --git a/browser/components/securitylevel/content/securityLevel.js b/browser/components/securitylevel/content/securityLevel.js index 4b27ddbde592..2ef7fc1648df 100644 --- a/browser/components/securitylevel/content/securityLevel.js +++ b/browser/components/securitylevel/content/securityLevel.js @@ -76,8 +76,8 @@ XPCOMUtils.defineLazyGetter(this, "SecurityLevelStrings", () => { Getters and Setters for relevant torbutton prefs */ const SecurityLevelPrefs = { - security_slider_pref: "extensions.torbutton.security_slider", - security_custom_pref: "extensions.torbutton.security_custom", + security_slider_pref: "browser.security_level.security_slider", + security_custom_pref: "browser.security_level.security_custom",
get securitySlider() { try { @@ -182,7 +182,7 @@ const SecurityLevelButton = { this._configUIFromPrefs();
this._securityPrefsBranch = Services.prefs.getBranch( - "extensions.torbutton." + "browser.security_level." ); this._securityPrefsBranch.addObserver("", this);
@@ -340,7 +340,7 @@ const SecurityLevelPanel = {
init() { this._securityPrefsBranch = Services.prefs.getBranch( - "extensions.torbutton." + "browser.security_level." ); this._securityPrefsBranch.addObserver("", this); }, @@ -545,7 +545,7 @@ const SecurityLevelPreferences = {
// register for pref chagnes this._securityPrefsBranch = Services.prefs.getBranch( - "extensions.torbutton." + "browser.security_level." ); this._securityPrefsBranch.addObserver("", this); }, diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java index a35294bfc6f0..90df323d667d 100644 --- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java +++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java @@ -472,7 +472,7 @@ public final class GeckoRuntimeSettings extends RuntimeSettings { * @return This Builder instance. */ public @NonNull Builder torSecurityLevel(final int level) { - getSettings().mTorSecurityLevel.set(level); + getSettings().mSecurityLevel.set(level); return this; }
@@ -535,8 +535,8 @@ public final class GeckoRuntimeSettings extends RuntimeSettings { new Pref<Boolean>("dom.security.https_only_mode_pbm", false); /* package */ final Pref<Integer> mProcessCount = new Pref<>("dom.ipc.processCount", 2); /* package */ final Pref<Integer> mSpoofEnglish = new Pref<>("privacy.spoof_english", 0); - /* package */ final Pref<Integer> mTorSecurityLevel = - new Pref<>("extensions.torbutton.security_slider", 4); + /* package */ final Pref<Integer> mSecurityLevel = + new Pref<>("browser.security_level.security_slider", 4); /* package */ final Pref<Boolean> mPrioritizeOnions = new Pref<>("privacy.prioritizeonions.enabled", false);
@@ -1309,17 +1309,17 @@ public final class GeckoRuntimeSettings extends RuntimeSettings { * @return current security protection level */ public int getTorSecurityLevel() { - return mTorSecurityLevel.get(); + return mSecurityLevel.get(); }
/** - * Sets the Tor Security Level. + * Sets the Security Level. * * @param level security protection level * @return This GeckoRuntimeSettings instance. */ public @NonNull GeckoRuntimeSettings setTorSecurityLevel(final int level) { - mTorSecurityLevel.commit(level); + mSecurityLevel.commit(level); return this; }
diff --git a/toolkit/components/securitylevel/SecurityLevel.jsm b/toolkit/components/securitylevel/SecurityLevel.jsm index 60e95d777192..f9b6d5971360 100644 --- a/toolkit/components/securitylevel/SecurityLevel.jsm +++ b/toolkit/components/securitylevel/SecurityLevel.jsm @@ -29,9 +29,8 @@ XPCOMUtils.defineLazyGetter(this, "logger", () => { });
// The Security Settings prefs in question. -const kSliderPref = "extensions.torbutton.security_slider"; -const kCustomPref = "extensions.torbutton.security_custom"; -const kSliderMigration = "extensions.torbutton.security_slider_migration"; +const kSliderPref = "browser.security_level.security_slider"; +const kCustomPref = "browser.security_level.security_custom";
// __getPrefValue(prefName)__ // Returns the current value of a preference, regardless of its type. @@ -213,7 +212,7 @@ var initializeNoScriptControl = () => { sendNoScriptSettings(noscriptSettings(safetyLevel));
// __securitySliderToSafetyLevel(sliderState)__. - // Converts the "extensions.torbutton.security_slider" pref value + // Converts the "browser.security_level.security_slider" pref value // to a "safety level" value: 0 = Standard, 1 = Safer, 2 = Safest let securitySliderToSafetyLevel = sliderState => [undefined, 2, 1, 1, 0][sliderState]; @@ -224,11 +223,11 @@ var initializeNoScriptControl = () => { try { logger.debug("Message received from NoScript:", a); let noscriptPersist = Services.prefs.getBoolPref( - "extensions.torbutton.noscript_persist", + "browser.security_level.noscript_persist", false ); let noscriptInited = Services.prefs.getBoolPref( - "extensions.torbutton.noscript_inited", + "browser.security_level.noscript_inited", false ); // Set the noscript safety level once if we have never run noscript @@ -244,7 +243,7 @@ var initializeNoScriptControl = () => { ); if (!noscriptInited) { Services.prefs.setBoolPref( - "extensions.torbutton.noscript_inited", + "browser.security_level.noscript_inited", true ); } @@ -267,7 +266,7 @@ var initializeNoScriptControl = () => { // A table of all prefs bound to the security slider, and the value // for each security setting. Note that 2-m and 3-m are identical, // corresponding to the old 2-medium-high setting. We also separately -// bind NoScript settings to the extensions.torbutton.security_slider +// bind NoScript settings to the browser.security_level.security_slider // (see noscript-control.js). /* eslint-disable */ const kSecuritySettings = { @@ -348,8 +347,8 @@ var watch_security_prefs = function(onSettingChanged) { var initializedSecPrefs = false;
// __initialize()__. -// Defines the behavior of "extensions.torbutton.security_custom", -// "extensions.torbutton.security_slider", and the security-sensitive +// Defines the behavior of "browser.security_level.security_custom", +// "browser.security_level.security_slider", and the security-sensitive // prefs declared in kSecuritySettings. var initializeSecurityPrefs = function() { // Only run once. @@ -390,25 +389,55 @@ var initializeSecurityPrefs = function() { write_setting_to_prefs(2); }
- // Revert #33613 fix - if (Services.prefs.getIntPref(kSliderMigration, 0) < 2) { - // We can't differentiate between users having flipped `javascript.enabled` - // to `false` before it got governed by the security settings vs. those who - // had it flipped due to #33613. Reset the preference for everyone. - if (Services.prefs.getIntPref(kSliderPref) === 1) { - Services.prefs.setBoolPref("javascript.enabled", true); - } - Services.prefs.clearUserPref("media.webaudio.enabled"); - Services.prefs.setIntPref(kSliderMigration, 2); - } logger.info("security-prefs.js initialization complete"); };
+// tor-browser#41460: we changed preference names in 12.0. +// 11.5.8 is an obligated step for desktop users, so this code is helpful only +// to alpha users, and we could remove it quite soon. +function migratePreferences() { + const kPrefCheck = "extensions.torbutton.noscript_inited"; + // For 12.0, check for extensions.torbutton.noscript_inited, which was set + // as a user preference for sure, if someone used security level in previous + // versions. + if(!Services.prefs.prefHasUserValue(kPrefCheck)) { + return; + } + const migrate = (oldName, newName, getter, setter) => { + oldName = `extensions.torbutton.${oldName}`; + newName = `browser.${newName}`; + if (Services.prefs.prefHasUserValue(oldName)) { + setter(newName, getter(oldName)); + Services.prefs.clearUserPref(oldName); + } + }; + const prefs = { + security_custom: "security_level.security_custom", + noscript_persist: "security_level.noscript_persist", + noscript_inited: "security_level.noscript_inited", + } + for (const [oldName, newName] of Object.entries(prefs)) { + migrate( + oldName, + newName, + Services.prefs.getBoolPref.bind(Services.prefs), + Services.prefs.setBoolPref.bind(Services.prefs) + ); + } + migrate( + "security_slider", + "security_level.security_slider", + Services.prefs.getIntPref.bind(Services.prefs), + Services.prefs.setIntPref.bind(Services.prefs) + ); +} + // This class is used to initialize the security level stuff at the startup class SecurityLevel { QueryInterface = ChromeUtils.generateQI(["nsIObserver"]);
init() { + migratePreferences(); initializeNoScriptControl(); initializeSecurityPrefs(); }
This is an automated email from the git hooks/post-receive script.
pierov pushed a commit to branch tor-browser-102.4.0esr-12.0-2 in repository tor-browser.
commit e30289861b525e7e86ec670a24dc0ddc0b08a01d Author: Pier Angelo Vendrame pierov@torproject.org AuthorDate: Thu Nov 17 18:31:51 2022 +0100
fixup! Bug 40933: Add tor-launcher functionality
Bug 41460: Removed the references to the meek profile --- .../components/tor-launcher/TorLauncherUtil.jsm | 34 ---------------------- .../components/tor-launcher/TorStartupService.jsm | 6 ---- 2 files changed, 40 deletions(-)
diff --git a/toolkit/components/tor-launcher/TorLauncherUtil.jsm b/toolkit/components/tor-launcher/TorLauncherUtil.jsm index 798040fa3abf..668d94669e5b 100644 --- a/toolkit/components/tor-launcher/TorLauncherUtil.jsm +++ b/toolkit/components/tor-launcher/TorLauncherUtil.jsm @@ -560,40 +560,6 @@ const TorLauncherUtil = Object.freeze({ } },
- removeMeekAndMoatHelperProfiles() { - // FIXME: Is this something we can remove? - const removeDirectory = (aParentDir, aName) => { - try { - const dir = aParentDir.clone(); - dir.appendRelativePath(aName); - if (dir.exists()) { - dir.remove(true); - } - } catch (e) { - console.error(`Failed to remove ${aName}:`, e); - } - }; - - const kPrefRemoveHelperProfiles = - "extensions.torlauncher.should_remove_meek_helper_profiles"; - if (Services.prefs.getBoolPref(kPrefRemoveHelperProfiles, false)) { - try { - // Only attempt removal once. - Services.prefs.setBoolPref(kPrefRemoveHelperProfiles, false); - } catch (e) { - console.warn(`Could not set ${kPrefRemoveHelperProfiles}`, e); - } - - if (this.isMac) { - let ptProfilesDir = this.getTorFile("pt-profiles-dir", true); - if (ptProfilesDir) { - removeDirectory(ptProfilesDir, "profile.meek-http-helper"); - removeDirectory(ptProfilesDir, "profile.moat-http-helper"); - } - } - } - }, - get _stringBundle() { if (!gStringBundle) { gStringBundle = Services.strings.createBundle(kPropBundleURI); diff --git a/toolkit/components/tor-launcher/TorStartupService.jsm b/toolkit/components/tor-launcher/TorStartupService.jsm index 539c599aec62..c1bbfda19ea3 100644 --- a/toolkit/components/tor-launcher/TorStartupService.jsm +++ b/toolkit/components/tor-launcher/TorStartupService.jsm @@ -67,12 +67,6 @@ class TorStartupService { TorSettings.init(); TorConnect.init();
- try { - TorLauncherUtil.removeMeekAndMoatHelperProfiles(); - } catch (e) { - console.warn("Failed to remove meek and moat profiles", e); - } - gInited = true; }
This is an automated email from the git hooks/post-receive script.
pierov pushed a commit to branch tor-browser-102.4.0esr-12.0-2 in repository tor-browser.
commit ceb40dd8151b0c8323a41fbea721e8dbd941d936 Author: Pier Angelo Vendrame pierov@torproject.org AuthorDate: Thu Nov 17 18:35:02 2022 +0100
fixup! Bug 10760: Integrate TorButton to TorBrowser core
Bug 41460: Updated security level preferences --- toolkit/torproject/torbutton | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/toolkit/torproject/torbutton b/toolkit/torproject/torbutton index 004b629b21c8..60dc0713f2bf 160000 --- a/toolkit/torproject/torbutton +++ b/toolkit/torproject/torbutton @@ -1 +1 @@ -Subproject commit 004b629b21c83133d7c90e0a3656f90d44562746 +Subproject commit 60dc0713f2bf6e4397c51e798643ca65784d234d
tor-commits@lists.torproject.org