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
Threads by month
  • ----- 2026 -----
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • 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

  • 1 participants
  • 20073 discussions
[Git][tpo/applications/tor-browser][base-browser-115.10.0esr-13.5-1] fixup! Bug 41918: Option to reuse last window size when letterboxing is enabled.
by richard (@richard) 17 Apr '24

17 Apr '24
richard pushed to branch base-browser-115.10.0esr-13.5-1 at The Tor Project / Applications / Tor Browser Commits: bd81091e by hackademix at 2024-04-17T20:15:09+00:00 fixup! Bug 41918: Option to reuse last window size when letterboxing is enabled. Bug 42500: Fix restored window size after startup maximization - - - - - 2 changed files: - browser/components/BrowserGlue.sys.mjs - toolkit/xre/nsAppRunner.cpp Changes: ===================================== browser/components/BrowserGlue.sys.mjs ===================================== @@ -1600,6 +1600,13 @@ BrowserGlue.prototype = { return; } + // We don't want to mess up with RFP new window / letterboxing machinery. + if ( + Services.prefs.getBoolPref("privacy.resistFingerprinting", false) + ) { + return; + } + let store = Services.xulStore; let getValue = attr => store.getValue(AppConstants.BROWSER_CHROME_URL, "main-window", attr); ===================================== toolkit/xre/nsAppRunner.cpp ===================================== @@ -287,6 +287,7 @@ static const char kPrefThemeId[] = "extensions.activeThemeID"; static const char kPrefBrowserStartupBlankWindow[] = "browser.startup.blankWindow"; static const char kPrefPreXulSkeletonUI[] = "browser.startup.preXulSkeletonUI"; +static const char kPrefResistFingerprinting[] = "privacy.resistFingerprinting"; #endif // defined(XP_WIN) #if defined(MOZ_WIDGET_GTK) @@ -2260,6 +2261,7 @@ static void ReflectSkeletonUIPrefToRegistry(const char* aPref, void* aData) { bool shouldBeEnabled = Preferences::GetBool(kPrefPreXulSkeletonUI, false) && Preferences::GetBool(kPrefBrowserStartupBlankWindow, false) && + !Preferences::GetBool(kPrefResistFingerprinting, false) && LookAndFeel::DrawInTitlebar(); if (shouldBeEnabled && Preferences::HasUserValue(kPrefThemeId)) { nsCString themeId; View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/bd81091… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/bd81091… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-115.10.0esr-13.5-1] fixup! Bug 41918: Option to reuse last window size when letterboxing is enabled.
by richard (@richard) 17 Apr '24

17 Apr '24
richard pushed to branch tor-browser-115.10.0esr-13.5-1 at The Tor Project / Applications / Tor Browser Commits: 3cabcf78 by hackademix at 2024-04-17T20:05:27+00:00 fixup! Bug 41918: Option to reuse last window size when letterboxing is enabled. Bug 42500: Fix restored window size after startup maximization - - - - - 2 changed files: - browser/components/BrowserGlue.sys.mjs - toolkit/xre/nsAppRunner.cpp Changes: ===================================== browser/components/BrowserGlue.sys.mjs ===================================== @@ -1685,6 +1685,13 @@ BrowserGlue.prototype = { return; } + // We don't want to mess up with RFP new window / letterboxing machinery. + if ( + Services.prefs.getBoolPref("privacy.resistFingerprinting", false) + ) { + return; + } + let store = Services.xulStore; let getValue = attr => store.getValue(AppConstants.BROWSER_CHROME_URL, "main-window", attr); ===================================== toolkit/xre/nsAppRunner.cpp ===================================== @@ -287,6 +287,7 @@ static const char kPrefThemeId[] = "extensions.activeThemeID"; static const char kPrefBrowserStartupBlankWindow[] = "browser.startup.blankWindow"; static const char kPrefPreXulSkeletonUI[] = "browser.startup.preXulSkeletonUI"; +static const char kPrefResistFingerprinting[] = "privacy.resistFingerprinting"; #endif // defined(XP_WIN) #if defined(MOZ_WIDGET_GTK) @@ -2262,6 +2263,7 @@ static void ReflectSkeletonUIPrefToRegistry(const char* aPref, void* aData) { bool shouldBeEnabled = Preferences::GetBool(kPrefPreXulSkeletonUI, false) && Preferences::GetBool(kPrefBrowserStartupBlankWindow, false) && + !Preferences::GetBool(kPrefResistFingerprinting, false) && LookAndFeel::DrawInTitlebar(); if (shouldBeEnabled && Preferences::HasUserValue(kPrefThemeId)) { nsCString themeId; View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/3cabcf7… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/3cabcf7… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/mullvad-browser][mullvad-browser-115.10.0esr-13.5-1] fixup! Bug 41116: Normalize system fonts.
by richard (@richard) 17 Apr '24

17 Apr '24
richard pushed to branch mullvad-browser-115.10.0esr-13.5-1 at The Tor Project / Applications / Mullvad Browser Commits: 308ea305 by Pier Angelo Vendrame at 2024-04-17T20:03:35+00:00 fixup! Bug 41116: Normalize system fonts. Bug 42529: Fix the breakage of this patch on Android. Also, improve the patch hoping I can finally uplift it. - - - - - 2 changed files: - gfx/thebes/gfxPlatformFontList.cpp - layout/base/nsLayoutUtils.cpp Changes: ===================================== gfx/thebes/gfxPlatformFontList.cpp ===================================== @@ -38,6 +38,7 @@ #include "mozilla/dom/ContentChild.h" #include "mozilla/dom/ContentParent.h" #include "mozilla/dom/ContentProcessMessageManager.h" +#include "mozilla/dom/Document.h" #include "mozilla/gfx/2D.h" #include "mozilla/ipc/FileDescriptorUtils.h" #include "mozilla/ResultExtensions.h" @@ -1964,20 +1965,27 @@ void gfxPlatformFontList::MaybeRemoveCmap(gfxCharacterMap* aCharMap) { } } -static void GetSystemUIFontFamilies([[maybe_unused]] nsAtom* aLangGroup, +static void GetSystemUIFontFamilies(const nsPresContext* aPresContext, + [[maybe_unused]] nsAtom* aLangGroup, nsTArray<nsCString>& aFamilies) { // TODO: On macOS, use CTCreateUIFontForLanguage or such thing (though the // code below ends up using [NSFont systemFontOfSize: 0.0]. nsFont systemFont; gfxFontStyle fontStyle; nsAutoString systemFontName; - if (nsContentUtils::ShouldResistFingerprinting()) { + if (aPresContext && aPresContext->Document() + ? aPresContext->Document()->ShouldResistFingerprinting( + RFPTarget::Unknown) + : nsContentUtils::ShouldResistFingerprinting( + "aPresContext not available", RFPTarget::Unknown)) { #ifdef XP_MACOSX *aFamilies.AppendElement() = "-apple-system"_ns; -#else + return; +#elif !defined(MOZ_WIDGET_ANDROID) *aFamilies.AppendElement() = "sans-serif"_ns; -#endif return; +#endif + // Android uses already fixed fonts. } if (!LookAndFeel::GetFont(StyleSystemFont::Menu, systemFontName, fontStyle)) { return; @@ -2014,7 +2022,7 @@ void gfxPlatformFontList::ResolveGenericFontNames( MOZ_ASSERT(langGroup, "null lang group for pref lang"); if (aGenericType == StyleGenericFontFamily::SystemUi) { - GetSystemUIFontFamilies(langGroup, genericFamilies); + GetSystemUIFontFamilies(aPresContext, langGroup, genericFamilies); } GetFontFamiliesFromGenericFamilies( ===================================== layout/base/nsLayoutUtils.cpp ===================================== @@ -9708,7 +9708,10 @@ static void GetSpoofedSystemFontForRFP(LookAndFeel::FontID aFontID, // does. aName = u"sans-serif"_ns; aStyle.size = 12; -#elif !defined(MOZ_WIDGET_ANDROID) +#elif defined(MOZ_WIDGET_ANDROID) + aName = u"Roboto"_ns; + aStyle.size = 12; +#else // On Linux, there is not a default. For example, GNOME on Debian uses // Cantarell, 14.667px. Ubuntu Mate uses the Ubuntu font, but also 14.667px. // Fedora with KDE uses Noto Sans, 13.3333px, but it uses Noto Sans on @@ -9719,7 +9722,6 @@ static void GetSpoofedSystemFontForRFP(LookAndFeel::FontID aFontID, aName = u"sans-serif"_ns; aStyle.size = 15; #endif - // No need to do anything on Android, as font and sizes are already fixed. } /* static */ View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/308… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/308… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][base-browser-115.10.0esr-13.5-1] fixup! Bug 41116: Normalize system fonts.
by richard (@richard) 17 Apr '24

17 Apr '24
richard pushed to branch base-browser-115.10.0esr-13.5-1 at The Tor Project / Applications / Tor Browser Commits: cf32ac1d by Pier Angelo Vendrame at 2024-04-17T20:02:25+00:00 fixup! Bug 41116: Normalize system fonts. Bug 42529: Fix the breakage of this patch on Android. Also, improve the patch hoping I can finally uplift it. - - - - - 2 changed files: - gfx/thebes/gfxPlatformFontList.cpp - layout/base/nsLayoutUtils.cpp Changes: ===================================== gfx/thebes/gfxPlatformFontList.cpp ===================================== @@ -38,6 +38,7 @@ #include "mozilla/dom/ContentChild.h" #include "mozilla/dom/ContentParent.h" #include "mozilla/dom/ContentProcessMessageManager.h" +#include "mozilla/dom/Document.h" #include "mozilla/gfx/2D.h" #include "mozilla/ipc/FileDescriptorUtils.h" #include "mozilla/ResultExtensions.h" @@ -1964,20 +1965,27 @@ void gfxPlatformFontList::MaybeRemoveCmap(gfxCharacterMap* aCharMap) { } } -static void GetSystemUIFontFamilies([[maybe_unused]] nsAtom* aLangGroup, +static void GetSystemUIFontFamilies(const nsPresContext* aPresContext, + [[maybe_unused]] nsAtom* aLangGroup, nsTArray<nsCString>& aFamilies) { // TODO: On macOS, use CTCreateUIFontForLanguage or such thing (though the // code below ends up using [NSFont systemFontOfSize: 0.0]. nsFont systemFont; gfxFontStyle fontStyle; nsAutoString systemFontName; - if (nsContentUtils::ShouldResistFingerprinting()) { + if (aPresContext && aPresContext->Document() + ? aPresContext->Document()->ShouldResistFingerprinting( + RFPTarget::Unknown) + : nsContentUtils::ShouldResistFingerprinting( + "aPresContext not available", RFPTarget::Unknown)) { #ifdef XP_MACOSX *aFamilies.AppendElement() = "-apple-system"_ns; -#else + return; +#elif !defined(MOZ_WIDGET_ANDROID) *aFamilies.AppendElement() = "sans-serif"_ns; -#endif return; +#endif + // Android uses already fixed fonts. } if (!LookAndFeel::GetFont(StyleSystemFont::Menu, systemFontName, fontStyle)) { return; @@ -2014,7 +2022,7 @@ void gfxPlatformFontList::ResolveGenericFontNames( MOZ_ASSERT(langGroup, "null lang group for pref lang"); if (aGenericType == StyleGenericFontFamily::SystemUi) { - GetSystemUIFontFamilies(langGroup, genericFamilies); + GetSystemUIFontFamilies(aPresContext, langGroup, genericFamilies); } GetFontFamiliesFromGenericFamilies( ===================================== layout/base/nsLayoutUtils.cpp ===================================== @@ -9708,7 +9708,10 @@ static void GetSpoofedSystemFontForRFP(LookAndFeel::FontID aFontID, // does. aName = u"sans-serif"_ns; aStyle.size = 12; -#elif !defined(MOZ_WIDGET_ANDROID) +#elif defined(MOZ_WIDGET_ANDROID) + aName = u"Roboto"_ns; + aStyle.size = 12; +#else // On Linux, there is not a default. For example, GNOME on Debian uses // Cantarell, 14.667px. Ubuntu Mate uses the Ubuntu font, but also 14.667px. // Fedora with KDE uses Noto Sans, 13.3333px, but it uses Noto Sans on @@ -9719,7 +9722,6 @@ static void GetSpoofedSystemFontForRFP(LookAndFeel::FontID aFontID, aName = u"sans-serif"_ns; aStyle.size = 15; #endif - // No need to do anything on Android, as font and sizes are already fixed. } /* static */ View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/cf32ac1… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/cf32ac1… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-115.10.0esr-13.5-1] fixup! Bug 41116: Normalize system fonts.
by richard (@richard) 17 Apr '24

17 Apr '24
richard pushed to branch tor-browser-115.10.0esr-13.5-1 at The Tor Project / Applications / Tor Browser Commits: 9b5ca8c0 by Pier Angelo Vendrame at 2024-04-17T19:39:04+00:00 fixup! Bug 41116: Normalize system fonts. Bug 42529: Fix the breakage of this patch on Android. Also, improve the patch hoping I can finally uplift it. - - - - - 2 changed files: - gfx/thebes/gfxPlatformFontList.cpp - layout/base/nsLayoutUtils.cpp Changes: ===================================== gfx/thebes/gfxPlatformFontList.cpp ===================================== @@ -38,6 +38,7 @@ #include "mozilla/dom/ContentChild.h" #include "mozilla/dom/ContentParent.h" #include "mozilla/dom/ContentProcessMessageManager.h" +#include "mozilla/dom/Document.h" #include "mozilla/gfx/2D.h" #include "mozilla/ipc/FileDescriptorUtils.h" #include "mozilla/ResultExtensions.h" @@ -1964,20 +1965,27 @@ void gfxPlatformFontList::MaybeRemoveCmap(gfxCharacterMap* aCharMap) { } } -static void GetSystemUIFontFamilies([[maybe_unused]] nsAtom* aLangGroup, +static void GetSystemUIFontFamilies(const nsPresContext* aPresContext, + [[maybe_unused]] nsAtom* aLangGroup, nsTArray<nsCString>& aFamilies) { // TODO: On macOS, use CTCreateUIFontForLanguage or such thing (though the // code below ends up using [NSFont systemFontOfSize: 0.0]. nsFont systemFont; gfxFontStyle fontStyle; nsAutoString systemFontName; - if (nsContentUtils::ShouldResistFingerprinting()) { + if (aPresContext && aPresContext->Document() + ? aPresContext->Document()->ShouldResistFingerprinting( + RFPTarget::Unknown) + : nsContentUtils::ShouldResistFingerprinting( + "aPresContext not available", RFPTarget::Unknown)) { #ifdef XP_MACOSX *aFamilies.AppendElement() = "-apple-system"_ns; -#else + return; +#elif !defined(MOZ_WIDGET_ANDROID) *aFamilies.AppendElement() = "sans-serif"_ns; -#endif return; +#endif + // Android uses already fixed fonts. } if (!LookAndFeel::GetFont(StyleSystemFont::Menu, systemFontName, fontStyle)) { return; @@ -2014,7 +2022,7 @@ void gfxPlatformFontList::ResolveGenericFontNames( MOZ_ASSERT(langGroup, "null lang group for pref lang"); if (aGenericType == StyleGenericFontFamily::SystemUi) { - GetSystemUIFontFamilies(langGroup, genericFamilies); + GetSystemUIFontFamilies(aPresContext, langGroup, genericFamilies); } GetFontFamiliesFromGenericFamilies( ===================================== layout/base/nsLayoutUtils.cpp ===================================== @@ -9708,7 +9708,10 @@ static void GetSpoofedSystemFontForRFP(LookAndFeel::FontID aFontID, // does. aName = u"sans-serif"_ns; aStyle.size = 12; -#elif !defined(MOZ_WIDGET_ANDROID) +#elif defined(MOZ_WIDGET_ANDROID) + aName = u"Roboto"_ns; + aStyle.size = 12; +#else // On Linux, there is not a default. For example, GNOME on Debian uses // Cantarell, 14.667px. Ubuntu Mate uses the Ubuntu font, but also 14.667px. // Fedora with KDE uses Noto Sans, 13.3333px, but it uses Noto Sans on @@ -9719,7 +9722,6 @@ static void GetSpoofedSystemFontForRFP(LookAndFeel::FontID aFontID, aName = u"sans-serif"_ns; aStyle.size = 15; #endif - // No need to do anything on Android, as font and sizes are already fixed. } /* static */ View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/9b5ca8c… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/9b5ca8c… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-115.10.0esr-13.5-1] 6 commits: fixup! Bug 30237: Add v3 onion services client authentication prompt
by richard (@richard) 17 Apr '24

