gecko-dev/toolkit/components/resistfingerprinting
Tim Huang a0b6e42c61 Bug 1330890 - Part 1: Spoofing the time zone as UTC when fingerprinting resistance is enabled (adopt from Tor #16622). r=arthuredelstein,Ehsan
This patch adds a new service for fingerprinting resistance, which is called
nsRFPService. This service will be put in /toolkit/components/resistfingerprinting.
This service is responsible for observing the change of pref 'privacy.resistfingerprinting'
and doing underlying jobs. And it also in charge of caching pref setting of
'privacy.resistfingerprinting' and changing environment value 'TZ'.

This service will be initialized within nsContentUtils::Init(). During initialization,
it will store the original TZ value and set the value according to 'privacy.resistfingerprinting'.
It also changes environment value 'TZ' and calls nsJSUtils::ResetTimeZone() in
response to the change of the pref.

This service is only a nsIObserver for now. In the future, however, it will be
responsible for more fingerprinting resistance jobs, like changing prefs after
'privacy.resistfingerprinting' is changed.

The environment variable 'TZ' will be set to 'UTC' when 'privacy.resistFingerprinting'
is true. By doing so, Firefox will use UTC as its local time zone instead of the
default local time zone. This prevents a browser be fingerprinted through the local time zone.
After the 'privacy.resistFingerprinting' is turned off, the service will restore
'TZ' back to the original TZ setting, the user's setting or the default system timezone.

MozReview-Commit-ID: 8V47ZATgrKE

--HG--
extra : rebase_source : a35d35e8f8bbf5f5015271d3df3c32420702506c
2017-05-02 15:21:04 +08:00
..
moz.build
nsRFPService.cpp
nsRFPService.h