Skip to content

Commit

Permalink
Bug 1875313 - Use en-US as a fallback when spoof English is enabled i…
Browse files Browse the repository at this point in the history
…n ICUUtils. r=timhuang,tjr

Differential Revision: https://phabricator.services.mozilla.com/D198967
  • Loading branch information
PieroV committed Jan 31, 2024
1 parent dc04614 commit 69ffaa7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion intl/unicharutil/util/ICUUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ already_AddRefed<nsAtom> ICUUtils::LanguageTagIterForContent::GetNext() {

if (mCurrentFallbackIndex < 2) {
mCurrentFallbackIndex = 2;
// Else take the app's locale:
// Else take the app's locale (or en-US, if spoof English applies):
if (mContent->OwnerDoc()->ShouldResistFingerprinting(RFPTarget::JSLocale)) {
return NS_Atomize("en-US");
}
nsAutoCString appLocale;
LocaleService::GetInstance()->GetAppLocaleAsBCP47(appLocale);
return NS_Atomize(appLocale);
Expand Down

0 comments on commit 69ffaa7

Please sign in to comment.