17 Apr '24
richard pushed to branch tor-browser-115.10.0esr-13.5-1 at The Tor Project / Applications / Tor Browser Commits: 267147ef by Henry Wilkes at 2024-04-17T18:28:11+00:00 fixup! Bug 30237: Add v3 onion services client authentication prompt Bug 41622: Follow net error style from mozilla. We drop our additions to the page and work with the existing files from mozilla. - - - - - 79f14f9e by Henry Wilkes at 2024-04-17T18:28:11+00:00 fixup! Tor Browser strings Bug 41622: Move net error page strings to Fluent. - - - - - 57dffc45 by Henry Wilkes at 2024-04-17T18:28:11+00:00 fixup! Bug 23247: Communicating security expectations for .onion Bug 41622: Add context-stroke to onion-warning.svg. - - - - - 357c3281 by Henry Wilkes at 2024-04-17T18:28:11+00:00 fixup! Bug 2176: Rebrand Firefox to TorBrowser Bug 41622: Add context-stroke to onion-warning.svg. Also drop the unnecessary clip path. - - - - - 7f240934 by Henry Wilkes at 2024-04-17T18:28:11+00:00 fixup! Add TorStrings module for localization Bug 41622: Move the onion net error strings to Fluent. - - - - - 9967ae76 by Henry Wilkes at 2024-04-17T18:28:11+00:00 fixup! Tor Browser localization migration scripts. Bug 41622: Migrate onion net error strings to Fluent. - - - - - 20 changed files: - − browser/components/onionservices/content/netError/browser.svg - − browser/components/onionservices/content/netError/network.svg - − browser/components/onionservices/content/netError/onionNetError.css - − browser/components/onionservices/content/netError/onionNetError.js - − browser/components/onionservices/content/netError/onionsite.svg - browser/components/onionservices/jar.mn - browser/locales/en-US/browser/tor-browser.ftl - browser/themes/shared/identity-block/identity-block.css - browser/themes/shared/identity-block/onion-slash.svg - browser/themes/shared/identity-block/onion-warning.svg - docshell/base/nsDocShell.cpp - toolkit/actors/NetErrorChild.sys.mjs - toolkit/content/aboutNetError.mjs - toolkit/content/aboutNetError.xhtml - toolkit/modules/RemotePageAccessManager.sys.mjs - toolkit/modules/TorStrings.sys.mjs - toolkit/themes/shared/aboutNetError.css - toolkit/torbutton/chrome/locale/en-US/torbutton.properties - tools/lint/eslint/eslint-plugin-mozilla/lib/environments/remote-page.js - + tools/torbrowser/l10n/migrations/bug-41622-neterror.py Changes: ===================================== browser/components/onionservices/content/netError/browser.svg deleted ===================================== @@ -1,3 +0,0 @@ -<svg fill="none" height="60" viewBox="0 0 60 60" width="60" xmlns="http://www.w3.org/2000/svg"> - <path fill="context-fill" fill-opacity="context-fill-opacity" d="m49 6h-37.5c-1.98912 0-3.89678.79018-5.3033 2.1967s-2.1967 3.3142-2.1967 5.3033v33.75c0 1.9891.79018 3.8968 2.1967 5.3033s3.31418 2.1967 5.3033 2.1967h37.5c1.9891 0 3.8968-.7902 5.3033-2.1967s2.1967-3.3142 2.1967-5.3033v-33.75c0-1.9891-.7902-3.89678-2.1967-5.3033s-3.3142-2.1967-5.3033-2.1967zm-38.0625 4.6875h38.625l2.25 2.25v8.0625h-43.125v-8.0625zm38.625 39.375h-38.625l-2.25-2.25v-22.125h43.125v22.125z"/> -</svg> ===================================== browser/components/onionservices/content/netError/network.svg deleted ===================================== @@ -1,3 +0,0 @@ -<svg fill="none" height="60" viewBox="0 0 60 60" width="60" xmlns="http://www.w3.org/2000/svg"> - <path fill="context-fill" fill-opacity="context-fill-opacity" d="m30 1.875c-7.4592 0-14.6129 2.96316-19.8874 8.2376-5.27444 5.2745-8.2376 12.4282-8.2376 19.8874s2.96316 14.6129 8.2376 19.8874c5.2745 5.2744 12.4282 8.2376 19.8874 8.2376s14.6129-2.9632 19.8874-8.2376c5.2744-5.2745 8.2376-12.4282 8.2376-19.8874s-2.9632-14.6129-8.2376-19.8874c-5.2745-5.27444-12.4282-8.2376-19.8874-8.2376zm9.1762 6.5625c3.8504 1.6533 7.1876 4.3079 9.6646 7.6877 2.477 3.3799 4.0034 7.3615 4.4205 11.531h-8.3588c-.4617-6.9829-2.9858-13.6716-7.2525-19.2187zm-7.6837 0c5.0739 5.1814 8.1562 11.9874 8.7037 19.2187h-20.3924c.5475-7.2313 3.6298-14.0373 8.7037-19.2187zm-10.6725 0h1.53c-4.2651 5.548-6.789 12.2362-7.2525 19.2187h-8.35875c.41632-4.1692 1.942-8.1508 4.41835-11.5306 2.4764-3.3799 5.813-6.0346 9.6629-7.6881zm0 43.125c-3.8504-1.6528-7.1874-4.3074-9.6639-7.6874-2.47642-3.38-4.0018-7.3619-4.41735-11.5313h8.35875c.4617 6.9829 2.9858 13.6716 7.2525 19.2187zm7.6875 0c-5.0739-5.1814-8.1562-11.9874-8.7037-19.2187h20.3887c-.5475 7.2313-3.6298 14.0373-8.7037 19.2187zm10.6725 0h-1.5338c4.2683-5.5462 6.7926-12.2354 7.2525-19.2187h8.3588c-.4156 4.1689-1.9406 8.1504-4.4163 11.5302-2.4757 3.3799-5.8118 6.0348-9.6612 7.6885z"/> -</svg> ===================================== browser/components/onionservices/content/netError/onionNetError.css deleted ===================================== @@ -1,70 +0,0 @@ -/* Copyright (c) 2020, The Tor Project, Inc. */ - -#onionErrorDiagramContainer { - margin: 0px auto 40px 0px; - /* 3 icons 64px wide each seperated by a 64px gap */ - width: 384px; - display: grid; - grid-row-gap: 15px; - grid-column-gap: 64px; - grid-template-columns: 1fr 1fr 1fr; -} - -#onionErrorDiagramContainer > div { - margin: auto; - position: relative; /* needed to allow overlay of the ok or error icon */ -} - -.onionErrorImage { - width: 64px; - height: 64px; - background-size: 64px 64px; - background-position: center; - background-repeat: no-repeat; - -moz-context-properties: fill; - fill: var(--in-content-icon-color); - opacity: 50%; -} - -.onionErrorImage[status] { - opacity: 100%; -} - -#onionErrorBrowserImage { - background-image: url("browser.svg"); -} - -#onionErrorNetworkImage { - background-image: url("network.svg"); -} - -#onionErrorOnionSiteImage { - background-image: url("onionsite.svg"); -} - -/* rules to support overlay of the ok or error icon */ -.onionErrorImage[status]::after { - content: " "; - position: absolute; - left: -8px; - top: calc((64px - 24px) / 2); - width: 24px; - height: 24px; - -moz-context-properties: fill; - fill: var(--in-content-page-background); - - background-repeat: no-repeat; - background-position: center; - border: 3px solid var(--in-content-page-background); - border-radius: 50%; -} - -.onionErrorImage[status="ok"]::after { - background-color: var(--in-content-icon-color); - background-image: url("chrome://global/skin/icons/check.svg"); -} - -.onionErrorImage[status="error"]::after { - background-color: var(--warning-color); - background-image: url("chrome://global/skin/icons/close.svg"); -} ===================================== browser/components/onionservices/content/netError/onionNetError.js deleted ===================================== @@ -1,240 +0,0 @@ -// Copyright (c) 2020, The Tor Project, Inc. - -"use strict"; - -/* eslint-env mozilla/remote-page */ - -var OnionServicesAboutNetError = { - _selector: { - textContainer: "div#text-container", - header: ".title-text", - longDesc: "#errorLongDesc", - learnMoreContainer: "#learnMoreContainer", - learnMoreLink: "#learnMoreLink", - tryAgainButtonContainer: "#netErrorButtonContainer", - }, - _status: { - ok: "ok", - error: "error", - }, - - _diagramInfoMap: undefined, - - // Public functions (called from outside this file). - // - // This initPage() function may need to be updated if the structure of - // browser/base/content/aboutNetError.xhtml changes. Specifically, it - // references the following elements: - // query string parameter e - // class title-text - // id errorLongDesc - // id learnMoreContainer - // id learnMoreLink - // id errorLongContent - initPage(aDoc) { - const searchParams = new URLSearchParams(aDoc.documentURI.split("?")[1]); - const err = searchParams.get("e"); - - const errPrefix = "onionServices."; - const errName = err.substring(errPrefix.length); - - this._strings = RPMGetTorStrings(); - - const stringsObj = this._strings[errName]; - if (!stringsObj) { - return; - } - - this._insertStylesheet(aDoc); - - const pageTitle = stringsObj.pageTitle; - const header = stringsObj.header; - const longDescription = stringsObj.longDescription; // optional - const learnMoreURL = stringsObj.learnMoreURL; - - if (pageTitle) { - aDoc.title = pageTitle; - } - - if (header) { - const headerElem = aDoc.querySelector(this._selector.header); - if (headerElem) { - headerElem.textContent = header; - } - } - - const ld = aDoc.querySelector(this._selector.longDesc); - if (ld) { - if (longDescription) { - const hexErr = this._hexErrorFromName(errName); - ld.textContent = longDescription.replace("%S", hexErr); - } else { - // This onion service error does not have a long description. Since - // it is set to a generic error string by the code in - // browser/base/content/aboutNetError.js, hide it here. - ld.style.display = "none"; - } - } - - if (learnMoreURL) { - const lmContainer = aDoc.querySelector(this._selector.learnMoreContainer); - if (lmContainer) { - lmContainer.style.display = "block"; - } - const lmLink = lmContainer.querySelector(this._selector.learnMoreLink); - if (lmLink) { - lmLink.setAttribute("href", learnMoreURL); - } - } - - // Remove the "Try Again" button if the user made a typo in the .onion - // address since it is not useful in that case. - if (errName === "badAddress") { - const tryAgainButton = aDoc.querySelector( - this._selector.tryAgainButtonContainer - ); - if (tryAgainButton) { - tryAgainButton.style.display = "none"; - } - } - - this._insertDiagram(aDoc, errName); - }, // initPage() - - _insertStylesheet(aDoc) { - const url = - "chrome://browser/content/onionservices/netError/onionNetError.css"; - let linkElem = aDoc.createElement("link"); - linkElem.rel = "stylesheet"; - linkElem.href = url; - linkElem.type = "text/css"; - aDoc.head.appendChild(linkElem); - }, - - _insertDiagram(aDoc, aErrorName) { - // The onion error diagram consists of a grid of div elements. - // The first row contains three images (Browser, Network, Onionsite) and - // the second row contains labels for the images that are in the first row. - // The _diagramInfoMap describes for each type of onion service error - // whether a small ok or error status icon is overlaid on top of the main - // Browser/Network/Onionsite images. - if (!this._diagramInfoMap) { - this._diagramInfoMap = new Map(); - this._diagramInfoMap.set("descNotFound", { - browser: this._status.ok, - network: this._status.ok, - onionSite: this._status.error, - }); - this._diagramInfoMap.set("descInvalid", { - browser: this._status.ok, - network: this._status.error, - }); - this._diagramInfoMap.set("introFailed", { - browser: this._status.ok, - network: this._status.error, - }); - this._diagramInfoMap.set("rendezvousFailed", { - browser: this._status.ok, - network: this._status.error, - }); - this._diagramInfoMap.set("clientAuthMissing", { - browser: this._status.error, - }); - this._diagramInfoMap.set("clientAuthIncorrect", { - browser: this._status.error, - }); - this._diagramInfoMap.set("badAddress", { - browser: this._status.error, - }); - this._diagramInfoMap.set("introTimedOut", { - browser: this._status.ok, - network: this._status.error, - }); - } - - const diagramInfo = this._diagramInfoMap.get(aErrorName); - - const container = this._createDiv(aDoc, "onionErrorDiagramContainer"); - const imageClass = "onionErrorImage"; - - const browserImage = this._createDiv( - aDoc, - "onionErrorBrowserImage", - imageClass, - container - ); - if (diagramInfo && diagramInfo.browser) { - browserImage.setAttribute("status", diagramInfo.browser); - } - - const networkImage = this._createDiv( - aDoc, - "onionErrorNetworkImage", - imageClass, - container - ); - if (diagramInfo && diagramInfo.network) { - networkImage.setAttribute("status", diagramInfo.network); - } - - const onionSiteImage = this._createDiv( - aDoc, - "onionErrorOnionSiteImage", - imageClass, - container - ); - if (diagramInfo && diagramInfo.onionSite) { - onionSiteImage.setAttribute("status", diagramInfo.onionSite); - } - - let labelDiv = this._createDiv(aDoc, undefined, undefined, container); - labelDiv.textContent = this._strings.errorPage.browser; - labelDiv = this._createDiv(aDoc, undefined, undefined, container); - labelDiv.textContent = this._strings.errorPage.network; - labelDiv = this._createDiv(aDoc, undefined, undefined, container); - labelDiv.textContent = this._strings.errorPage.onionSite; - - const textContainer = aDoc.querySelector(this._selector.textContainer); - textContainer?.insertBefore(container, textContainer.firstChild); - }, // _insertDiagram() - - _createDiv(aDoc, aID, aClass, aParentElem) { - const div = aDoc.createElement("div"); - if (aID) { - div.id = aID; - } - if (aClass) { - div.setAttribute("class", aClass); - } - if (aParentElem) { - aParentElem.appendChild(div); - } - - return div; - }, - - _hexErrorFromName(aErrorName) { - // We do not have access to the original Tor SOCKS error code here, so - // perform a reverse mapping from the error name. - switch (aErrorName) { - case "descNotFound": - return "0xF0"; - case "descInvalid": - return "0xF1"; - case "introFailed": - return "0xF2"; - case "rendezvousFailed": - return "0xF3"; - case "clientAuthMissing": - return "0xF4"; - case "clientAuthIncorrect": - return "0xF5"; - case "badAddress": - return "0xF6"; - case "introTimedOut": - return "0xF7"; - } - - return ""; - }, -}; ===================================== browser/components/onionservices/content/netError/onionsite.svg deleted ===================================== @@ -1,8 +0,0 @@ -<svg fill="none" height="60" viewBox="0 0 60 60" width="60" xmlns="http://www.w3.org/2000/svg"> - <g fill="context-fill" fill-opacity="context-fill-opacity"> - <path clip-rule="evenodd" d="m11.25 6h37.5c1.9891 0 3.8968.79018 5.3033 2.1967s2.1967 3.3142 2.1967 5.3033v33.75c0 1.9891-.7902 3.8968-2.1967 5.3033s-3.3142 2.1967-5.3033 2.1967h-37.5c-1.98912 0-3.89678-.7902-5.3033-2.1967s-2.1967-3.3142-2.1967-5.3033v-33.75c0-1.9891.79018-3.89678 2.1967-5.3033s3.31418-2.1967 5.3033-2.1967zm-.5625 4.6875h38.625l2.25 2.25v34.875l-2.25 2.25h-38.625l-2.25-2.25v-34.875z" fill-rule="evenodd"/> - <path d="m15.9606 22c-.52 0-1.0187-.2107-1.3863-.5858-.3677-.3751-.5743-.8838-.5743-1.4142s.2066-1.0391.5743-1.4142c.3676-.3751.8663-.5858 1.3863-.5858h14.0788c.52 0 1.0187.2107 1.3863.5858.3677.3751.5743.8838.5743 1.4142s-.2066 1.0391-.5743 1.4142c-.3676.3751-.8663.5858-1.3863.5858z"/> - <path d="m44.0709 32h-28.1418c-.5116 0-1.0023-.2107-1.3641-.5858s-.565-.8838-.565-1.4142.2032-1.0391.565-1.4142.8525-.5858 1.3641-.5858h28.1418c.5116 0 1.0023.2107 1.3641.5858s.565.8838.565 1.4142-.2032 1.0391-.565 1.4142-.8525.5858-1.3641.5858z"/> - <path d="m44.0709 42h-28.1418c-.5116 0-1.0023-.2107-1.3641-.5858s-.565-.8838-.565-1.4142.2032-1.0391.565-1.4142.8525-.5858 1.3641-.5858h28.1418c.5116 0 1.0023.2107 1.3641.5858s.565.8838.565 1.4142-.2032 1.0391-.565 1.4142-.8525.5858-1.3641.5858z"/> - </g> -</svg> ===================================== browser/components/onionservices/jar.mn ===================================== @@ -2,7 +2,6 @@ browser.jar: content/browser/onionservices/authPreferences.css (content/authPreferences.css) content/browser/onionservices/authPreferences.js (content/authPreferences.js) content/browser/onionservices/authPrompt.js (content/authPrompt.js) - content/browser/onionservices/netError/ (content/netError/*) content/browser/onionservices/onionservices.css (content/onionservices.css) content/browser/onionservices/savedKeysDialog.js (content/savedKeysDialog.js) content/browser/onionservices/savedKeysDialog.xhtml (content/savedKeysDialog.xhtml) ===================================== browser/locales/en-US/browser/tor-browser.ftl ===================================== @@ -607,3 +607,26 @@ rulesets-details-scope-input = .placeholder = Regular expression for the scope of the rules # "Regular expression" refers to the computing term for a special pattern used for matching: https://en.wikipedia.org/wiki/Regular_expression. rulesets-details-scope-input-invalid = The scope could not be parsed as a regular expression + +## Onionsite error page. +## "Onionsite" is an abbreviation of "onion website": a website whose domain URL ends in ".onion", which is reachable through the Tor network. + +onion-neterror-page-title = Problem loading onionsite +onion-neterror-authorization-title = Authentication required +onion-neterror-not-found-header = Onionsite not found +onion-neterror-not-found-description = The most likely cause is that the onionsite is offline. Contact the onionsite administrator. +onion-neterror-unreachable-header = Onionsite cannot be reached +onion-neterror-unreachable-description = The onionsite is unreachable due an internal error. +onion-neterror-disconnected-header = Onionsite has disconnected +onion-neterror-disconnected-description = The most likely cause is that the onionsite is offline. Contact the onionsite administrator. +onion-neterror-connection-failed-header = Unable to connect to onionsite +onion-neterror-connection-failed-description = The onionsite is busy or the Tor network is overloaded. Try again later. +onion-neterror-missing-authentication-header = Onionsite requires authentication +onion-neterror-missing-authentication-description = Access to the onionsite requires a key but none was provided. +onion-neterror-incorrect-authentication-header = Onionsite authentication failed +onion-neterror-incorrect-authetication-description = The provided key is incorrect or has been revoked. Contact the onionsite administrator. +onion-neterror-invalid-address-header = Invalid onionsite address +onion-neterror-invalid-address-description = The provided onionsite address is invalid. Please check that you entered it correctly. +# "Circuit" refers to a Tor network circuit. +onion-neterror-timed-out-header = Onionsite circuit creation timed out +onion-neterror-timed-out-description = Failed to connect to the onionsite, possibly due to a poor network connection. ===================================== browser/themes/shared/identity-block/identity-block.css ===================================== @@ -204,6 +204,10 @@ #identity-box[pageproxystate="valid"].onionCertUserOverridden #identity-icon { list-style-image: url(chrome://browser/skin/onion-warning.svg); visibility: visible; + /* onion-warning includes another context-stroke color. Here we want it to + * match the context-fill color, which should be currentColor. */ + -moz-context-properties: fill, fill-opacity, stroke; + stroke: currentColor; } #identity-box[pageproxystate="valid"].onionMixedActiveContent #identity-icon { ===================================== browser/themes/shared/identity-block/onion-slash.svg ===================================== @@ -1,5 +1,4 @@ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> -<g clip-path="url(#clip0_1827_6565)"> <path d="M6.62435 8.54824C6.23983 8.91273 6 9.42836 6 10C6 11.1046 6.89543 12 8 12C8.57164 12 9.08727 11.7602 9.45176 11.3757L8.74414 10.668C8.56107 10.8718 8.29551 11 8 11C7.44772 11 7 10.5523 7 10C7 9.70449 7.12818 9.43893 7.33197 9.25586L6.62435 8.54824Z" fill-opacity="context-fill-opacity" fill="context-fill"/> <path d="M9.99442 10.1505C9.99812 10.1008 10 10.0506 10 10C10 8.89543 9.10457 8 8 8C7.94936 8 7.89915 8.00188 7.84946 8.00558L9.99442 10.1505Z" fill-opacity="context-fill-opacity" fill="context-fill"/> <path d="M5.20988 7.13377C4.46354 7.86041 4 8.87607 4 10C4 12.2091 5.79086 14 8 14C9.12393 14 10.1396 13.5365 10.8662 12.7901L10.159 12.0829C9.61343 12.6483 8.84778 13 8 13C6.34315 13 5 11.6569 5 10C5 9.15222 5.35166 8.38657 5.91707 7.84097L5.20988 7.13377Z" fill-opacity="context-fill-opacity" fill="context-fill"/> @@ -7,10 +6,4 @@ <path fill-rule="evenodd" clip-rule="evenodd" d="M14 10C14 8.223 13.2275 6.62643 12 5.52779V4C12 1.79086 10.2091 0 8 0C5.79086 0 4 1.79086 4 4V4.15613L5.50811 5.66423C6.2417 5.2417 7.09263 5 8 5C10.7614 5 13 7.23858 13 10C13 10.9074 12.7583 11.7583 12.3358 12.4919L13.0637 13.2199C13.6565 12.2896 14 11.1849 14 10ZM8 4C7.00883 4 6.0738 4.24033 5.25 4.66591V4C5.25 2.48122 6.48122 1.25 8 1.25C9.51878 1.25 10.75 2.48122 10.75 4V4.66591C9.9262 4.24033 8.99117 4 8 4Z" fill-opacity="context-fill-opacity" fill="context-fill"/> <path d="M12.2805 14.2044C11.1919 15.3126 9.67621 16 8 16C4.68629 16 2 13.3137 2 10C2 8.32379 2.68736 6.80812 3.79558 5.71948L4.50272 6.42662C3.57545 7.33427 3 8.59993 3 10C3 12.7614 5.23858 15 8 15C9.40007 15 10.6657 14.4246 11.5734 13.4973L12.2805 14.2044Z" fill-opacity="context-fill-opacity" fill="context-fill"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M1.25801 3.93806C1.50209 3.69398 1.89782 3.69398 2.14189 3.93806L13.1419 14.9381C13.386 15.1821 13.386 15.5779 13.1419 15.8219C12.8978 16.066 12.5021 16.066 12.258 15.8219L1.25801 4.82194C1.01393 4.57787 1.01393 4.18214 1.25801 3.93806Z" fill="#F90D3F"/> -</g> -<defs> -<clipPath id="clip0_1827_6565"> -<rect width="16" height="16" fill="white"/> -</clipPath> -</defs> </svg> ===================================== browser/themes/shared/identity-block/onion-warning.svg ===================================== @@ -1,13 +1,6 @@ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> -<g clip-path="url(#clip0_1827_6566)"> <path fill-rule="evenodd" clip-rule="evenodd" d="M7.92788 10.5342L7.42044 11.408C7.05803 11.7736 6.55546 12 6 12C4.89543 12 4 11.1046 4 10C4 8.89543 4.89543 8 6 8C7.10457 8 8 8.89543 8 10C8 10.185 7.97488 10.3641 7.92788 10.5342ZM7 10C7 10.5523 6.55228 11 6 11C5.44772 11 5 10.5523 5 10C5 9.44772 5.44772 9 6 9C6.55228 9 7 9.44772 7 10Z" fill-opacity="context-fill-opacity" fill="context-fill"/> <path d="M6.52221 12.9547C6.35262 12.9845 6.17812 13 6 13C4.34315 13 3 11.6569 3 10C3 8.34315 4.34315 7 6 7C7.30202 7 8.41032 7.82945 8.8253 8.98878L9.35089 8.08372C9.37772 8.03755 9.40587 7.99285 9.43523 7.94962C8.73673 6.78186 7.45967 6 6 6C3.79086 6 2 7.79086 2 10C2 12.1857 3.75302 13.9619 5.92975 13.9994C5.96208 13.9274 5.99884 13.8558 6.0402 13.7847L6.52221 12.9547Z" fill-opacity="context-fill-opacity" fill="context-fill"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M11.1978 7.00088C10.8782 6.44807 10.4728 5.95098 10 5.52779V4C10 1.79086 8.20914 0 6 0C3.79086 0 2 1.79086 2 4V5.52779C0.772501 6.62643 0 8.223 0 10C0 13.3137 2.68629 16 6 16C6.03024 16 6.06043 15.9998 6.09057 15.9993C5.89561 15.7007 5.77424 15.3557 5.749 14.9938C3.10419 14.8631 1 12.6773 1 10C1 7.23858 3.23858 5 6 5C7.75288 5 9.29509 5.90201 10.1878 7.26719C10.5002 7.0977 10.8482 7.00893 11.1978 7.00088ZM6 4C5.00883 4 4.0738 4.24033 3.25 4.66591V4C3.25 2.48122 4.48122 1.25 6 1.25C7.51878 1.25 8.75 2.48122 8.75 4V4.66591C7.9262 4.24033 6.99117 4 6 4Z" fill-opacity="context-fill-opacity" fill="context-fill"/> -<path d="M15.5956 14.2875L12.2846 8.58591C11.8306 7.8047 10.6696 7.8047 10.2156 8.58591L6.90465 14.2875C6.45865 15.0529 7.03065 16 7.93865 16H14.5616C15.4686 16 16.0406 15.0529 15.5956 14.2875ZM11.8746 12.4189C11.8746 12.5826 11.8088 12.7396 11.6916 12.8553C11.5744 12.9711 11.4154 13.0361 11.2496 13.0361C11.0839 13.0361 10.9249 12.9711 10.8077 12.8553C10.6905 12.7396 10.6246 12.5826 10.6246 12.4189V10.6935C10.6246 10.5298 10.6905 10.3728 10.8077 10.257C10.9249 10.1413 11.0839 10.0762 11.2496 10.0762C11.4154 10.0762 11.5744 10.1413 11.6916 10.257C11.8088 10.3728 11.8746 10.5298 11.8746 10.6935V12.4189ZM11.2496 15.0124C11.0839 15.0124 10.9249 14.9473 10.8077 14.8316C10.6905 14.7158 10.6246 14.5588 10.6246 14.3951C10.6246 14.2314 10.6905 14.0744 10.8077 13.9586C10.9249 13.8429 11.0839 13.7778 11.2496 13.7778C11.4154 13.7778 11.5744 13.8429 11.6916 13.9586C11.8088 14.0744 11.8746 14.2314 11.8746 14.3951C11.8746 14.5588 11.8088 14.7158 11.6916 14.8316C11.5744 14.9473 11.4154 15.0124 11.2496 15.0124Z" fill-opacity="context-fill-opacity" fill="context-fill"/> -</g> -<defs> -<clipPath id="clip0_1827_6566"> -<rect width="16" height="16" fill="white"/> -</clipPath> -</defs> +<path d="M15.5956 14.2875L12.2846 8.58591C11.8306 7.8047 10.6696 7.8047 10.2156 8.58591L6.90465 14.2875C6.45865 15.0529 7.03065 16 7.93865 16H14.5616C15.4686 16 16.0406 15.0529 15.5956 14.2875ZM11.8746 12.4189C11.8746 12.5826 11.8088 12.7396 11.6916 12.8553C11.5744 12.9711 11.4154 13.0361 11.2496 13.0361C11.0839 13.0361 10.9249 12.9711 10.8077 12.8553C10.6905 12.7396 10.6246 12.5826 10.6246 12.4189V10.6935C10.6246 10.5298 10.6905 10.3728 10.8077 10.257C10.9249 10.1413 11.0839 10.0762 11.2496 10.0762C11.4154 10.0762 11.5744 10.1413 11.6916 10.257C11.8088 10.3728 11.8746 10.5298 11.8746 10.6935V12.4189ZM11.2496 15.0124C11.0839 15.0124 10.9249 14.9473 10.8077 14.8316C10.6905 14.7158 10.6246 14.5588 10.6246 14.3951C10.6246 14.2314 10.6905 14.0744 10.8077 13.9586C10.9249 13.8429 11.0839 13.7778 11.2496 13.7778C11.4154 13.7778 11.5744 13.8429 11.6916 13.9586C11.8088 14.0744 11.8746 14.2314 11.8746 14.3951C11.8746 14.5588 11.8088 14.7158 11.6916 14.8316C11.5744 14.9473 11.4154 15.0124 11.2496 15.0124Z" fill-opacity="context-fill-opacity" fill="context-stroke"/> </svg> ===================================== docshell/base/nsDocShell.cpp ===================================== @@ -3695,6 +3695,7 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI* aURI, } else { // Errors requiring simple formatting bool isOnionAuthError = false; + bool isOnionError = false; switch (aError) { case NS_ERROR_MALFORMED_URI: // URI is malformed @@ -3778,29 +3779,37 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI* aURI, break; case NS_ERROR_TOR_ONION_SVC_NOT_FOUND: error = "onionServices.descNotFound"; + isOnionError = true; break; case NS_ERROR_TOR_ONION_SVC_IS_INVALID: error = "onionServices.descInvalid"; + isOnionError = true; break; case NS_ERROR_TOR_ONION_SVC_INTRO_FAILED: error = "onionServices.introFailed"; + isOnionError = true; break; case NS_ERROR_TOR_ONION_SVC_REND_FAILED: error = "onionServices.rendezvousFailed"; + isOnionError = true; break; case NS_ERROR_TOR_ONION_SVC_MISSING_CLIENT_AUTH: error = "onionServices.clientAuthMissing"; + isOnionError = true; isOnionAuthError = true; break; case NS_ERROR_TOR_ONION_SVC_BAD_CLIENT_AUTH: error = "onionServices.clientAuthIncorrect"; + isOnionError = true; isOnionAuthError = true; break; case NS_ERROR_TOR_ONION_SVC_BAD_ADDRESS: error = "onionServices.badAddress"; + isOnionError = true; break; case NS_ERROR_TOR_ONION_SVC_INTRO_TIMEDOUT: error = "onionServices.introTimedOut"; + isOnionError = true; break; default: break; @@ -3816,6 +3825,13 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI* aURI, // will mess with the failed channel information persistence! cssClass.AssignLiteral("onionAuthPrompt"); } + if (isOnionError) { + // DisplayLoadError requires a non-empty messageStr to proceed and call + // LoadErrorPage. We use a blank space. + if (messageStr.IsEmpty()) { + messageStr.AssignLiteral(u" "); + } + } } nsresult delegateErrorCode = aError; @@ -3902,20 +3918,6 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI* aURI, nsAutoString str; rv = stringBundle->FormatStringFromName(errorDescriptionID, formatStrs, str); - if (NS_FAILED(rv)) { - // As a fallback, check torbutton.properties for the error string. - const char bundleURL[] = "chrome://torbutton/locale/torbutton.properties"; - nsCOMPtr<nsIStringBundleService> stringBundleService = - components::StringBundle::Service(); - if (stringBundleService) { - nsCOMPtr<nsIStringBundle> tbStringBundle; - if (NS_SUCCEEDED(stringBundleService->CreateBundle( - bundleURL, getter_AddRefs(tbStringBundle)))) { - rv = tbStringBundle->FormatStringFromName(errorDescriptionID, - formatStrs, str); - } - } - } NS_ENSURE_SUCCESS(rv, rv); messageStr.Assign(str); } ===================================== toolkit/actors/NetErrorChild.sys.mjs ===================================== @@ -7,7 +7,6 @@ const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { AppInfo: "chrome://remote/content/shared/AppInfo.sys.mjs", - TorStrings: "resource://gre/modules/TorStrings.sys.mjs", }); import { RemotePageChild } from "resource://gre/actors/RemotePageChild.sys.mjs"; @@ -34,7 +33,6 @@ export class NetErrorChild extends RemotePageChild { "RPMIsSiteSpecificTRRError", "RPMSetTRRDisabledLoadFlags", "RPMGetCurrentTRRMode", - "RPMGetTorStrings", ]; this.exportFunctions(exportableFunctions); } @@ -246,8 +244,4 @@ export class NetErrorChild extends RemotePageChild { this.contentWindow.docShell.browsingContext.defaultLoadFlags |= Ci.nsIRequest.LOAD_TRR_DISABLED_MODE; } - - RPMGetTorStrings() { - return Cu.cloneInto(lazy.TorStrings.onionServices, this.contentWindow); - } } ===================================== toolkit/content/aboutNetError.mjs ===================================== @@ -4,7 +4,6 @@ /* eslint-env mozilla/remote-page */ /* eslint-disable import/no-unassigned-import */ -/* import-globals-from ../../browser/components/onionservices/content/netError/onionNetError.js */ import { parse, @@ -291,6 +290,92 @@ function recordTRREventTelemetry( } } +/** + * Initialize the onion error page. + * + * @return {boolean} Whether the page was initialized as an onion error page. + */ +function initOnionError() { + const docTitle = document.querySelector("title"); + + if (getCSSClass() === "onionAuthPrompt") { + // Only showing the authorization prompt. The page will be blank. + document.l10n.setAttributes(docTitle, "onion-neterror-authorization-title"); + return true; + } + + const onionErrors = { + // Tor SOCKS error 0xF0: + "onionServices.descNotFound": { + headerId: "onion-neterror-not-found-header", + descriptionId: "onion-neterror-not-found-description", + }, + // Tor SOCKS error 0xF1: + "onionServices.descInvalid": { + headerId: "onion-neterror-unreachable-header", + descriptionId: "onion-neterror-unreachable-description", + }, + // Tor SOCKS error 0xF2: + "onionServices.introFailed": { + headerId: "onion-neterror-disconnected-header", + descriptionId: "onion-neterror-disconnected-description", + }, + // Tor SOCKS error 0xF3: + "onionServices.rendezvousFailed": { + headerId: "onion-neterror-connection-failed-header", + descriptionId: "onion-neterror-connection-failed-description", + }, + // Tor SOCKS error 0xF4: + "onionServices.clientAuthMissing": { + headerId: "onion-neterror-missing-authentication-header", + descriptionId: "onion-neterror-missing-authentication-description", + }, + // Tor SOCKS error 0xF5: + "onionServices.clientAuthIncorrect": { + headerId: "onion-neterror-incorrect-authentication-header", + descriptionId: "onion-neterror-incorrect-authetication-description", + }, + // Tor SOCKS error 0xF6: + "onionServices.badAddress": { + headerId: "onion-neterror-invalid-address-header", + descriptionId: "onion-neterror-invalid-address-description", + }, + // Tor SOCKS error 0xF7: + "onionServices.introTimedOut": { + headerId: "onion-neterror-timed-out-header", + descriptionId: "onion-neterror-timed-out-description", + }, + }; + + if (!Object.hasOwn(onionErrors, gErrorCode)) { + return false; + } + + document.body.classList.add("onion-error"); + + document.l10n.setAttributes(docTitle, "onion-neterror-page-title"); + document.l10n.setAttributes( + document.querySelector(".title-text"), + onionErrors[gErrorCode].headerId + ); + document.l10n.setAttributes( + document.getElementById("errorShortDesc"), + onionErrors[gErrorCode].descriptionId + ); + + const tryAgain = document.getElementById("netErrorButtonContainer"); + tryAgain.hidden = false; + + const learnMore = document.getElementById("learnMoreContainer"); + learnMore.hidden = false; + const learnMoreLink = document.getElementById("learnMoreLink"); + learnMoreLink.href = "about:manual#onion-services"; + + setFocus("#netErrorButtonContainer > .try-again"); + + return true; +} + async function initPage() { // We show an offline support page in case of a system-wide error, // when a user cannot connect to the internet and access the SUMO website. @@ -314,7 +399,6 @@ async function initPage() { } const isTRROnlyFailure = gErrorCode == "dnsNotFound" && RPMIsTRROnlyFailure(); - const isOnionError = gErrorCode.startsWith("onionServices."); let isNativeFallbackWarning = false; if (RPMGetBoolPref("network.trr.display_fallback_warning")) { @@ -361,8 +445,7 @@ async function initPage() { document.body.classList.add("neterror"); - if (isOnionError) { - OnionServicesAboutNetError.initPage(document); + if (initOnionError()) { return; } ===================================== toolkit/content/aboutNetError.xhtml ===================================== @@ -16,6 +16,7 @@ <link rel="localization" href="branding/brand.ftl"/> <link rel="localization" href="toolkit/neterror/certError.ftl" /> <link rel="localization" href="toolkit/neterror/netError.ftl"/> + <link rel="localization" href="browser/tor-browser.ftl"/> </head> <body> @@ -123,6 +124,5 @@ </div> </body> <script src="chrome://global/content/neterror/aboutNetErrorCodes.js"></script> - <script src="chrome://browser/content/onionservices/netError/onionNetError.js"></script> <script type="module" src="chrome://global/content/aboutNetError.mjs"></script> </html> ===================================== toolkit/modules/RemotePageAccessManager.sys.mjs ===================================== @@ -119,7 +119,6 @@ export let RemotePageAccessManager = { RPMSetTRRDisabledLoadFlags: ["*"], RPMSendQuery: ["Browser:AddTRRExcludedDomain", "ShouldShowTorConnect"], RPMGetIntPref: ["network.trr.mode"], - RPMGetTorStrings: ["*"], }, "about:newtab": { RPMSendAsyncMessage: ["ActivityStream:ContentToMain"], ===================================== toolkit/modules/TorStrings.sys.mjs ===================================== @@ -231,124 +231,8 @@ const Loader = { ); const getString = tsb.getString.bind(tsb); - const kProblemLoadingSiteFallback = "Problem Loading Onionsite"; - const kLongDescFallback = "Details: %S"; - const retval = { learnMore: getString("learnMore", "Learn more"), - errorPage: { - browser: getString("errorPage.browser", "Browser"), - network: getString("errorPage.network", "Network"), - onionSite: getString("errorPage.onionSite", "Onionsite"), - }, - descNotFound: { - // Tor SOCKS error 0xF0 - pageTitle: getString( - "descNotFound.pageTitle", - kProblemLoadingSiteFallback - ), - header: getString("descNotFound.header", "Onionsite Not Found"), - longDescription: getString( - "descNotFound.longDescription", - kLongDescFallback - ), - }, - descInvalid: { - // Tor SOCKS error 0xF1 - pageTitle: getString( - "descInvalid.pageTitle", - kProblemLoadingSiteFallback - ), - header: getString("descInvalid.header", "Onionsite Cannot Be Reached"), - longDescription: getString( - "descInvalid.longDescription", - kLongDescFallback - ), - }, - introFailed: { - // Tor SOCKS error 0xF2 - pageTitle: getString( - "introFailed.pageTitle", - kProblemLoadingSiteFallback - ), - header: getString("introFailed.header", "Onionsite Has Disconnected"), - longDescription: getString( - "introFailed.longDescription", - kLongDescFallback - ), - }, - rendezvousFailed: { - // Tor SOCKS error 0xF3 - pageTitle: getString( - "rendezvousFailed.pageTitle", - kProblemLoadingSiteFallback - ), - header: getString( - "rendezvousFailed.header", - "Unable to Connect to Onionsite" - ), - longDescription: getString( - "rendezvousFailed.longDescription", - kLongDescFallback - ), - }, - clientAuthMissing: { - // Tor SOCKS error 0xF4 - pageTitle: getString( - "clientAuthMissing.pageTitle", - "Authorization Required" - ), - header: getString( - "clientAuthMissing.header", - "Onionsite Requires Authentication" - ), - longDescription: getString( - "clientAuthMissing.longDescription", - kLongDescFallback - ), - }, - clientAuthIncorrect: { - // Tor SOCKS error 0xF5 - pageTitle: getString( - "clientAuthIncorrect.pageTitle", - "Authorization Failed" - ), - header: getString( - "clientAuthIncorrect.header", - "Onionsite Authentication Failed" - ), - longDescription: getString( - "clientAuthIncorrect.longDescription", - kLongDescFallback - ), - }, - badAddress: { - // Tor SOCKS error 0xF6 - pageTitle: getString( - "badAddress.pageTitle", - kProblemLoadingSiteFallback - ), - header: getString("badAddress.header", "Invalid Onionsite Address"), - longDescription: getString( - "badAddress.longDescription", - kLongDescFallback - ), - }, - introTimedOut: { - // Tor SOCKS error 0xF7 - pageTitle: getString( - "introTimedOut.pageTitle", - kProblemLoadingSiteFallback - ), - header: getString( - "introTimedOut.header", - "Onionsite Circuit Creation Timed Out" - ), - longDescription: getString( - "introTimedOut.longDescription", - kLongDescFallback - ), - }, authPrompt: { description: getString( "authPrompt.description2", ===================================== toolkit/themes/shared/aboutNetError.css ===================================== @@ -8,11 +8,11 @@ body { --warning-color: #ffa436; } +/** + * Blank page whilst we show the prompt. + */ body.onionAuthPrompt { - background: white; -} -.onionAuthPrompt > * { - display: none; + display: none !important; } @media (prefers-color-scheme: dark) { @@ -50,6 +50,13 @@ body.certerror .title { color: var(--warning-color); } +body.onion-error .title { + background-image: url("chrome://browser/skin/onion-warning.svg"); + -moz-context-properties: fill, stroke; + fill: currentColor; + stroke: var(--warning-color); +} + body.blocked .title { background-image: url("chrome://global/skin/icons/blocked.svg"); } ===================================== toolkit/torbutton/chrome/locale/en-US/torbutton.properties ===================================== @@ -32,53 +32,6 @@ onionServices.authPreferences.removeAll=Remove All onionServices.authPreferences.failedToGetKeys=Unable to retrieve keys from tor onionServices.authPreferences.failedToRemoveKey=Unable to remove key -# Onion services error strings. -onionServices.errorPage.browser=Browser -onionServices.errorPage.network=Network -onionServices.errorPage.onionSite=Onionsite -# LOCALIZATION NOTE: In the longDescription strings, %S will be replaced with -# an error code, e.g., 0xF3. -# Tor SOCKS error 0xF0: -onionServices.descNotFound.pageTitle=Problem Loading Onionsite -onionServices.descNotFound.header=Onionsite Not Found -onionServices.descNotFound=The most likely cause is that the onionsite is offline. Contact the onionsite administrator. -onionServices.descNotFound.longDescription=Details: %S — The requested onion service descriptor can't be found on the hashring and therefore the service is not reachable by the client. -# Tor SOCKS error 0xF1: -onionServices.descInvalid.pageTitle=Problem Loading Onionsite -onionServices.descInvalid.header=Onionsite Cannot Be Reached -onionServices.descInvalid=The onionsite is unreachable due an internal error. -onionServices.descInvalid.longDescription=Details: %S — The requested onion service descriptor can't be parsed or signature validation failed. -# Tor SOCKS error 0xF2: -onionServices.introFailed.pageTitle=Problem Loading Onionsite -onionServices.introFailed.header=Onionsite Has Disconnected -onionServices.introFailed=The most likely cause is that the onionsite is offline. Contact the onionsite administrator. -onionServices.introFailed.longDescription=Details: %S — Introduction failed, which means that the descriptor was found but the service is no longer connected to the introduction point. It is likely that the service has changed its descriptor or that it is not running. -# Tor SOCKS error 0xF3: -onionServices.rendezvousFailed.pageTitle=Problem Loading Onionsite -onionServices.rendezvousFailed.header=Unable to Connect to Onionsite -onionServices.rendezvousFailed=The onionsite is busy or the Tor network is overloaded. Try again later. -onionServices.rendezvousFailed.longDescription=Details: %S — The client failed to rendezvous with the service, which means that the client was unable to finalize the connection. -# Tor SOCKS error 0xF4: -onionServices.clientAuthMissing.pageTitle=Authorization Required -onionServices.clientAuthMissing.header=Onionsite Requires Authentication -onionServices.clientAuthMissing=Access to the onionsite requires a key but none was provided. -onionServices.clientAuthMissing.longDescription=Details: %S — The client downloaded the requested onion service descriptor but was unable to decrypt its content because client authorization information is missing. -# Tor SOCKS error 0xF5: -onionServices.clientAuthIncorrect.pageTitle=Authorization Failed -onionServices.clientAuthIncorrect.header=Onionsite Authentication Failed -onionServices.clientAuthIncorrect=The provided key is incorrect or has been revoked. Contact the onionsite administrator. -onionServices.clientAuthIncorrect.longDescription=Details: %S — The client was able to download the requested onion service descriptor but was unable to decrypt its content using the provided client authorization information. This may mean that access has been revoked. -# Tor SOCKS error 0xF6: -onionServices.badAddress.pageTitle=Problem Loading Onionsite -onionServices.badAddress.header=Invalid Onionsite Address -onionServices.badAddress=The provided onionsite address is invalid. Please check that you entered it correctly. -onionServices.badAddress.longDescription=Details: %S — The provided .onion address is invalid. This error is returned due to one of the following reasons: the address checksum doesn't match, the ed25519 public key is invalid, or the encoding is invalid. -# Tor SOCKS error 0xF7: -onionServices.introTimedOut.pageTitle=Problem Loading Onionsite -onionServices.introTimedOut.header=Onionsite Circuit Creation Timed Out -onionServices.introTimedOut=Failed to connect to the onionsite, possibly due to a poor network connection. -onionServices.introTimedOut.longDescription=Details: %S — The connection to the requested onion service timed out while trying to build the rendezvous circuit. - # Profile/startup error messages. # LOCALIZATION NOTE: %S is the application name. profileProblemTitle=%S Profile Problem ===================================== tools/lint/eslint/eslint-plugin-mozilla/lib/environments/remote-page.js ===================================== @@ -39,6 +39,5 @@ module.exports = { RPMGetTRRDomain: false, RPMIsSiteSpecificTRRError: false, RPMSetTRRDisabledLoadFlags: false, - RPMGetTorStrings: false, }, }; ===================================== tools/torbrowser/l10n/migrations/bug-41622-neterror.py ===================================== @@ -0,0 +1,21 @@ +from fluent.migrate.helpers import transforms_from + + +def migrate(ctx): + ctx.add_transforms( + "tor-browser.ftl", + "tor-browser.ftl", + transforms_from( + """ +onion-neterror-not-found-description = { COPY(path, "onionServices.descNotFound") } +onion-neterror-unreachable-description = { COPY(path, "onionServices.descInvalid") } +onion-neterror-disconnected-description = { COPY(path, "onionServices.introFailed") } +onion-neterror-connection-failed-description = { COPY(path, "onionServices.rendezvousFailed") } +onion-neterror-missing-authentication-description = { COPY(path, "onionServices.clientAuthMissing") } +onion-neterror-incorrect-authetication-description = { COPY(path, "onionServices.clientAuthIncorrect") } +onion-neterror-invalid-address-description = { COPY(path, "onionServices.badAddress") } +onion-neterror-timed-out-description = { COPY(path, "onionServices.introTimedOut") } +""", + path="torbutton.properties", + ), + ) View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/795d4d… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/795d4d… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/mullvad-browser][mullvad-browser-115.10.0esr-13.5-1] fixup! Bug 9173: Change the default Firefox profile directory to be relative.
by richard (@richard) 17 Apr '24

