Closed Bug 1963545 Opened 1 year ago Closed 1 year ago

Replace nsContentUtils::SpoofLocaleEnglish with ShouldResistFingerprinting(RFPTarget::JSLocale)

Categories

(Core :: Privacy: Anti-Tracking, task)

task

Tracking

()

RESOLVED FIXED
140 Branch
Tracking Status
firefox140 --- fixed

People

(Reporter: tschuster, Assigned: tschuster)

References

Details

Attachments

(1 external file)

ShouldResistFingerprinting(RFPTarget::JSLocale) already uses the pref privacy.spoof_english under the hood, so I don't think we need the older method.

Assignee: nobody → tschuster

test_SVG_switch_language_spoof.html fails now. Are we maybe caching the RFP state?

I don't think so. Do .html tests run with system principal? nsContentUtils::SpoofLocaleEnglish didn't used to check for principal, maybe aDoc->ShouldResistFingerprinting(RFPTarget::JSLocale) returns false because the doc is chrome?

No, the test isn't running with system principal. The problem is that we actually change the preference intl.accept_languages to English when setting the privacy.spoof_english to 2. It would be nice to remove that code and instead change all users of intl.accept_languages to respect RFPTarget::JSLocale instead.

I worked around this by switching around the order of the test.

Attachment #9484497 - Attachment description: WIP: Bug 1963545 - Replace nsContentUtils::SpoofLocaleEnglish with ShouldResistFingerprinting(RFPTarget::JSLocale) → Bug 1963545 - Replace nsContentUtils::SpoofLocaleEnglish with ShouldResistFingerprinting(RFPTarget::JSLocale). r?fkilic
See Also: → 1869821

This patch changes our behavior so that we only respect privacy.spoof_english = 2 when FPP or RFP is enabled. Previously privacy.spoof_english was documented to work in conjunction with RFP, but didn't actually require privacy.resistFingerprinting.

Pushed by bhearsum@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/98df7963c3f1 Replace nsContentUtils::SpoofLocaleEnglish with ShouldResistFingerprinting(RFPTarget::JSLocale). r=fkilic
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 140 Branch

(In reply to Tom Schuster (MoCo) from comment #5)

This patch changes our behavior so that we only respect privacy.spoof_english = 2 when FPP or RFP is enabled. Previously privacy.spoof_english was documented to work in conjunction with RFP, but didn't actually require privacy.resistFingerprinting.

Sorry, probably a bit OT for this Bug, but why is test changing this pref a problem?
I got several test failures I still haven't managed to check because of this in the tests I wrote for my Bug 1666613 patch.

Sorry, probably a bit OT for this Bug, but why is test changing this pref a problem?

Which pref, do you mean intl.accept_languages or the privacy prefs? For the former it's problematic because when a pref is changed in the background, without e.g. using SpecialPowers.pushPrefEnv, that might influence other tests. In this specific case I think it's also a bit confusing, because it doesn't even seem necessary at first glance.

(In reply to Tom Schuster (MoCo) from comment #9)

Sorry, probably a bit OT for this Bug, but why is test changing this pref a problem?

Which pref, do you mean intl.accept_languages or the privacy prefs? For the former it's problematic because when a pref is changed in the background, without e.g. using SpecialPowers.pushPrefEnv, that might influence other tests. In this specific case I think it's also a bit confusing, because it doesn't even seem necessary at first glance.

Yes, I meant intl.accept_languages.
It makes sense, thanks.

QA Whiteboard: [qa-triage-done-c141/b140]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: