Verified Commit 0fb43ff1 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃 Committed by ma1
Browse files

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.
parent 1c3eb8ca
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -486,6 +486,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);