17 Apr '24
richard pushed to branch mullvad-browser-115.10.0esr-13.5-1 at The Tor Project / Applications / Mullvad Browser Commits: 2b80b110 by Pier Angelo Vendrame at 2024-04-17T18:14:53+00:00 fixup! Bug 9173: Change the default Firefox profile directory to be relative. Bug 42519: Disable portable mode also if is-packaged-app is present. That is the file Firefox uses for .deb packages. - - - - - 2 changed files: - toolkit/xre/nsXREDirProvider.cpp - xpcom/io/nsAppFileLocationProvider.cpp Changes: ===================================== toolkit/xre/nsXREDirProvider.cpp ===================================== @@ -1282,19 +1282,30 @@ nsresult nsXREDirProvider::GetPortableDataDir(nsIFile** aFile, } # endif - nsCOMPtr<nsIFile> systemInstallFile; - rv = exeDir->Clone(getter_AddRefs(systemInstallFile)); - NS_ENSURE_SUCCESS(rv, rv); - rv = systemInstallFile->AppendNative("system-install"_ns); - NS_ENSURE_SUCCESS(rv, rv); +# if defined(MOZ_WIDGET_GTK) + // On Linux, Firefox supports the is-packaged-app for the .deb distribution. + // We cannot use mozilla::widget::IsPackagedAppFileExists because it relies on + // this service to be initialized, but this function is called during the + // initialization. Therefore, we need to re-implement this check. + nsLiteralCString systemInstallNames[] = {"system-install"_ns, + "is-packaged-app"_ns}; +# else + nsLiteralCString systemInstallNames[] = {"system-install"_ns}; +# endif + for (const nsLiteralCString& fileName : systemInstallNames) { + nsCOMPtr<nsIFile> systemInstallFile; + rv = exeDir->Clone(getter_AddRefs(systemInstallFile)); + NS_ENSURE_SUCCESS(rv, rv); + rv = systemInstallFile->AppendNative(fileName); + NS_ENSURE_SUCCESS(rv, rv); - bool exists = false; - rv = systemInstallFile->Exists(&exists); - NS_ENSURE_SUCCESS(rv, rv); - if (exists) { - aIsPortable = false; - gDataDirPortable.emplace(nullptr); - return NS_OK; + bool exists = false; + rv = systemInstallFile->Exists(&exists); + NS_ENSURE_SUCCESS(rv, rv); + if (exists) { + gDataDirPortable.emplace(nullptr); + return NS_OK; + } } nsCOMPtr<nsIFile> localDir = exeDir; ===================================== xpcom/io/nsAppFileLocationProvider.cpp ===================================== @@ -195,18 +195,27 @@ static nsresult SetupPortableMode(nsIFile** aDirectory, bool aLocal, } # endif - nsCOMPtr<nsIFile> systemInstallFile; - rv = exeDir->Clone(getter_AddRefs(systemInstallFile)); - NS_ENSURE_SUCCESS(rv, rv); - rv = systemInstallFile->AppendNative("system-install"_ns); - NS_ENSURE_SUCCESS(rv, rv); +# if defined(MOZ_WIDGET_GTK) + // On Linux, Firefox supports the is-packaged-app for the .deb distribution. + nsLiteralCString systemInstallNames[] = {"system-install"_ns, + "is-packaged-app"_ns}; +# else + nsLiteralCString systemInstallNames[] = {"system-install"_ns}; +# endif + for (const nsLiteralCString& fileName : systemInstallNames) { + nsCOMPtr<nsIFile> systemInstallFile; + rv = exeDir->Clone(getter_AddRefs(systemInstallFile)); + NS_ENSURE_SUCCESS(rv, rv); + rv = systemInstallFile->AppendNative(fileName); + NS_ENSURE_SUCCESS(rv, rv); - bool exists = false; - rv = systemInstallFile->Exists(&exists); - NS_ENSURE_SUCCESS(rv, rv); - if (exists) { - aIsPortable = false; - return NS_OK; + bool exists = false; + rv = systemInstallFile->Exists(&exists); + NS_ENSURE_SUCCESS(rv, rv); + if (exists) { + aIsPortable = false; + return NS_OK; + } } nsCOMPtr<nsIFile> localDir = exeDir; @@ -226,6 +235,7 @@ static nsresult SetupPortableMode(nsIFile** aDirectory, bool aLocal, NS_ENSURE_SUCCESS(rv, rv); } + bool exists = false; rv = localDir->Exists(&exists); NS_ENSURE_SUCCESS(rv, rv); if (!exists) { View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/2b8… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/2b8… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][base-browser-115.10.0esr-13.5-1] fixup! Bug 9173: Change the default Firefox profile directory to be relative.
by richard (@richard) 17 Apr '24

