tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 0431514d8aedcec4395c6f25006d64cf7a6ce415
parent 95a16b0b62a7ffc462a486c62e21ba6b6850de2b
Author: Pier Angelo Vendrame <pierov@torproject.org>
Date:   Wed, 18 May 2022 19:22:37 +0200

BB 40309: Avoid using regional OS locales

Avoid regional OS locales if the pref
`intl.regional_prefs.use_os_locales` is false but RFP is enabled.

Diffstat:
Mintl/locale/LocaleService.cpp | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/intl/locale/LocaleService.cpp b/intl/locale/LocaleService.cpp @@ -490,6 +490,16 @@ LocaleService::GetAppLocaleAsBCP47(nsACString& aRetVal) { NS_IMETHODIMP LocaleService::GetRegionalPrefsLocales(nsTArray<nsCString>& aRetVal) { + // tor-browser#42349, #42771: We cannot use JSLocale because it is spoof + // English. So, we use another target for now. + if (nsContentUtils::ShouldResistFingerprinting( + "This is probably a patch that should be refined. But to get the " + "build going, we just keep applying this generic check.", + RFPTarget::JSDateTimeUTC)) { + GetAppLocalesAsBCP47(aRetVal); + return NS_OK; + } + bool useOSLocales = Preferences::GetBool("intl.regional_prefs.use_os_locales", false);