17 Apr '24
richard pushed to branch base-browser-115.10.0esr-13.5-1 at The Tor Project / Applications / Tor Browser Commits: dee316e4 by Pier Angelo Vendrame at 2024-04-17T18:13:39+00:00 fixup! Bug 9173: Change the default Firefox profile directory to be relative. Bug 42519: Disable portable mode also if is-packaged-app is present. That is the file Firefox uses for .deb packages. - - - - - 2 changed files: - toolkit/xre/nsXREDirProvider.cpp - xpcom/io/nsAppFileLocationProvider.cpp Changes: ===================================== toolkit/xre/nsXREDirProvider.cpp ===================================== @@ -1282,19 +1282,30 @@ nsresult nsXREDirProvider::GetPortableDataDir(nsIFile** aFile, } # endif - nsCOMPtr<nsIFile> systemInstallFile; - rv = exeDir->Clone(getter_AddRefs(systemInstallFile)); - NS_ENSURE_SUCCESS(rv, rv); - rv = systemInstallFile->AppendNative("system-install"_ns); - NS_ENSURE_SUCCESS(rv, rv); +# if defined(MOZ_WIDGET_GTK) + // On Linux, Firefox supports the is-packaged-app for the .deb distribution. + // We cannot use mozilla::widget::IsPackagedAppFileExists because it relies on + // this service to be initialized, but this function is called during the + // initialization. Therefore, we need to re-implement this check. + nsLiteralCString systemInstallNames[] = {"system-install"_ns, + "is-packaged-app"_ns}; +# else + nsLiteralCString systemInstallNames[] = {"system-install"_ns}; +# endif + for (const nsLiteralCString& fileName : systemInstallNames) { + nsCOMPtr<nsIFile> systemInstallFile; + rv = exeDir->Clone(getter_AddRefs(systemInstallFile)); + NS_ENSURE_SUCCESS(rv, rv); + rv = systemInstallFile->AppendNative(fileName); + NS_ENSURE_SUCCESS(rv, rv); - bool exists = false; - rv = systemInstallFile->Exists(&exists); - NS_ENSURE_SUCCESS(rv, rv); - if (exists) { - aIsPortable = false; - gDataDirPortable.emplace(nullptr); - return NS_OK; + bool exists = false; + rv = systemInstallFile->Exists(&exists); + NS_ENSURE_SUCCESS(rv, rv); + if (exists) { + gDataDirPortable.emplace(nullptr); + return NS_OK; + } } nsCOMPtr<nsIFile> localDir = exeDir; ===================================== xpcom/io/nsAppFileLocationProvider.cpp ===================================== @@ -195,18 +195,27 @@ static nsresult SetupPortableMode(nsIFile** aDirectory, bool aLocal, } # endif - nsCOMPtr<nsIFile> systemInstallFile; - rv = exeDir->Clone(getter_AddRefs(systemInstallFile)); - NS_ENSURE_SUCCESS(rv, rv); - rv = systemInstallFile->AppendNative("system-install"_ns); - NS_ENSURE_SUCCESS(rv, rv); +# if defined(MOZ_WIDGET_GTK) + // On Linux, Firefox supports the is-packaged-app for the .deb distribution. + nsLiteralCString systemInstallNames[] = {"system-install"_ns, + "is-packaged-app"_ns}; +# else + nsLiteralCString systemInstallNames[] = {"system-install"_ns}; +# endif + for (const nsLiteralCString& fileName : systemInstallNames) { + nsCOMPtr<nsIFile> systemInstallFile; + rv = exeDir->Clone(getter_AddRefs(systemInstallFile)); + NS_ENSURE_SUCCESS(rv, rv); + rv = systemInstallFile->AppendNative(fileName); + NS_ENSURE_SUCCESS(rv, rv); - bool exists = false; - rv = systemInstallFile->Exists(&exists); - NS_ENSURE_SUCCESS(rv, rv); - if (exists) { - aIsPortable = false; - return NS_OK; + bool exists = false; + rv = systemInstallFile->Exists(&exists); + NS_ENSURE_SUCCESS(rv, rv); + if (exists) { + aIsPortable = false; + return NS_OK; + } } nsCOMPtr<nsIFile> localDir = exeDir; @@ -226,6 +235,7 @@ static nsresult SetupPortableMode(nsIFile** aDirectory, bool aLocal, NS_ENSURE_SUCCESS(rv, rv); } + bool exists = false; rv = localDir->Exists(&exists); NS_ENSURE_SUCCESS(rv, rv); if (!exists) { View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/dee316e… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/dee316e… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-115.10.0esr-13.5-1] fixup! Bug 9173: Change the default Firefox profile directory to be relative.
by richard (@richard) 17 Apr '24

17 Apr '24
richard pushed to branch tor-browser-115.10.0esr-13.5-1 at The Tor Project / Applications / Tor Browser Commits: 795d4d37 by Pier Angelo Vendrame at 2024-04-17T17:59:38+00:00 fixup! Bug 9173: Change the default Firefox profile directory to be relative. Bug 42519: Disable portable mode also if is-packaged-app is present. That is the file Firefox uses for .deb packages. - - - - - 2 changed files: - toolkit/xre/nsXREDirProvider.cpp - xpcom/io/nsAppFileLocationProvider.cpp Changes: ===================================== toolkit/xre/nsXREDirProvider.cpp ===================================== @@ -1285,19 +1285,30 @@ nsresult nsXREDirProvider::GetPortableDataDir(nsIFile** aFile, } # endif - nsCOMPtr<nsIFile> systemInstallFile; - rv = exeDir->Clone(getter_AddRefs(systemInstallFile)); - NS_ENSURE_SUCCESS(rv, rv); - rv = systemInstallFile->AppendNative("system-install"_ns); - NS_ENSURE_SUCCESS(rv, rv); +# if defined(MOZ_WIDGET_GTK) + // On Linux, Firefox supports the is-packaged-app for the .deb distribution. + // We cannot use mozilla::widget::IsPackagedAppFileExists because it relies on + // this service to be initialized, but this function is called during the + // initialization. Therefore, we need to re-implement this check. + nsLiteralCString systemInstallNames[] = {"system-install"_ns, + "is-packaged-app"_ns}; +# else + nsLiteralCString systemInstallNames[] = {"system-install"_ns}; +# endif + for (const nsLiteralCString& fileName : systemInstallNames) { + nsCOMPtr<nsIFile> systemInstallFile; + rv = exeDir->Clone(getter_AddRefs(systemInstallFile)); + NS_ENSURE_SUCCESS(rv, rv); + rv = systemInstallFile->AppendNative(fileName); + NS_ENSURE_SUCCESS(rv, rv); - bool exists = false; - rv = systemInstallFile->Exists(&exists); - NS_ENSURE_SUCCESS(rv, rv); - if (exists) { - aIsPortable = false; - gDataDirPortable.emplace(nullptr); - return NS_OK; + bool exists = false; + rv = systemInstallFile->Exists(&exists); + NS_ENSURE_SUCCESS(rv, rv); + if (exists) { + gDataDirPortable.emplace(nullptr); + return NS_OK; + } } nsCOMPtr<nsIFile> localDir = exeDir; ===================================== xpcom/io/nsAppFileLocationProvider.cpp ===================================== @@ -195,18 +195,27 @@ static nsresult SetupPortableMode(nsIFile** aDirectory, bool aLocal, } # endif - nsCOMPtr<nsIFile> systemInstallFile; - rv = exeDir->Clone(getter_AddRefs(systemInstallFile)); - NS_ENSURE_SUCCESS(rv, rv); - rv = systemInstallFile->AppendNative("system-install"_ns); - NS_ENSURE_SUCCESS(rv, rv); +# if defined(MOZ_WIDGET_GTK) + // On Linux, Firefox supports the is-packaged-app for the .deb distribution. + nsLiteralCString systemInstallNames[] = {"system-install"_ns, + "is-packaged-app"_ns}; +# else + nsLiteralCString systemInstallNames[] = {"system-install"_ns}; +# endif + for (const nsLiteralCString& fileName : systemInstallNames) { + nsCOMPtr<nsIFile> systemInstallFile; + rv = exeDir->Clone(getter_AddRefs(systemInstallFile)); + NS_ENSURE_SUCCESS(rv, rv); + rv = systemInstallFile->AppendNative(fileName); + NS_ENSURE_SUCCESS(rv, rv); - bool exists = false; - rv = systemInstallFile->Exists(&exists); - NS_ENSURE_SUCCESS(rv, rv); - if (exists) { - aIsPortable = false; - return NS_OK; + bool exists = false; + rv = systemInstallFile->Exists(&exists); + NS_ENSURE_SUCCESS(rv, rv); + if (exists) { + aIsPortable = false; + return NS_OK; + } } nsCOMPtr<nsIFile> localDir = exeDir; @@ -226,6 +235,7 @@ static nsresult SetupPortableMode(nsIFile** aDirectory, bool aLocal, NS_ENSURE_SUCCESS(rv, rv); } + bool exists = false; rv = localDir->Exists(&exists); NS_ENSURE_SUCCESS(rv, rv); if (!exists) { View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/795d4d3… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/795d4d3… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/firefox-android][firefox-android-115.2.1-13.5-1] fixup! Implement Android-native Connection Assist UI
by Dan Ballard (@dan) 17 Apr '24

17 Apr '24
Dan Ballard pushed to branch firefox-android-115.2.1-13.5-1 at The Tor Project / Applications / firefox-android Commits: 1b8ed990 by clairehurst at 2024-04-17T16:37:37+00:00 fixup! Implement Android-native Connection Assist UI - - - - - 2 changed files: - fenix/app/src/main/java/org/mozilla/fenix/tor/TorConnectionAssistFragment.kt - fenix/app/src/main/res/layout/fragment_tor_connection_assist.xml Changes: ===================================== fenix/app/src/main/java/org/mozilla/fenix/tor/TorConnectionAssistFragment.kt ===================================== @@ -102,7 +102,6 @@ class TorConnectionAssistFragment : Fragment() { binding.torConnectImage.visibility = View.GONE binding.titleLargeTextView.visibility = View.GONE binding.titleDescription.visibility = View.GONE - binding.quickStartDescription.visibility = View.GONE binding.quickstartSwitch.visibility = View.GONE binding.torBootstrapButton1.visibility = View.GONE binding.torBootstrapButton2.visibility = View.GONE @@ -128,7 +127,6 @@ class TorConnectionAssistFragment : Fragment() { binding.titleDescription.visibility = View.VISIBLE binding.titleDescription.text = getString(R.string.preferences_tor_network_settings_explanation) - binding.quickStartDescription.visibility = View.VISIBLE binding.quickstartSwitch.visibility = View.VISIBLE binding.quickstartSwitch.isChecked = viewModel.quickstartToggle().value == true @@ -172,7 +170,6 @@ class TorConnectionAssistFragment : Fragment() { binding.quickstartSwitch.visibility = View.VISIBLE binding.quickstartSwitch.isChecked = viewModel.quickstartToggle().value == true binding.quickstartSwitch.jumpDrawablesToCurrentState() - binding.quickStartDescription.visibility = View.VISIBLE binding.torBootstrapButton1.visibility = View.INVISIBLE binding.torBootstrapButton2.visibility = View.VISIBLE binding.torBootstrapButton2.text = getString(R.string.btn_cancel) @@ -221,7 +218,6 @@ class TorConnectionAssistFragment : Fragment() { ) handleDescriptionWithClickable(internetErrorDescription, learnMore) - binding.quickStartDescription.visibility = View.GONE binding.quickstartSwitch.visibility = View.GONE binding.torBootstrapButton1.visibility = View.VISIBLE @@ -249,7 +245,6 @@ class TorConnectionAssistFragment : Fragment() { getString(R.string.connection_assist_trying_again_waiting_title) binding.quickstartSwitch.visibility = View.GONE - binding.quickStartDescription.visibility = View.GONE binding.torBootstrapButton1.visibility = View.INVISIBLE binding.torBootstrapButton2.visibility = View.VISIBLE binding.torBootstrapButton2.text = getString(R.string.btn_cancel) @@ -282,7 +277,6 @@ class TorConnectionAssistFragment : Fragment() { ) handleDescriptionWithClickable(tryABridge, learnMore) - binding.quickStartDescription.visibility = View.GONE binding.quickstartSwitch.visibility = View.GONE binding.unblockTheInternetInCountryDescription.visibility = View.VISIBLE binding.countryDropDown.visibility = View.VISIBLE ===================================== fenix/app/src/main/res/layout/fragment_tor_connection_assist.xml ===================================== @@ -70,85 +70,52 @@ android:visibility="visible" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/tor_bootstrap_progress_bar" - app:layout_constraintVertical_bias="0.075" + app:layout_constraintTop_toBottomOf="@+id/back_button" + app:layout_constraintVertical_bias="0.05" app:srcCompat="@drawable/connect" /> <TextView android:id="@+id/title_large_text_view" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginStart="24dp" - android:layout_marginEnd="24dp" + android:layout_marginTop="24dp" + android:paddingHorizontal="24dp" android:text="@string/connection_assist_tor_connect_title" android:textColor="#FBFBFE" android:textSize="22sp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@id/tor_connect_image" - app:layout_constraintVertical_bias="0.03" /> + app:layout_constraintTop_toBottomOf="@id/tor_connect_image" /> <TextView android:id="@+id/title_description" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginStart="24dp" - android:layout_marginEnd="24dp" android:lineSpacingExtra="6dp" + android:paddingHorizontal="24dp" + android:paddingVertical="16dp" android:text="@string/preferences_tor_network_settings_explanation" android:textColor="#FBFBFE" android:textSize="14sp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.0" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@id/title_large_text_view" - app:layout_constraintVertical_bias="0.03" /> - - - <TextView - android:id="@+id/quick_start_description" - android:layout_width="230dp" - android:layout_height="wrap_content" - android:layout_marginStart="24dp" - android:text="@string/connection_assist_always_connect_automatically_toggle_description" - android:textColor="#FBFBFE" - android:textSize="14sp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/title_description" - app:layout_constraintVertical_bias=".03" /> + app:layout_constraintTop_toBottomOf="@id/title_large_text_view" /> <androidx.appcompat.widget.SwitchCompat android:id="@+id/quickstart_switch" - android:layout_width="wrap_content" + android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginStart="100dp" - android:layout_marginEnd="24dp" - android:layout_marginBottom="24dp" - android:gravity="center" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0" - app:layout_constraintStart_toEndOf="@+id/quick_start_description" - app:layout_constraintTop_toBottomOf="@id/title_description" - app:layout_constraintVertical_bias=".023" - app:layout_goneMarginEnd="6dp" - app:layout_goneMarginTop="9dp" /> + android:paddingHorizontal="24dp" + android:paddingVertical="8dp" + android:text="@string/connection_assist_always_connect_automatically_toggle_description" + android:textColor="#FBFBFE" + app:layout_constraintTop_toBottomOf="@id/title_description" /> <TextView android:id="@+id/unblock_the_internet_in_country_description" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginStart="24dp" + android:paddingHorizontal="24dp" android:layout_marginTop="24dp" - android:layout_marginEnd="24dp" android:text="@string/connection_assist_unblock_the_internet_in_country_or_region" android:textColor="#FBFBFE" - android:visibility="invisible" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" + android:visibility="gone" app:layout_constraintTop_toBottomOf="@id/title_description" /> <androidx.appcompat.widget.AppCompatSpinner @@ -161,7 +128,7 @@ android:layout_marginEnd="24dp" android:textColor="#FBFBFE" android:tooltipText="@string/connection_assist_share_my_location_country_or_region" - android:visibility="invisible" + android:visibility="gone" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/unblock_the_internet_in_country_description" /> @@ -170,13 +137,14 @@ android:id="@+id/wordmarkLogo" android:layout_width="160dp" android:layout_height="160dp" + android:contentDescription="" android:src="@mipmap/ic_launcher_round" + android:visibility="gone" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - android:contentDescription="" /> + app:layout_constraintTop_toTopOf="parent" /> <Button android:id="@+id/tor_bootstrap_button_1" @@ -195,9 +163,7 @@ android:textStyle="bold" app:layout_constraintBottom_toTopOf="@id/tor_bootstrap_button_2" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/quickstart_switch" - app:layout_constraintVertical_bias="1" /> + app:layout_constraintStart_toStartOf="parent" /> <Button android:id="@+id/tor_bootstrap_button_2" View it on GitLab: https://gitlab.torproject.org/tpo/applications/firefox-android/-/commit/1b8… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/firefox-android/-/commit/1b8… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/mullvad-browser][mullvad-browser-115.10.0esr-13.5-1] Bug 42528: Don't leak system scrollbar size on windows.
by Pier Angelo Vendrame (@pierov) 17 Apr '24

17 Apr '24
Pier Angelo Vendrame pushed to branch mullvad-browser-115.10.0esr-13.5-1 at The Tor Project / Applications / Mullvad Browser Commits: 1908311e by Henry Wilkes at 2024-04-17T18:10:56+02:00 Bug 42528: Don&#39;t leak system scrollbar size on windows. - - - - - 2 changed files: - widget/ScrollbarDrawingWin.cpp - widget/ScrollbarDrawingWin11.cpp Changes: ===================================== widget/ScrollbarDrawingWin.cpp ===================================== @@ -11,6 +11,7 @@ #include "nsLayoutUtils.h" #include "Theme.h" #include "nsNativeTheme.h" +#include "nsContentUtils.h" namespace mozilla::widget { @@ -164,7 +165,10 @@ void ScrollbarDrawingWin::RecomputeScrollbarParams() { } ConfigureScrollbarSize(defaultSize); - if (StaticPrefs::widget_non_native_theme_win_scrollbar_use_system_size()) { + // Do not leak system size when using ResistFingerprinting. + if (!nsContentUtils::ShouldResistFingerprinting("No context available", + RFPTarget::Unknown) && + StaticPrefs::widget_non_native_theme_win_scrollbar_use_system_size()) { ConfigureScrollbarSize(LookAndFeel::GetInt( LookAndFeel::IntID::SystemScrollbarSize, defaultSize)); } ===================================== widget/ScrollbarDrawingWin11.cpp ===================================== @@ -11,6 +11,7 @@ #include "nsLayoutUtils.h" #include "Theme.h" #include "nsNativeTheme.h" +#include "nsContentUtils.h" using mozilla::gfx::sRGBColor; @@ -352,6 +353,11 @@ bool ScrollbarDrawingWin11::PaintScrollbarThumb( void ScrollbarDrawingWin11::RecomputeScrollbarParams() { ScrollbarDrawingWin::RecomputeScrollbarParams(); + if (nsContentUtils::ShouldResistFingerprinting("No context available", + RFPTarget::Unknown)) { + // Do not distinguish sizes between windows 10 and 11. + return; + } // TODO(emilio): Maybe make this configurable? Though this doesn't respect // classic Windows registry settings, and cocoa overlay scrollbars also don't // respect the override it seems, so this should be fine. View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/190… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/190… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][base-browser-115.10.0esr-13.5-1] Bug 42528: Don't leak system scrollbar size on windows.
by Pier Angelo Vendrame (@pierov) 17 Apr '24

17 Apr '24
Pier Angelo Vendrame pushed to branch base-browser-115.10.0esr-13.5-1 at The Tor Project / Applications / Tor Browser Commits: 39b29d69 by Henry Wilkes at 2024-04-17T18:10:24+02:00 Bug 42528: Don&#39;t leak system scrollbar size on windows. - - - - - 2 changed files: - widget/ScrollbarDrawingWin.cpp - widget/ScrollbarDrawingWin11.cpp Changes: ===================================== widget/ScrollbarDrawingWin.cpp ===================================== @@ -11,6 +11,7 @@ #include "nsLayoutUtils.h" #include "Theme.h" #include "nsNativeTheme.h" +#include "nsContentUtils.h" namespace mozilla::widget { @@ -164,7 +165,10 @@ void ScrollbarDrawingWin::RecomputeScrollbarParams() { } ConfigureScrollbarSize(defaultSize); - if (StaticPrefs::widget_non_native_theme_win_scrollbar_use_system_size()) { + // Do not leak system size when using ResistFingerprinting. + if (!nsContentUtils::ShouldResistFingerprinting("No context available", + RFPTarget::Unknown) && + StaticPrefs::widget_non_native_theme_win_scrollbar_use_system_size()) { ConfigureScrollbarSize(LookAndFeel::GetInt( LookAndFeel::IntID::SystemScrollbarSize, defaultSize)); } ===================================== widget/ScrollbarDrawingWin11.cpp ===================================== @@ -11,6 +11,7 @@ #include "nsLayoutUtils.h" #include "Theme.h" #include "nsNativeTheme.h" +#include "nsContentUtils.h" using mozilla::gfx::sRGBColor; @@ -352,6 +353,11 @@ bool ScrollbarDrawingWin11::PaintScrollbarThumb( void ScrollbarDrawingWin11::RecomputeScrollbarParams() { ScrollbarDrawingWin::RecomputeScrollbarParams(); + if (nsContentUtils::ShouldResistFingerprinting("No context available", + RFPTarget::Unknown)) { + // Do not distinguish sizes between windows 10 and 11. + return; + } // TODO(emilio): Maybe make this configurable? Though this doesn't respect // classic Windows registry settings, and cocoa overlay scrollbars also don't // respect the override it seems, so this should be fine. View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/39b29d6… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/39b29d6… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-115.10.0esr-13.5-1] Bug 42528: Don't leak system scrollbar size on windows.
by Pier Angelo Vendrame (@pierov) 17 Apr '24

17 Apr '24
Pier Angelo Vendrame pushed to branch tor-browser-115.10.0esr-13.5-1 at The Tor Project / Applications / Tor Browser Commits: 9b68a413 by Henry Wilkes at 2024-04-17T16:09:08+00:00 Bug 42528: Don&#39;t leak system scrollbar size on windows. - - - - - 2 changed files: - widget/ScrollbarDrawingWin.cpp - widget/ScrollbarDrawingWin11.cpp Changes: ===================================== widget/ScrollbarDrawingWin.cpp ===================================== @@ -11,6 +11,7 @@ #include "nsLayoutUtils.h" #include "Theme.h" #include "nsNativeTheme.h" +#include "nsContentUtils.h" namespace mozilla::widget { @@ -164,7 +165,10 @@ void ScrollbarDrawingWin::RecomputeScrollbarParams() { } ConfigureScrollbarSize(defaultSize); - if (StaticPrefs::widget_non_native_theme_win_scrollbar_use_system_size()) { + // Do not leak system size when using ResistFingerprinting. + if (!nsContentUtils::ShouldResistFingerprinting("No context available", + RFPTarget::Unknown) && + StaticPrefs::widget_non_native_theme_win_scrollbar_use_system_size()) { ConfigureScrollbarSize(LookAndFeel::GetInt( LookAndFeel::IntID::SystemScrollbarSize, defaultSize)); } ===================================== widget/ScrollbarDrawingWin11.cpp ===================================== @@ -11,6 +11,7 @@ #include "nsLayoutUtils.h" #include "Theme.h" #include "nsNativeTheme.h" +#include "nsContentUtils.h" using mozilla::gfx::sRGBColor; @@ -352,6 +353,11 @@ bool ScrollbarDrawingWin11::PaintScrollbarThumb( void ScrollbarDrawingWin11::RecomputeScrollbarParams() { ScrollbarDrawingWin::RecomputeScrollbarParams(); + if (nsContentUtils::ShouldResistFingerprinting("No context available", + RFPTarget::Unknown)) { + // Do not distinguish sizes between windows 10 and 11. + return; + } // TODO(emilio): Maybe make this configurable? Though this doesn't respect // classic Windows registry settings, and cocoa overlay scrollbars also don't // respect the override it seems, so this should be fine. View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/9b68a41… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/9b68a41… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][base-browser-115.10.0esr-13.5-1] Bug 41966: Allow removing locales from the locale alternatives list.
by Pier Angelo Vendrame (@pierov) 17 Apr '24

17 Apr '24
Pier Angelo Vendrame pushed to branch base-browser-115.10.0esr-13.5-1 at The Tor Project / Applications / Tor Browser Commits: 168e038e by Henry Wilkes at 2024-04-17T16:52:24+02:00 Bug 41966: Allow removing locales from the locale alternatives list. - - - - - 1 changed file: - browser/components/preferences/dialogs/browserLanguages.js Changes: ===================================== browser/components/preferences/dialogs/browserLanguages.js ===================================== @@ -349,7 +349,7 @@ async function getLocaleDisplayInfo(localeCodes) { id: "locale-" + code, label: localeNames[i], value: code, - canRemove: !packagedLocales.has(code), + canRemove: code !== Services.locale.defaultLocale, installed: availableLocales.has(code), }; }); View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/168e038… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/168e038… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/mullvad-browser][mullvad-browser-115.10.0esr-13.5-1] Bug 41966: Allow removing locales from the locale alternatives list.
by Pier Angelo Vendrame (@pierov) 17 Apr '24

17 Apr '24
Pier Angelo Vendrame pushed to branch mullvad-browser-115.10.0esr-13.5-1 at The Tor Project / Applications / Mullvad Browser Commits: 2970b5b4 by Henry Wilkes at 2024-04-17T16:52:44+02:00 Bug 41966: Allow removing locales from the locale alternatives list. - - - - - 1 changed file: - browser/components/preferences/dialogs/browserLanguages.js Changes: ===================================== browser/components/preferences/dialogs/browserLanguages.js ===================================== @@ -349,7 +349,7 @@ async function getLocaleDisplayInfo(localeCodes) { id: "locale-" + code, label: localeNames[i], value: code, - canRemove: !packagedLocales.has(code), + canRemove: code !== Services.locale.defaultLocale, installed: availableLocales.has(code), }; }); View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/297… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/297… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-115.10.0esr-13.5-1] Bug 41966: Allow removing locales from the locale alternatives list.
by Pier Angelo Vendrame (@pierov) 17 Apr '24

17 Apr '24
Pier Angelo Vendrame pushed to branch tor-browser-115.10.0esr-13.5-1 at The Tor Project / Applications / Tor Browser Commits: 5be723a9 by Henry Wilkes at 2024-04-17T15:37:09+01:00 Bug 41966: Allow removing locales from the locale alternatives list. - - - - - 1 changed file: - browser/components/preferences/dialogs/browserLanguages.js Changes: ===================================== browser/components/preferences/dialogs/browserLanguages.js ===================================== @@ -349,7 +349,7 @@ async function getLocaleDisplayInfo(localeCodes) { id: "locale-" + code, label: localeNames[i], value: code, - canRemove: !packagedLocales.has(code), + canRemove: code !== Services.locale.defaultLocale, installed: availableLocales.has(code), }; }); View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/5be723a… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/5be723a… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser-build][maint-13.0] Bug 41128: Fix spaces in various config files.
by Pier Angelo Vendrame (@pierov) 17 Apr '24

17 Apr '24
Pier Angelo Vendrame pushed to branch maint-13.0 at The Tor Project / Applications / tor-browser-build Commits: 24cb8294 by Pier Angelo Vendrame at 2024-04-17T14:41:09+02:00 Bug 41128: Fix spaces in various config files. Some files contain more spaces than needed. After fixing them, we can update these files with ruamel.yaml if needed. - - - - - 30 changed files: - projects/glean/config - projects/goansicolor/config - projects/gobtcd/config - projects/gobtclog/config - projects/gobtcutil/config - projects/gobuildinfo/config - projects/goconfigurable/config - projects/godegoutils/config - projects/godexlogconfig/config - projects/godns/config - projects/goeasyconfig/config - projects/gogroupcache/config - projects/goisatty/config - projects/gokingpin/config - projects/gomadns/config - projects/goncbtcjson/config - projects/goncrpcclient/config - projects/gopflag/config - projects/gopretty/config - projects/goservice/config - projects/gosocks/config - projects/gosvcutils/config - projects/gosystemd/config - projects/gotemplate/config - projects/gotext/config - projects/gotoml/config - projects/gounits/config - projects/gowebsocket/config - projects/goxlog/config - projects/gspt/config The diff was not included because it is too large. View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/2… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/2… 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 41128: Fix spaces in various config files.
by Pier Angelo Vendrame (@pierov) 17 Apr '24

17 Apr '24
Pier Angelo Vendrame pushed to branch main at The Tor Project / Applications / tor-browser-build Commits: f8cb6710 by Pier Angelo Vendrame at 2024-04-17T11:26:53+02:00 Bug 41128: Fix spaces in various config files. Some files contain more spaces than needed. After fixing them, we can update these files with ruamel.yaml if needed. - - - - - 30 changed files: - projects/glean/config - projects/goansicolor/config - projects/gobtcd/config - projects/gobtclog/config - projects/gobtcutil/config - projects/gobuildinfo/config - projects/goconfigurable/config - projects/godegoutils/config - projects/godexlogconfig/config - projects/godns/config - projects/goeasyconfig/config - projects/gogroupcache/config - projects/goisatty/config - projects/gokingpin/config - projects/gomadns/config - projects/goncbtcjson/config - projects/goncrpcclient/config - projects/gopflag/config - projects/gopretty/config - projects/goservice/config - projects/gosocks/config - projects/gosvcutils/config - projects/gosystemd/config - projects/gotemplate/config - projects/gotext/config - projects/gotoml/config - projects/gounits/config - projects/gowebsocket/config - projects/goxlog/config - projects/gspt/config The diff was not included because it is too large. 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/firefox-android][firefox-android-115.2.1-13.5-1] fixup! Add Tor integration and UI
by Dan Ballard (@dan) 17 Apr '24

17 Apr '24
Dan Ballard pushed to branch firefox-android-115.2.1-13.5-1 at The Tor Project / Applications / firefox-android Commits: 2095a229 by clairehurst at 2024-04-17T00:27:30+00:00 fixup! Add Tor integration and UI - - - - - 4 changed files: - + fenix/app/src/main/java/org/mozilla/fenix/tor/TorLogsComposeFragment.kt - − fenix/app/src/main/java/org/mozilla/fenix/tor/TorLogsFragment.kt - + fenix/app/src/main/java/org/mozilla/fenix/tor/TorLogsViewModel.kt - fenix/app/src/main/res/navigation/nav_graph.xml Changes: ===================================== fenix/app/src/main/java/org/mozilla/fenix/tor/TorLogsComposeFragment.kt ===================================== @@ -0,0 +1,82 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +package org.mozilla.fenix.tor + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.text.selection.DisableSelection +import androidx.compose.foundation.text.selection.SelectionContainer +import androidx.compose.foundation.verticalScroll +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.Stable +import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.ComposeView +import androidx.compose.ui.unit.dp +import androidx.fragment.app.Fragment +import androidx.fragment.app.viewModels +import mozilla.components.ui.colors.PhotonColors + +class TorLogsComposeFragment : Fragment() { + private val viewModel: TorLogsViewModel by viewModels() + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle?, + ): View { + return ComposeView(requireContext()).apply { + setContent { + SelectionContainer { + Column( + // Column instead of LazyColumn so that you can select all the logs, and not just one "screen" at a time + // The logs won't be too big so loading them all instead of just whats visible shouldn't be a big deal + modifier = Modifier + .fillMaxSize() + .verticalScroll(state = rememberScrollState(), reverseScrolling = true), + ) { + for (log in viewModel.torLogs) { + LogRow(log = log) + } + } + } + } + } + } +} + +@Composable +@Stable +fun LogRow(log: TorLog, modifier: Modifier = Modifier) { + Column( + modifier + .fillMaxWidth() + .padding( + start = 16.dp, + end = 16.dp, + bottom = 16.dp, + ), + ) { + DisableSelection { + Text( + text = log.timestamp.toString(), + color = PhotonColors.LightGrey40, + modifier = modifier + .padding(bottom = 4.dp), + ) + } + Text( + text = log.text, + color = PhotonColors.LightGrey05, + ) + } +} ===================================== fenix/app/src/main/java/org/mozilla/fenix/tor/TorLogsFragment.kt deleted ===================================== @@ -1,81 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -package org.mozilla.fenix.tor - -import android.os.Bundle -import android.text.method.ScrollingMovementMethod -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import androidx.fragment.app.Fragment -import org.mozilla.fenix.R -import org.mozilla.fenix.components.Components -import org.mozilla.fenix.databinding.TorBootstrapLoggerBinding -import org.mozilla.fenix.ext.requireComponents -import org.mozilla.fenix.tor.view.TorBootstrapLoggerViewHolder - -class TorLogsFragment : Fragment(), TorLogs { - - private var entries = mutableListOf<String>() - internal var _binding: TorBootstrapLoggerBinding? = null - private val binding get() = _binding!! - - private var _components: Components? = null - private val components get() = _components!! - - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle?, - ): View { - _binding = TorBootstrapLoggerBinding.inflate(inflater) - _components = requireComponents - - components.torController.registerTorLogListener(this) - - val currentEntries = components.torController.logEntries.filter { it.second != null } - .filter { !(it.second!!.startsWith("Circuit") && it.first == "ON") } - // Keep synchronized with format in onTorStatusUpdate - .flatMap { listOf("(${it.first}) '${it.second}'") } - val entriesLen = currentEntries.size - val subListOffset = - if (entriesLen > TorBootstrapLoggerViewHolder.MAX_NEW_ENTRIES) TorBootstrapLoggerViewHolder.MAX_NEW_ENTRIES else entriesLen - entries = - currentEntries.subList((entriesLen - subListOffset), entriesLen) as MutableList<String> - val initLog = - "---------------" + getString(R.string.tor_initializing_log) + "---------------" - entries.add(0, initLog) - - with(binding.torBootstrapLogEntries) { - movementMethod = ScrollingMovementMethod() - text = formatLogEntries(entries) - } - - - return binding.root - } - - // TODO on destroy unregiuster - - private fun formatLogEntries(entries: List<String>) = entries.joinToString("\n") - - override fun onLog(type: String?, message: String?) { - if (message == null || type == null) return - if (type == "ON" && type.startsWith("Circuit")) return - - if (entries.size > TorBootstrapLoggerViewHolder.MAX_LINES) { - entries = entries.drop(1) as MutableList<String> - } - entries.add("($type) '$message'") - - binding.torBootstrapLogEntries.text = formatLogEntries(entries) - } - - override fun onStop() { - super.onStop() - components.torController.unregisterTorLogListener(this) - } - -} ===================================== fenix/app/src/main/java/org/mozilla/fenix/tor/TorLogsViewModel.kt ===================================== @@ -0,0 +1,88 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +package org.mozilla.fenix.tor + +import android.app.Application +import android.content.ClipData +import android.content.ClipboardManager +import android.content.Context +import android.os.Build +import android.widget.Toast +import androidx.compose.runtime.Stable +import androidx.lifecycle.AndroidViewModel +import org.mozilla.fenix.R +import org.mozilla.fenix.ext.components +import java.sql.Timestamp + +class TorLogsViewModel(application: Application) : AndroidViewModel(application), TorLogs { + private val torController = application.components.torController + private val clipboardManager = + application.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager + + val torLogs: MutableList<TorLog> = mutableListOf( + TorLog( + "---------------" + application.getString(R.string.tor_initializing_log) + "---------------", + ), + ) + + init { + setupClipboardListener() + torController.registerTorLogListener(this) + val currentEntries = torController.logEntries.filter { it.second != null } + .filter { !(it.second!!.startsWith("Circuit") && it.first == "ON") } + // Keep synchronized with format in onTorStatusUpdate + .flatMap { listOf(TorLog("[${it.first}] ${it.second}")) } + torLogs.addAll(currentEntries) + } + + override fun onLog(type: String?, message: String?) { + if (message == null || type == null) return + if (type == "ON" && type.startsWith("Circuit")) return + + torLogs.add(TorLog("[$type] $message")) + } + + override fun onCleared() { + super.onCleared() + torController.unregisterTorLogListener(this) + } + + private fun setupClipboardListener() { + clipboardManager.addPrimaryClipChangedListener { + // Only show a toast for Android 12 and lower. + // https://developer.android.com/develop/ui/views/touch-and-input/copy-paste#d… + if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.S_V2) { + Toast.makeText( + getApplication<Application>().applicationContext, + getApplication<Application>().getString(R.string.toast_copy_link_to_clipboard), // "Copied to clipboard" already translated + Toast.LENGTH_SHORT, + ).show() + } + } + } + + fun copyAllLogsToClipboard() { // TODO add kebab menu in top right corner which includes option to "Copy all logs" + clipboardManager.setPrimaryClip( + ClipData.newPlainText( + "Copied Text", + getAllTorLogs(), + ), + ) + } + + private fun getAllTorLogs(): String { + var ret = "" + for (log in torLogs) { + ret += log.text + '\n' + } + return ret + } +} + +@Stable +data class TorLog( + val text: String, + val timestamp: Timestamp = Timestamp(System.currentTimeMillis()), +) ===================================== fenix/app/src/main/res/navigation/nav_graph.xml ===================================== @@ -976,8 +976,7 @@ <fragment android:id="@+id/torBridgeConfigFragment" android:name="org.mozilla.fenix.settings.TorBridgeConfigFragment" - android:label="@string/preferences_tor_network_settings_bridge_config" - tools:layout="@layout/fragment_tor_bridge_config" /> + android:label="@string/preferences_tor_network_settings_bridge_config" /> <fragment android:id="@+id/torBetaConnectionFeaturesFragment" android:name="org.mozilla.fenix.tor.TorBetaConnectionFeaturesFragment" @@ -985,9 +984,8 @@ tools:layout="@layout/tor_network_settings_beta_connection_features" /> <fragment android:id="@+id/torLogsFragment" - android:name="org.mozilla.fenix.tor.TorLogsFragment" - android:label="Tor Logs" - tools:layout="@layout/tor_bootstrap_logger" /> + android:name="org.mozilla.fenix.tor.TorLogsComposeFragment" + android:label="@string/preferences_tor_logs" /> <fragment android:id="@+id/trackingProtectionFragment" View it on GitLab: https://gitlab.torproject.org/tpo/applications/firefox-android/-/commit/209… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/firefox-android/-/commit/209… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-115.10.0esr-13.5-1] 4 commits: fixup! Bug 40458: Implement .tor.onion aliases
by richard (@richard) 17 Apr '24

17 Apr '24
richard pushed to branch tor-browser-115.10.0esr-13.5-1 at The Tor Project / Applications / Tor Browser Commits: 5fd3baa6 by Henry Wilkes at 2024-04-16T21:57:16+00:00 fixup! Bug 40458: Implement .tor.onion aliases Bug 42206: Migrate ruleset strings to Fluent. - - - - - 7b790cf6 by Henry Wilkes at 2024-04-16T21:57:16+00:00 fixup! Tor Browser strings Bug 42206: Migrate ruleset strings to Fluent. - - - - - caed3ae7 by Henry Wilkes at 2024-04-16T21:57:16+00:00 fixup! Add TorStrings module for localization Bug 42206: Migrate ruleset strings to Fluent. - - - - - 8c14330e by Henry Wilkes at 2024-04-16T21:57:16+00:00 fixup! Tor Browser localization migration scripts. Bug 42206: Migrate ruleset strings to Fluent. - - - - - 7 changed files: - browser/components/rulesets/RulesetsParent.sys.mjs - browser/components/rulesets/content/aboutRulesets.html - browser/components/rulesets/content/aboutRulesets.js - browser/locales/en-US/browser/tor-browser.ftl - toolkit/modules/TorStrings.sys.mjs - − toolkit/torbutton/chrome/locale/en-US/rulesets.properties - + tools/torbrowser/l10n/migrations/bug-42206-rulesets.py Changes: ===================================== browser/components/rulesets/RulesetsParent.sys.mjs ===================================== @@ -1,6 +1,5 @@ // Copyright (c) 2022, The Tor Project, Inc. -import { TorStrings } from "resource://gre/modules/TorStrings.sys.mjs"; import { OnionAliasStore, OnionAliasStoreTopics, @@ -8,8 +7,8 @@ import { const kShowWarningPref = "torbrowser.rulesets.show_warning"; -// This class allows about:rulesets to get TorStrings and to load/save the -// preference for skipping the warning +// This class allows about:rulesets to load/save the preference for skipping the +// warning export class RulesetsParent extends JSWindowActorParent { constructor(...args) { super(...args); @@ -53,7 +52,6 @@ export class RulesetsParent extends JSWindowActorParent { return OnionAliasStore.getChannels(); case "rulesets:get-init-args": return { - TorStrings, showWarning: Services.prefs.getBoolPref(kShowWarningPref, true), }; case "rulesets:set-channel": ===================================== browser/components/rulesets/content/aboutRulesets.html ===================================== @@ -11,13 +11,19 @@ rel="stylesheet" href="chrome://browser/content/rulesets/aboutRulesets.css" /> + + <link rel="localization" href="branding/brand.ftl" /> + <link rel="localization" href="browser/tor-browser.ftl" /> </head> <body> <!-- Warning --> <div id="warning-wrapper"> <div id="warning"> - <h1 id="warning-title"></h1> - <p id="warning-description"></p> + <h1 id="warning-title" data-l10n-id="rulesets-warning-heading"></h1> + <p + id="warning-description" + data-l10n-id="rulesets-warning-description" + ></p> <p> <label> <input @@ -25,11 +31,18 @@ type="checkbox" checked="checked" /> - <span id="warning-enable-label"></span> + <span + id="warning-enable-label" + data-l10n-id="rulesets-warning-checkbox" + ></span> </label> </p> <div id="warning-buttonbar"> - <button id="warning-button" autofocus="autofocus"></button> + <button + id="warning-button" + autofocus="autofocus" + data-l10n-id="rulesets-warning-continue-button" + ></button> </div> </div> </div> @@ -37,11 +50,20 @@ <div id="main-content"> <!-- Ruleset list --> <aside> - <div id="ruleset-heading"></div> + <div + id="ruleset-heading" + data-l10n-id="rulesets-side-panel-heading" + ></div> <div id="ruleset-list-container"> <div id="ruleset-list-empty"> - <p id="ruleset-list-empty-title"></p> - <p id="ruleset-list-empty-description"></p> + <p + id="ruleset-list-empty-title" + data-l10n-id="rulesets-side-panel-no-rules" + ></p> + <p + id="ruleset-list-empty-description" + data-l10n-id="rulesets-side-panel-no-rules-description" + ></p> </div> <ul id="ruleset-list"> <li id="ruleset-template"> @@ -59,24 +81,40 @@ <section id="ruleset-details"> <div class="title"> <h1 id="ruleset-title"></h1> - <button id="ruleset-edit" class="ghost-button"></button> + <button + id="ruleset-edit" + class="ghost-button" + data-l10n-id="rulesets-details-edit-button" + ></button> </div> <dl> - <dt id="ruleset-jwk-label"></dt> + <dt id="ruleset-jwk-label" data-l10n-id="rulesets-details-jwk"></dt> <dd id="ruleset-jwk-value"></dd> - <dt id="ruleset-path-prefix-label"></dt> + <dt + id="ruleset-path-prefix-label" + data-l10n-id="rulesets-details-path" + ></dt> <dd> <a id="ruleset-path-prefix-value" target="_blank"></a> </dd> - <dt id="ruleset-scope-label"></dt> + <dt + id="ruleset-scope-label" + data-l10n-id="rulesets-details-scope" + ></dt> <dd id="ruleset-scope-value"></dd> </dl> <label id="ruleset-enable"> <input type="checkbox" id="ruleset-enable-checkbox" /> - <span id="ruleset-enable-label"></span> + <span + id="ruleset-enable-label" + data-l10n-id="rulesets-details-enable-checkbox" + ></span> </label> <div id="ruleset-buttonbar"> - <button id="ruleset-update-button"></button> + <button + id="ruleset-update-button" + data-l10n-id="rulesets-details-update-button" + ></button> </div> <hr /> <p id="ruleset-updated"></p> @@ -89,24 +127,52 @@ </div> <form id="edit-ruleset-form"> <label> - <div id="edit-jwk-label"></div> - <textarea id="edit-jwk-textarea" rows="10"></textarea> + <div id="edit-jwk-label" data-l10n-id="rulesets-details-jwk"></div> + <textarea + id="edit-jwk-textarea" + rows="10" + data-l10n-id="rulesets-details-jwk-input" + ></textarea> </label> <label> - <div id="edit-path-prefix-label"></div> - <input id="edit-path-prefix-input" type="text" /> + <div + id="edit-path-prefix-label" + data-l10n-id="rulesets-details-path" + ></div> + <input + id="edit-path-prefix-input" + type="text" + data-l10n-id="rulesets-details-path-input" + /> </label> <label> - <div id="edit-scope-label"></div> - <input id="edit-scope-input" type="text" /> + <div + id="edit-scope-label" + data-l10n-id="rulesets-details-scope" + ></div> + <input + id="edit-scope-input" + type="text" + data-l10n-id="rulesets-details-scope-input" + /> </label> <label id="edit-enable"> <input type="checkbox" id="edit-enable-checkbox" /> - <span id="edit-enable-label"></span> + <span + id="edit-enable-label" + data-l10n-id="rulesets-details-enable-checkbox" + ></span> </label> <div id="edit-buttonbar"> - <button id="edit-save" class="primary"></button> - <button id="edit-cancel"></button> + <button + id="edit-save" + class="primary" + data-l10n-id="rulesets-details-save-button" + ></button> + <button + id="edit-cancel" + data-l10n-id="rulesets-details-cancel-button" + ></button> </div> </form> </section> ===================================== browser/components/rulesets/content/aboutRulesets.js ===================================== @@ -2,8 +2,6 @@ /* globals RPMAddMessageListener, RPMSendQuery, RPMSendAsyncMessage */ -let TorStrings; - const Orders = Object.freeze({ Name: "name", NameDesc: "name-desc", @@ -19,55 +17,35 @@ const States = Object.freeze({ function setUpdateDate(ruleset, element) { if (!ruleset.enabled) { - element.textContent = TorStrings.rulesets.disabled; + document.l10n.setAttributes(element, "rulesets-update-rule-disabled"); return; } if (!ruleset.currentTimestamp) { - element.textContent = TorStrings.rulesets.neverUpdated; + document.l10n.setAttributes(element, "rulesets-update-never"); return; } - const formatter = new Intl.DateTimeFormat(navigator.languages, { - year: "numeric", - month: "long", - day: "numeric", + document.l10n.setAttributes(element, "rulesets-update-last", { + date: ruleset.currentTimestamp * 1000, }); - element.textContent = TorStrings.rulesets.lastUpdated.replace( - "%S", - formatter.format(new Date(ruleset.currentTimestamp * 1000)) - ); } class WarningState { - selectors = Object.freeze({ - wrapper: "#warning-wrapper", - title: "#warning-title", - description: "#warning-description", - enableCheckbox: "#warning-enable-checkbox", - enableLabel: "#warning-enable-label", - button: "#warning-button", - }); - - elements = Object.freeze({ - wrapper: document.querySelector(this.selectors.wrapper), - title: document.querySelector(this.selectors.title), - description: document.querySelector(this.selectors.description), - enableCheckbox: document.querySelector(this.selectors.enableCheckbox), - enableLabel: document.querySelector(this.selectors.enableLabel), - button: document.querySelector(this.selectors.button), - }); + elements = { + enableCheckbox: document.getElementById("warning-enable-checkbox"), + button: document.getElementById("warning-button"), + }; constructor() { - const elements = this.elements; - elements.title.textContent = TorStrings.rulesets.warningTitle; - elements.description.textContent = TorStrings.rulesets.warningDescription; - elements.enableLabel.textContent = TorStrings.rulesets.warningEnable; - elements.button.textContent = TorStrings.rulesets.warningButton; - elements.enableCheckbox.addEventListener( + this.elements.enableCheckbox.addEventListener( "change", this.onEnableChange.bind(this) ); - elements.button.addEventListener("click", this.onButtonClick.bind(this)); + + this.elements.button.addEventListener( + "click", + this.onButtonClick.bind(this) + ); } show() { @@ -89,50 +67,28 @@ class WarningState { } class DetailsState { - selectors = Object.freeze({ - title: "#ruleset-title", - edit: "#ruleset-edit", - jwkLabel: "#ruleset-jwk-label", - jwkValue: "#ruleset-jwk-value", - pathPrefixLabel: "#ruleset-path-prefix-label", - pathPrefixValue: "#ruleset-path-prefix-value", - scopeLabel: "#ruleset-scope-label", - scopeValue: "#ruleset-scope-value", - enableCheckbox: "#ruleset-enable-checkbox", - enableLabel: "#ruleset-enable-label", - updateButton: "#ruleset-update-button", - updated: "#ruleset-updated", - }); - - elements = Object.freeze({ - title: document.querySelector(this.selectors.title), - edit: document.querySelector(this.selectors.edit), - jwkLabel: document.querySelector(this.selectors.jwkLabel), - jwkValue: document.querySelector(this.selectors.jwkValue), - pathPrefixLabel: document.querySelector(this.selectors.pathPrefixLabel), - pathPrefixValue: document.querySelector(this.selectors.pathPrefixValue), - scopeLabel: document.querySelector(this.selectors.scopeLabel), - scopeValue: document.querySelector(this.selectors.scopeValue), - enableCheckbox: document.querySelector(this.selectors.enableCheckbox), - enableLabel: document.querySelector(this.selectors.enableLabel), - updateButton: document.querySelector(this.selectors.updateButton), - updated: document.querySelector(this.selectors.updated), - }); + elements = { + title: document.getElementById("ruleset-title"), + jwkValue: document.getElementById("ruleset-jwk-value"), + pathPrefixValue: document.getElementById("ruleset-path-prefix-value"), + scopeValue: document.getElementById("ruleset-scope-value"), + enableCheckbox: document.getElementById("ruleset-enable-checkbox"), + updateButton: document.getElementById("ruleset-update-button"), + updated: document.getElementById("ruleset-updated"), + }; constructor() { - const elements = this.elements; - elements.edit.textContent = TorStrings.rulesets.edit; - elements.edit.addEventListener("click", this.onEdit.bind(this)); - elements.jwkLabel.textContent = TorStrings.rulesets.jwk; - elements.pathPrefixLabel.textContent = TorStrings.rulesets.pathPrefix; - elements.scopeLabel.textContent = TorStrings.rulesets.scope; - elements.enableCheckbox.addEventListener( + document + .getElementById("ruleset-edit") + .addEventListener("click", this.onEdit.bind(this)); + this.elements.enableCheckbox.addEventListener( "change", this.onEnable.bind(this) ); - elements.enableLabel.textContent = TorStrings.rulesets.enable; - elements.updateButton.textContent = TorStrings.rulesets.checkUpdates; - elements.updateButton.addEventListener("click", this.onUpdate.bind(this)); + this.elements.updateButton.addEventListener( + "click", + this.onUpdate.bind(this) + ); } show(ruleset) { @@ -179,61 +135,22 @@ class DetailsState { } class EditState { - selectors = Object.freeze({ - form: "#edit-ruleset-form", - title: "#edit-title", - nameGroup: "#edit-name-group", - nameLabel: "#edit-name-label", - nameInput: "#edit-name-input", - jwkLabel: "#edit-jwk-label", - jwkTextarea: "#edit-jwk-textarea", - pathPrefixLabel: "#edit-path-prefix-label", - pathPrefixInput: "#edit-path-prefix-input", - scopeLabel: "#edit-scope-label", - scopeInput: "#edit-scope-input", - enableCheckbox: "#edit-enable-checkbox", - enableLabel: "#edit-enable-label", - save: "#edit-save", - cancel: "#edit-cancel", - }); - - elements = Object.freeze({ - form: document.querySelector(this.selectors.form), - title: document.querySelector(this.selectors.title), - jwkLabel: document.querySelector(this.selectors.jwkLabel), - jwkTextarea: document.querySelector(this.selectors.jwkTextarea), - pathPrefixLabel: document.querySelector(this.selectors.pathPrefixLabel), - pathPrefixInput: document.querySelector(this.selectors.pathPrefixInput), - scopeLabel: document.querySelector(this.selectors.scopeLabel), - scopeInput: document.querySelector(this.selectors.scopeInput), - enableCheckbox: document.querySelector(this.selectors.enableCheckbox), - enableLabel: document.querySelector(this.selectors.enableLabel), - save: document.querySelector(this.selectors.save), - cancel: document.querySelector(this.selectors.cancel), - }); + elements = { + form: document.getElementById("edit-ruleset-form"), + title: document.getElementById("edit-title"), + jwkTextarea: document.getElementById("edit-jwk-textarea"), + pathPrefixInput: document.getElementById("edit-path-prefix-input"), + scopeInput: document.getElementById("edit-scope-input"), + enableCheckbox: document.getElementById("edit-enable-checkbox"), + }; constructor() { - const elements = this.elements; - elements.jwkLabel.textContent = TorStrings.rulesets.jwk; - elements.jwkTextarea.setAttribute( - "placeholder", - TorStrings.rulesets.jwkPlaceholder - ); - elements.pathPrefixLabel.textContent = TorStrings.rulesets.pathPrefix; - elements.pathPrefixInput.setAttribute( - "placeholder", - TorStrings.rulesets.pathPrefixPlaceholder - ); - elements.scopeLabel.textContent = TorStrings.rulesets.scope; - elements.scopeInput.setAttribute( - "placeholder", - TorStrings.rulesets.scopePlaceholder - ); - elements.enableLabel.textContent = TorStrings.rulesets.enable; - elements.save.textContent = TorStrings.rulesets.save; - elements.save.addEventListener("click", this.onSave.bind(this)); - elements.cancel.textContent = TorStrings.rulesets.cancel; - elements.cancel.addEventListener("click", this.onCancel.bind(this)); + document + .getElementById("edit-save") + .addEventListener("click", this.onSave.bind(this)); + document + .getElementById("edit-cancel") + .addEventListener("click", this.onCancel.bind(this)); } show(ruleset) { @@ -276,7 +193,9 @@ class EditState { elements.jwkTextarea.setCustomValidity(""); } catch (err) { console.error("Invalid JSON or invalid JWK", err); - elements.jwkTextarea.setCustomValidity(TorStrings.rulesets.jwkInvalid); + elements.jwkTextarea.setCustomValidity( + await document.l10n.formatValue("rulesets-details-jwk-input-invalid") + ); valid = false; } @@ -285,7 +204,7 @@ class EditState { const url = new URL(pathPrefix); if (url.protocol !== "http:" && url.protocol !== "https:") { elements.pathPrefixInput.setCustomValidity( - TorStrings.rulesets.pathPrefixInvalid + await document.l10n.formatValue("rulesets-details-path-input-invalid") ); valid = false; } else { @@ -294,7 +213,7 @@ class EditState { } catch (err) { console.error("The path prefix is not a valid URL", err); elements.pathPrefixInput.setCustomValidity( - TorStrings.rulesets.pathPrefixInvalid + await document.l10n.formatValue("rulesets-details-path-input-invalid") ); valid = false; } @@ -304,7 +223,9 @@ class EditState { scope = new RegExp(elements.scopeInput.value.trim()); elements.scopeInput.setCustomValidity(""); } catch (err) { - elements.scopeInput.setCustomValidity(TorStrings.rulesets.scopeInvalid); + elements.scopeInput.setCustomValidity( + await document.l10n.formatValue("rulesets-details-scope-input-invalid") + ); valid = false; } @@ -342,39 +263,17 @@ class NoRulesetsState { } class RulesetList { - selectors = Object.freeze({ - heading: "#ruleset-heading", - list: "#ruleset-list", - emptyContainer: "#ruleset-list-empty", - emptyTitle: "#ruleset-list-empty-title", - emptyDescription: "#ruleset-list-empty-description", - itemTemplate: "#ruleset-template", - itemName: ".name", - itemDescr: ".description", - }); - - elements = Object.freeze({ - heading: document.querySelector(this.selectors.heading), - list: document.querySelector(this.selectors.list), - emptyContainer: document.querySelector(this.selectors.emptyContainer), - emptyTitle: document.querySelector(this.selectors.emptyTitle), - emptyDescription: document.querySelector(this.selectors.emptyDescription), - itemTemplate: document.querySelector(this.selectors.itemTemplate), - }); + elements = { + list: document.getElementById("ruleset-list"), + emptyContainer: document.getElementById("ruleset-list-empty"), + itemTemplate: document.getElementById("ruleset-template"), + }; nameAttribute = "data-name"; rulesets = []; constructor() { - const elements = this.elements; - - // Header - elements.heading.textContent = TorStrings.rulesets.rulesets; - // Empty - elements.emptyTitle.textContent = TorStrings.rulesets.noRulesets; - elements.emptyDescription.textContent = TorStrings.rulesets.noRulesetsDescr; - RPMAddMessageListener( "rulesets:channels-change", this.onRulesetsChanged.bind(this) @@ -438,14 +337,10 @@ class RulesetList { const item = this.elements.itemTemplate.cloneNode(true); item.removeAttribute("id"); item.classList.add("item"); - item.querySelector(this.selectors.itemName).textContent = ruleset.name; - const descr = item.querySelector(this.selectors.itemDescr); - if (ruleset.enabled) { - setUpdateDate(ruleset, descr); - } else { - descr.textContent = TorStrings.rulesets.disabled; - item.classList.add("disabled"); - } + item.querySelector(".name").textContent = ruleset.name; + const descr = item.querySelector(".description"); + setUpdateDate(ruleset, descr); + item.classList.toggle("disabled", !ruleset.enabled); item.setAttribute(this.nameAttribute, ruleset.name); item.addEventListener("click", () => { this.onRulesetClick(ruleset); @@ -478,7 +373,6 @@ class AboutRulesets { async init() { const args = await RPMSendQuery("rulesets:get-init-args"); - TorStrings = args.TorStrings; const showWarning = args.showWarning; this.list = new RulesetList(); ===================================== browser/locales/en-US/browser/tor-browser.ftl ===================================== @@ -557,3 +557,53 @@ downloads-tor-warning-title = Be careful opening downloads downloads-tor-warning-description = Some files may connect to the internet when opened without using Tor. To be safe, open the files while offline or use a portable operating system like <a data-l10n-name="tails-link">Tails</a>. # Button to dismiss the warning forever. downloads-tor-warning-dismiss-button = Got it + +## Initial warning page in about:rulesets. In Tor Browser, each ruleset is a set of rules for converting a ".tor.onion" address to a normal ".onion" address (used by SecureDrop). The feature is taken from the discontinued "HTTPS Everywhere". + +rulesets-warning-heading = Proceed with Caution +rulesets-warning-description = Adding or modifying rulesets can cause attackers to hijack your browser. Proceed only if you know what you are doing. +rulesets-warning-checkbox = Warn me when I attempt to access these preferences +rulesets-warning-continue-button = Accept the Risk and Continue + +## Side panel in about:rulesets. In Tor Browser, each ruleset is a set of rules for converting a ".tor.onion" address to a normal ".onion" address (used by SecureDrop). The feature is taken from the discontinued "HTTPS Everywhere". + +rulesets-side-panel-heading = Rulesets +rulesets-side-panel-no-rules = No rulesets found +# -brand-short-name refers to 'Tor Browser', localized. +rulesets-side-panel-no-rules-description = When you save a ruleset in { -brand-short-name }, it will show up here. + +## Ruleset update date in about:rulesets. + +# $date (Date) - The update date. The DATETIME function will format the $date according to the locale, using a "long" style. E.g. "January 1, 2000" for English (US), "١ يناير ٢٠٠٠" for Arabic, "2000년 1월 1일" in Korean, and "1 января 2000 г." in Russian. +rulesets-update-last = Last updated { DATETIME($date, dateStyle: "long") } +rulesets-update-never = Never updated, or last update failed +# Shown when the ruleset is disabled. +rulesets-update-rule-disabled = Disabled + +## Ruleset details in about:rulesets. In Tor Browser, each ruleset is a set of rules for converting a ".tor.onion" address to a normal ".onion" address (used by SecureDrop). The feature is taken from the discontinued "HTTPS Everywhere". + +rulesets-details-edit-button = Edit +rulesets-details-enable-checkbox = Enable this ruleset +rulesets-details-update-button = Check for Updates +rulesets-details-save-button = Save +rulesets-details-cancel-button = Cancel +# "JWK" refers to "JSON Web Key" and likely should not be translated. +rulesets-details-jwk = JWK +# "JWK" refers to "JSON Web Key" and likely should not be translated. +rulesets-details-jwk-input = + .placeholder = The key used to sign this ruleset in the JWK (JSON Web Key) format +# "JWK" refers to "JSON Web Key" and likely should not be translated. +rulesets-details-jwk-input-invalid = The JWK could not be parsed, or it is not a valid key +# "Path" refers to the URL domain this rule applies to. +rulesets-details-path = Path Prefix +rulesets-details-path-input = + .placeholder = URL prefix that contains the files needed by the ruleset +# "HTTP(S)" refers to "HTTP or HTTPS". +rulesets-details-path-input-invalid = The path prefix is not a valid HTTP(S) URL +# "Scope" refers to the breadth of URLs this rule applies to (as a regular expression). +rulesets-details-scope = Scope +# "Regular expression" refers to the computing term for a special pattern used for matching: https://en.wikipedia.org/wiki/Regular_expression. +rulesets-details-scope-input = + .placeholder = Regular expression for the scope of the rules +# "Regular expression" refers to the computing term for a special pattern used for matching: https://en.wikipedia.org/wiki/Regular_expression. +rulesets-details-scope-input-invalid = The scope could not be parsed as a regular expression ===================================== toolkit/modules/TorStrings.sys.mjs ===================================== @@ -429,54 +429,6 @@ const Loader = { learnMoreURLNotification: `https://tb-manual.torproject.org/${getLocale()}/onion-services/`, }; } /* OnionLocation */, - - /* - Rulesets - */ - rulesets() { - const strings = { - // Initial warning - warningTitle: "Proceed with Caution", - warningDescription: - "Adding or modifying rulesets can cause attackers to hijack your browser. Proceed only if you know what you are doing.", - warningEnable: "Warn me when I attempt to access these preferences", - warningButton: "Accept the Risk and Continue", - // Ruleset list - rulesets: "Rulesets", - noRulesets: "No rulesets found", - noRulesetsDescr: - "When you save a ruleset in Tor Browser, it will show up here.", - lastUpdated: "Last updated %S", - neverUpdated: "Never updated, or last update failed", - enabled: "Enabled", - disabled: "Disabled", - // Ruleset details - edit: "Edit", - name: "Name", - jwk: "JWK", - pathPrefix: "Path Prefix", - scope: "Scope", - enable: "Enable this ruleset", - checkUpdates: "Check for Updates", - // Add ruleset - jwkPlaceholder: - "The key used to sign this ruleset in the JWK (JSON Web Key) format", - jwkInvalid: "The JWK could not be parsed, or it is not a valid key", - pathPrefixPlaceholder: - "URL prefix that contains the files needed by the ruleset", - pathPrefixInvalid: "The path prefix is not a valid HTTP(S) URL", - scopePlaceholder: "Regular expression for the scope of the rules", - scopeInvalid: "The scope could not be parsed as a regular expression", - save: "Save", - cancel: "Cancel", - }; - - const tsb = new TorPropertyStringBundle( - ["chrome://torbutton/locale/rulesets.properties"], - "rulesets." - ); - return tsb.getStrings(strings); - } /* Rulesets */, }; export const TorStrings = { @@ -507,11 +459,4 @@ export const TorStrings = { } return this._onionLocation; }, - - get rulesets() { - if (!this._rulesets) { - this._rulesets = Loader.rulesets(); - } - return this._rulesets; - }, }; ===================================== toolkit/torbutton/chrome/locale/en-US/rulesets.properties deleted ===================================== @@ -1,35 +0,0 @@ -# Copyright (c) 2022, The Tor Project, Inc. -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -# about:rulesets strings. -rulesets.warningTitle=Proceed with Caution -rulesets.warningDescription=Adding or modifying rulesets can cause attackers to hijack your browser. Proceed only if you know what you are doing. -rulesets.warningEnable=Warn me when I attempt to access these preferences -rulesets.warningButton=Accept the Risk and Continue -# Ruleset list -rulesets.rulesets=Rulesets -rulesets.noRulesets=No rulesets found -rulesets.noRulesetsDescr=When you save a ruleset in Tor Browser, it will show up here. -# LOCALIZATION NOTE: %S will be replaced by the update date (automatically formatted by Firefox's l10n component) -rulesets.lastUpdated=Last updated %S -rulesets.neverUpdated=Never updated, or last update failed -rulesets.enabled=Enabled -rulesets.disabled=Disabled -# Ruleset details/edit ruleset -rulesets.edit=Edit -rulesets.name=Name -rulesets.jwk=JWK -rulesets.pathPrefix=Path Prefix -rulesets.scope=Scope -rulesets.enable=Enable this ruleset -rulesets.checkUpdates=Check for Updates -rulesets.jwkPlaceholder=The key used to sign this ruleset in the JWK (JSON Web Key) format -rulesets.jwkInvalid=The JWK could not be parsed, or it is not a valid key -rulesets.pathPrefixPlaceholder=URL prefix that contains the files needed by the ruleset -rulesets.pathPrefixInvalid=The path prefix is not a valid HTTP(S) URL -rulesets.scopePlaceholder=Regular expression for the scope of the rules -rulesets.scopeInvalid=The scope could not be parsed as a regular expression -rulesets.save=Save -rulesets.cancel=Cancel ===================================== tools/torbrowser/l10n/migrations/bug-42206-rulesets.py ===================================== @@ -0,0 +1,70 @@ +import fluent.syntax.ast as FTL +from fluent.migrate.helpers import transforms_from +from fluent.migrate.transforms import REPLACE + + +def migrate(ctx): + legacy_path = "rulesets.properties" + + ctx.add_transforms( + "tor-browser.ftl", + "tor-browser.ftl", + transforms_from( + """ +rulesets-warning-heading = { COPY(path, "rulesets.warningTitle") } +rulesets-warning-description = { COPY(path, "rulesets.warningDescription") } +rulesets-warning-checkbox = { COPY(path, "rulesets.warningEnable") } +rulesets-warning-continue-button = { COPY(path, "rulesets.warningButton") } + +rulesets-side-panel-heading = { COPY(path, "rulesets.rulesets") } +rulesets-side-panel-no-rules = { COPY(path, "rulesets.noRulesets") } + +rulesets-update-never = { COPY(path, "rulesets.neverUpdated") } +rulesets-update-rule-disabled = { COPY(path, "rulesets.disabled") } + +rulesets-details-edit-button = { COPY(path, "rulesets.edit") } +rulesets-details-enable-checkbox = { COPY(path, "rulesets.enable") } +rulesets-details-update-button = { COPY(path, "rulesets.checkUpdates") } +rulesets-details-save-button = { COPY(path, "rulesets.save") } +rulesets-details-cancel-button = { COPY(path, "rulesets.cancel") } +rulesets-details-jwk-input = + .placeholder = { COPY(path, "rulesets.jwkPlaceholder") } +rulesets-details-jwk-input-invalid = { COPY(path, "rulesets.jwkInvalid") } +rulesets-details-path = { COPY(path, "rulesets.pathPrefix") } +rulesets-details-path-input = + .placeholder = { COPY(path, "rulesets.pathPrefixPlaceholder") } +rulesets-details-path-input-invalid = { COPY(path, "rulesets.pathPrefixInvalid") } +rulesets-details-scope = { COPY(path, "rulesets.scope") } +rulesets-details-scope-input = + .placeholder = { COPY(path, "rulesets.scopePlaceholder") } +rulesets-details-scope-input-invalid = { COPY(path, "rulesets.scopeInvalid") } +""", + path=legacy_path, + ) + + [ + # Replace "%1$S" with "{ DATETIME($date, dateStyle: "long") }" + FTL.Message( + FTL.Identifier("rulesets-update-last"), + value=REPLACE( + legacy_path, + "rulesets.lastUpdated", + { + "%1$S": FTL.FunctionReference( + FTL.Identifier("DATETIME"), + arguments=FTL.CallArguments( + positional=[ + FTL.VariableReference(FTL.Identifier("date")) + ], + named=[ + FTL.NamedArgument( + FTL.Identifier("dateStyle"), + value=FTL.StringLiteral("long"), + ) + ], + ), + ) + }, + ), + ), + ], + ) View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/08ed48… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/08ed48… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/firefox-android][firefox-android-115.2.1-13.5-1] add to fixup! Enable the connect assist experiments on alpha
by Dan Ballard (@dan) 16 Apr '24

16 Apr '24
Dan Ballard pushed to branch firefox-android-115.2.1-13.5-1 at The Tor Project / Applications / firefox-android Commits: 3768f68b by clairehurst at 2024-04-16T14:32:55-06:00 add to fixup! Enable the connect assist experiments on alpha - - - - - 3 changed files: - android-components/components/concept/engine/src/main/java/mozilla/components/concept/engine/Settings.kt - fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt - fenix/app/src/main/res/layout/tor_network_settings_beta_connection_features.xml Changes: ===================================== android-components/components/concept/engine/src/main/java/mozilla/components/concept/engine/Settings.kt ===================================== @@ -258,7 +258,7 @@ data class DefaultSettings( override var cookieBannerHandlingDetectOnlyMode: Boolean = false, override var torSecurityLevel: Int = 4, override var spoofEnglish: Boolean = false, - override var useNewBootstrap: Boolean = false, + override var useNewBootstrap: Boolean = true, ) : Settings() class UnsupportedSetting<T> { ===================================== fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt ===================================== @@ -1857,16 +1857,16 @@ class Settings(private val appContext: Context) : PreferencesHolder { var useNewBootstrap by booleanPreference( appContext.getPreferenceKey(R.string.pref_key_use_new_bootstrap), - default = false, + default = true, ) var useNewBootstrapNativeUi by booleanPreference( appContext.getPreferenceKey(R.string.pref_key_use_new_bootstrap_with_android_native), - default = false, + default = true, ) var useNewBootstrapHtmlUi by booleanPreference( appContext.getPreferenceKey(R.string.pref_key_use_new_bootstrap_with_html), - default = true + default = false ) } ===================================== fenix/app/src/main/res/layout/tor_network_settings_beta_connection_features.xml ===================================== @@ -60,7 +60,7 @@ app:layout_constraintTop_toBottomOf="@id/enable_beta_connection_features_summary"> <org.mozilla.fenix.settings.PreferenceBackedRadioButton - android:id="@+id/use_new_bootstrap_with_html_ui_radio_button" + android:id="@+id/use_new_bootstrap_with_native_ui_radio_button" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?android:attr/selectableItemBackground" @@ -70,15 +70,15 @@ android:paddingTop="@dimen/radio_button_preference_vertical" android:paddingEnd="@dimen/radio_button_preference_horizontal" android:paddingBottom="@dimen/radio_button_preference_vertical" - android:text="HTML UI" + android:text="Native Android UI" android:textAppearance="?android:attr/textAppearanceListItem" android:textSize="16sp" app:drawableStartCompat="?android:attr/listChoiceIndicatorSingle" - app:preferenceKey="@string/pref_key_use_new_bootstrap_with_html" + app:preferenceKey="@string/pref_key_use_new_bootstrap_with_android_native" app:preferenceKeyDefaultValue="true" /> <org.mozilla.fenix.settings.PreferenceBackedRadioButton - android:id="@+id/use_new_bootstrap_with_native_ui_radio_button" + android:id="@+id/use_new_bootstrap_with_html_ui_radio_button" android:layout_width="match_parent" android:layout_height="48dp" android:background="?android:attr/selectableItemBackground" @@ -88,11 +88,11 @@ android:paddingTop="@dimen/radio_button_preference_vertical" android:paddingEnd="@dimen/radio_button_preference_horizontal" android:paddingBottom="@dimen/radio_button_preference_vertical" - android:text="Native Android UI" + android:text="HTML UI" android:textAppearance="?android:attr/textAppearanceListItem" android:textSize="16sp" app:drawableStartCompat="?android:attr/listChoiceIndicatorSingle" - app:preferenceKey="@string/pref_key_use_new_bootstrap_with_android_native" + app:preferenceKey="@string/pref_key_use_new_bootstrap_with_html" app:preferenceKeyDefaultValue="false" /> </RadioGroup> View it on GitLab: https://gitlab.torproject.org/tpo/applications/firefox-android/-/commit/376… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/firefox-android/-/commit/376… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/mullvad-browser][mullvad-browser-115.10.0esr-13.5-1] fixup! Bug 41631: Prevent weird initial window dimensions caused by subpixel computations
by ma1 (@ma1) 16 Apr '24

16 Apr '24
ma1 pushed to branch mullvad-browser-115.10.0esr-13.5-1 at The Tor Project / Applications / Mullvad Browser Commits: a17ec8e0 by hackademix at 2024-04-16T22:18:31+02:00 fixup! Bug 41631: Prevent weird initial window dimensions caused by subpixel computations Bug 42520: Correctly record new initial window size after auto-shrinking - - - - - 1 changed file: - toolkit/components/resistfingerprinting/RFPHelper.sys.mjs Changes: ===================================== toolkit/components/resistfingerprinting/RFPHelper.sys.mjs ===================================== @@ -633,9 +633,16 @@ class _RFPHelper { lazy.logConsole.error(e); } } - if (needToShrink) { - win.shrinkToLetterbox(); - this._recordWindowSize(win); + if (needToShrink && win.shrinkToLetterbox()) { + win.addEventListener( + "resize", + () => { + // We need to record the "new" initial size in this listener + // because resized dimensions are not immediately available. + RFPHelper._recordWindowSize(win); + }, + { once: true } + ); } }); }, @@ -741,23 +748,30 @@ class _RFPHelper { } _recordWindowSize(aWindow) { - aWindow._rfpOriginalSize = { - width: aWindow.outerWidth, - height: aWindow.outerHeight, - containerHeight: aWindow.gBrowser.getBrowserContainer()?.clientHeight, - }; - log("Recording original window size", aWindow._rfpOriginalSize); + aWindow.promiseDocumentFlushed(() => { + aWindow._rfpOriginalSize = { + width: aWindow.outerWidth, + height: aWindow.outerHeight, + containerHeight: aWindow.gBrowser.getBrowserContainer()?.clientHeight, + }; + log("Recording original window size", aWindow._rfpOriginalSize); + }); } // We will attach this method to each browser window. When called // it will instantly resize the window to exactly fit the selected // (possibly letterboxed) browser. + // Returns true if a window resize will occur, false otherwise. shrinkToLetterbox() { let { selectedBrowser } = this.gBrowser; let stack = selectedBrowser.closest(".browserStack"); const outer = stack.getBoundingClientRect(); const inner = selectedBrowser.getBoundingClientRect(); - this.resizeBy(inner.width - outer.width, inner.height - outer.height); + if (inner.width !== outer.witdh || inner.height !== outer.height) { + this.resizeBy(inner.width - outer.width, inner.height - outer.height); + return true; + } + return false; } _onWindowDoubleClick(e) { View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/a17… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/a17… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][base-browser-115.10.0esr-13.5-1] fixup! Bug 41631: Prevent weird initial window dimensions caused by subpixel computations
by ma1 (@ma1) 16 Apr '24

16 Apr '24
ma1 pushed to branch base-browser-115.10.0esr-13.5-1 at The Tor Project / Applications / Tor Browser Commits: 97575530 by hackademix at 2024-04-16T22:17:42+02:00 fixup! Bug 41631: Prevent weird initial window dimensions caused by subpixel computations Bug 42520: Correctly record new initial window size after auto-shrinking - - - - - 1 changed file: - toolkit/components/resistfingerprinting/RFPHelper.sys.mjs Changes: ===================================== toolkit/components/resistfingerprinting/RFPHelper.sys.mjs ===================================== @@ -633,9 +633,16 @@ class _RFPHelper { lazy.logConsole.error(e); } } - if (needToShrink) { - win.shrinkToLetterbox(); - this._recordWindowSize(win); + if (needToShrink && win.shrinkToLetterbox()) { + win.addEventListener( + "resize", + () => { + // We need to record the "new" initial size in this listener + // because resized dimensions are not immediately available. + RFPHelper._recordWindowSize(win); + }, + { once: true } + ); } }); }, @@ -741,23 +748,30 @@ class _RFPHelper { } _recordWindowSize(aWindow) { - aWindow._rfpOriginalSize = { - width: aWindow.outerWidth, - height: aWindow.outerHeight, - containerHeight: aWindow.gBrowser.getBrowserContainer()?.clientHeight, - }; - log("Recording original window size", aWindow._rfpOriginalSize); + aWindow.promiseDocumentFlushed(() => { + aWindow._rfpOriginalSize = { + width: aWindow.outerWidth, + height: aWindow.outerHeight, + containerHeight: aWindow.gBrowser.getBrowserContainer()?.clientHeight, + }; + log("Recording original window size", aWindow._rfpOriginalSize); + }); } // We will attach this method to each browser window. When called // it will instantly resize the window to exactly fit the selected // (possibly letterboxed) browser. + // Returns true if a window resize will occur, false otherwise. shrinkToLetterbox() { let { selectedBrowser } = this.gBrowser; let stack = selectedBrowser.closest(".browserStack"); const outer = stack.getBoundingClientRect(); const inner = selectedBrowser.getBoundingClientRect(); - this.resizeBy(inner.width - outer.width, inner.height - outer.height); + if (inner.width !== outer.witdh || inner.height !== outer.height) { + this.resizeBy(inner.width - outer.width, inner.height - outer.height); + return true; + } + return false; } _onWindowDoubleClick(e) { View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/9757553… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/9757553… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-115.10.0esr-13.5-1] fixup! Add TorStrings module for localization
by Pier Angelo Vendrame (@pierov) 16 Apr '24

16 Apr '24
Pier Angelo Vendrame pushed to branch tor-browser-115.10.0esr-13.5-1 at The Tor Project / Applications / Tor Browser Commits: 08ed48fa by Henry Wilkes at 2024-04-16T16:31:30+01:00 fixup! Add TorStrings module for localization Bug 42521: Drop unused onboarding strings. - - - - - 2 changed files: - − toolkit/torbutton/chrome/locale/en-US/browserOnboarding.properties - − toolkit/torbutton/chrome/locale/en-US/onboarding.properties Changes: ===================================== toolkit/torbutton/chrome/locale/en-US/browserOnboarding.properties deleted ===================================== @@ -1,73 +0,0 @@ -# Copyright (c) 2019, The Tor Project, Inc. -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -onboarding.tour-tor-welcome=Welcome -onboarding.tour-tor-welcome.title=You’re ready. -onboarding.tour-tor-welcome.description=Tor Browser offers the highest standard of privacy and security while browsing the web. You’re now protected against tracking, surveillance, and censorship. This quick onboarding will show you how. -onboarding.tour-tor-welcome.next-button=Go to Privacy - -onboarding.tour-tor-privacy=Privacy -onboarding.tour-tor-privacy.title=Snub trackers and snoopers. -onboarding.tour-tor-privacy.description=Tor Browser isolates cookies and deletes your browser history after your session. These modifications ensure your privacy and security are protected in the browser. Click ‘Tor Network’ to learn how we protect you on the network level. -onboarding.tour-tor-privacy.button=Go to Tor Network - -onboarding.tour-tor-network=Tor Network -onboarding.tour-tor-network.title=Travel a decentralized network. -onboarding.tour-tor-network.description=Tor Browser connects you to the Tor network run by thousands of volunteers around the world. Unlike a VPN, there’s no single point of failure or centralized entity you need to trust in order to enjoy the internet privately. -onboarding.tour-tor-network.description-para2=NEW: Tor Network Settings, including the ability to request bridges where Tor is blocked, can now be found in Preferences. -onboarding.tour-tor-network.action-button=Adjust Your Tor Network Settings -onboarding.tour-tor-network.button=Go to Circuit Display - -onboarding.tour-tor-circuit-display=Circuit Display -onboarding.tour-tor-circuit-display.title=See your path. -onboarding.tour-tor-circuit-display.description=For each domain you visit, your traffic is relayed and encrypted in a circuit across three Tor relays around the world. No website knows where you are connecting from. You can request a new circuit by clicking ‘New Circuit for this Site’ on our Circuit Display. -onboarding.tour-tor-circuit-display.button=See My Path -onboarding.tour-tor-circuit-display.next-button=Go to Security - -onboarding.tour-tor-security=Security -onboarding.tour-tor-security.title=Choose your experience. -onboarding.tour-tor-security.description=We also provide you with additional settings for bumping up your browser security. Our Security Settings allow you to block elements that could be used to attack your computer. Click below to see what the different options do. -onboarding.tour-tor-security.description-suffix=Note: By default, NoScript and HTTPS Everywhere are not included on the toolbar, but you can customize your toolbar to add them. -onboarding.tour-tor-security-level.button=See Your Security Level -onboarding.tour-tor-security-level.next-button=Go to Experience Tips - -onboarding.tour-tor-expect-differences=Experience Tips -onboarding.tour-tor-expect-differences.title=Expect some differences. -onboarding.tour-tor-expect-differences.description=With all the security and privacy features provided by Tor, your experience while browsing the internet may be a little different. Things may be a bit slower, and depending on your security level, some elements may not work or load. You may also be asked to prove you are a human and not a robot. -onboarding.tour-tor-expect-differences.button=See FAQs -onboarding.tour-tor-expect-differences.next-button=Go to Onion Services - -onboarding.tour-tor-onion-services=Onion Services -onboarding.tour-tor-onion-services.title=Be extra protected. -onboarding.tour-tor-onion-services.description=Onion services are sites that end with a .onion that provide extra protections to publishers and visitors, including added safeguards against censorship. Onion services allow anyone to provide content and services anonymously. Click below to visit the DuckDuckGo onion site. -onboarding.tour-tor-onion-services.button=Visit an Onion -onboarding.tour-tor-onion-services.next-button=Done - -onboarding.overlay-icon-tooltip-updated2=See what's new\nin %S -onboarding.tour-tor-update.prefix-new=New -onboarding.tour-tor-update.prefix-updated=Updated - -onboarding.tour-tor-toolbar=Toolbar -onboarding.tour-tor-toolbar-update-9.0.title=Goodbye Onion Button. -onboarding.tour-tor-toolbar-update-9.0.description=We want your experience using Tor to be fully integrated within Tor Browser. -onboarding.tour-tor-toolbar-update-9.0.description-para2=That's why now, rather than using the onion button, you can see your Tor Circuit via the [i] in the URL bar and request a New Identity using the toolbar button or the [≡] menu. -onboarding.tour-tor-toolbar-update-9.0.button=How to Request a New Identity -onboarding.tour-tor-toolbar-update-9.0.next-button=Go to Tor Network - -# Circuit Display onboarding. -onboarding.tor-circuit-display.next=Next -onboarding.tor-circuit-display.done=Done -onboarding.tor-circuit-display.one-of-three=1 of 3 -onboarding.tor-circuit-display.two-of-three=2 of 3 -onboarding.tor-circuit-display.three-of-three=3 of 3 - -onboarding.tor-circuit-display.intro.title=How do circuits work? -onboarding.tor-circuit-display.intro.msg=Circuits are made up of randomly assigned relays, which are computers around the world configured to forward Tor traffic. Circuits allow you to browse privately and to connect to onion services. - -onboarding.tor-circuit-display.diagram.title=Circuit Display -onboarding.tor-circuit-display.diagram.msg=This diagram shows the relays that make up the circuit for this website. To prevent linking of activity across different sites, each website gets a different circuit. - -onboarding.tor-circuit-display.new-circuit.title=Do you need a new circuit? -onboarding.tor-circuit-display.new-circuit.msg=If you are not able to connect to the website you’re trying to visit or it is not loading properly, then you can use this button to reload the site with a new circuit. ===================================== toolkit/torbutton/chrome/locale/en-US/onboarding.properties deleted ===================================== @@ -1,19 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# LOCALIZATION NOTE(onboarding.overlay-icon-tooltip2): This string will be used -# to show the tooltip alongside the notification icon in the overlay tour. %S is -# brandShortName. The tooltip is designed to show in two lines. Please use \n to -# do appropriate line breaking. -onboarding.overlay-icon-tooltip2=New to %S?\nLet’s get started. -# LOCALIZATION NOTE(onboarding.overlay-icon-tooltip-updated2): %S is -# brandShortName. The tooltip is designed to show in two lines. Please use \n to -# do appropriate line breaking. -onboarding.overlay-icon-tooltip-updated2=%S is all new.\nSee what you can do! -# LOCALIZATION NOTE(onboarding.overlay-close-button-tooltip): The overlay close button is an icon button. This tooltip would be shown when mousing hovering on the button. -onboarding.overlay-close-button-tooltip=Close -# LOCALIZATION NOTE(onboarding.notification-close-button-tooltip): The notification close button is an icon button. This tooltip would be shown when mousing hovering on the button. -onboarding.notification-close-button-tooltip=Dismiss -# LOCALIZATION NOTE(onboarding.complete): This string is used to describe an -# onboarding tour item that is complete. -onboarding.complete=Complete View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/08ed48f… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/08ed48f… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-115.10.0esr-13.5-1] fixup! Bug 41631: Prevent weird initial window dimensions caused by subpixel computations
by ma1 (@ma1) 16 Apr '24

16 Apr '24
ma1 pushed to branch tor-browser-115.10.0esr-13.5-1 at The Tor Project / Applications / Tor Browser Commits: 334c638e by hackademix at 2024-04-16T17:24:54+02:00 fixup! Bug 41631: Prevent weird initial window dimensions caused by subpixel computations Bug 42520: Correctly record new initial window size after auto-shrinking - - - - - 1 changed file: - toolkit/components/resistfingerprinting/RFPHelper.sys.mjs Changes: ===================================== toolkit/components/resistfingerprinting/RFPHelper.sys.mjs ===================================== @@ -633,9 +633,16 @@ class _RFPHelper { lazy.logConsole.error(e); } } - if (needToShrink) { - win.shrinkToLetterbox(); - this._recordWindowSize(win); + if (needToShrink && win.shrinkToLetterbox()) { + win.addEventListener( + "resize", + () => { + // We need to record the "new" initial size in this listener + // because resized dimensions are not immediately available. + RFPHelper._recordWindowSize(win); + }, + { once: true } + ); } }); }, @@ -741,23 +748,30 @@ class _RFPHelper { } _recordWindowSize(aWindow) { - aWindow._rfpOriginalSize = { - width: aWindow.outerWidth, - height: aWindow.outerHeight, - containerHeight: aWindow.gBrowser.getBrowserContainer()?.clientHeight, - }; - log("Recording original window size", aWindow._rfpOriginalSize); + aWindow.promiseDocumentFlushed(() => { + aWindow._rfpOriginalSize = { + width: aWindow.outerWidth, + height: aWindow.outerHeight, + containerHeight: aWindow.gBrowser.getBrowserContainer()?.clientHeight, + }; + log("Recording original window size", aWindow._rfpOriginalSize); + }); } // We will attach this method to each browser window. When called // it will instantly resize the window to exactly fit the selected // (possibly letterboxed) browser. + // Returns true if a window resize will occur, false otherwise. shrinkToLetterbox() { let { selectedBrowser } = this.gBrowser; let stack = selectedBrowser.closest(".browserStack"); const outer = stack.getBoundingClientRect(); const inner = selectedBrowser.getBoundingClientRect(); - this.resizeBy(inner.width - outer.width, inner.height - outer.height); + if (inner.width !== outer.witdh || inner.height !== outer.height) { + this.resizeBy(inner.width - outer.width, inner.height - outer.height); + return true; + } + return false; } _onWindowDoubleClick(e) { View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/334c638… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/334c638… You're receiving this email because of your account on gitlab.torproject.org.
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • ...
  • 803
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.