Closed
Bug 1470161
Opened 7 years ago
Closed 7 years ago
Firefox Quantum Nightly 63.0a1 yields wrong date/time when switching privacy.resistFingerprinting on then off again
Categories
(Core :: JavaScript Engine, defect, P1)
Tracking
()
RESOLVED
DUPLICATE
of bug 1346211
| Tracking | Status | |
|---|---|---|
| firefox62 | --- | fix-optional |
| firefox63 | --- | fix-optional |
People
(Reporter: dario.berzano, Assigned: xeonchen)
References
Details
(Whiteboard: [fingerprinting])
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Firefox/60.0
Build ID: 20180605171542
Steps to reproduce:
Open Firefox Quantum, do some work while leaving it open, come back to Firefox without ever quitting it.
Actual results:
Whatsapp Web shows timestamps in UTC time. Same happens for another site I use for carpooling reservations (that one's pretty annoying as I end up booking for the wrong time).
A JS console returns UTC time if I do:
(new Date()).toLocaleString()
By restarting the browser the problem is fixed, until it appears again, under undetermined circumstances. Testing it from the JS console confirms the problem is temporarily fixed.
Expected results:
See dates/times in my timezone.
| Reporter | ||
Comment 1•7 years ago
|
||
Additional information:
* From here: https://bugzilla.mozilla.org/show_bug.cgi?id=1330890 I can say that I have tried turning on and off privacy.resistFingerprinting. This is off on my Firefox though.
* Maybe some extensions could interfere with it? I have uBlock Origin and Facebook Container only.
While I was writing the ticket, it actually happened again... here is a very interesting excerpt from my JavaScript console if it can be of any help. I am quite puzzled.
---
// Note: I am currently in CEST (UTC+2)
// Initial situation: everything works
(new Date()).toLocaleString()
"21/6/2018, 16:03:35"
// Turn privacy.resistFingerprinting to true: works (uses UTC)
// (Note I have answered "yes" to an option asking me if I always want the
// English version of webpages, so displayed time locale is changed too)
(new Date()).toLocaleString()
"6/21/2018, 2:03:47 PM"
// Turn privacy.resistFingerprinting to false: does not work!
// Shows UTC+1 which is neither UTC nor my timezone!
(new Date()).toLocaleString()
"21/6/2018, 15:03:54"
Comment 2•7 years ago
|
||
It might be useful to know if the issue is reproducible in a brand new profile with the latest Nightly.
https://support.mozilla.com/kb/profile-manager-create-and-remove-firefox-profiles
https://www.mozilla.org/firefox/nightly/all/
Component: Untriaged → JavaScript Engine
OS: Unspecified → Mac OS X
Product: Firefox → Core
Hardware: Unspecified → x86
| Reporter | ||
Comment 3•7 years ago
|
||
Thanks for your feedback, so here's my result from 62.0a1 (2018-06-21, that is, today): unfortunately nothing changes. What you see below comes from the same shell kept open while toggling privacy.resistFingerprinting in about:config.
---
// Initial situation: privacy.resistFingerprinting = false: OK (shows CEST, my TZ)
new Date().toLocaleString()
"21/6/2018, 17:42:57"
// Set privacy.resistFingerprinting to true: OK (shows UTC)
new Date().toLocaleString()
"21/6/2018, 15:43:07"
// Reset privacy.resistFingerprinting to false: NOT OK (shows UTC+1???)
new Date().toLocaleString()
"21/6/2018, 16:43:14"
---
Restarting the browser fixes it.
So, while I cannot consistently reproduce my initial issue, I can consistently report that toggling privacy.resistFingerprinting results to a buggy behaviour in retrieving the current date/time from JavaScript.
| Reporter | ||
Updated•7 years ago
|
Summary: Firefox Quantum 60.0.2 (macOS) randomly switches timezone to UTC → Firefox Quantum Nightly 60.0a1 (macOS) yields wrong date/time when switching privacy.resistFingerprinting on then off again
Comment 4•7 years ago
|
||
Thanks for the report! There's definitely something screwy in RFP that we'll need to investigate.
Whiteboard: [fingerprinting]
Updated•7 years ago
|
Comment 5•7 years ago
|
||
As mentioned in bug 1409973 comment 7 and bug 1409973 comment 45, ICU doesn't understand "TZ=:/etc/localtime" <https://ssl.icu-project.org/trac/ticket/13694>, which can lead to issues when toggling RFP on and off without restarting the browser.
Comment 6•7 years ago
|
||
This is not just macOS (as per ticket title) or Linux, its also on Windows
FF61 (windows) + http://browserspy.dk/date.php
- start FF with RFP=false (working as expected)
* test: Tue Jul 03 2018 23:06:17 GMT+XXXX (YOUR REAL TIME)
* test (locale string): 7/3/2018, XX:06:17 XX
- change RFP=true, clear all data (ctrl-alt-del) and/or hard refresh test site (working as expected)
* test: Tue Jul 03 2018 11:07:40 GMT+0000 (UTC)
* test (locale string): 7/3/2018, 11:07:40 AM
- change RFP=false, clear all data (ctrl-alt-del) and/or hard refresh test site
* tests: no changes (not working as expected)
- start FF with RFP=true (working as expected)
* test: Tue Jul 03 2018 11:02:23 GMT+0000 (UTC)
* test (locale string): 7/3/2018, 11:02:23 AM
- change RFP=false, clear all data (ctrl-alt-del) and/or hard refresh test site
* test: no changes (not working as expected)
Once RFP=true it seems to need a restart if you wish to disable the TZ
| Reporter | ||
Updated•7 years ago
|
Summary: Firefox Quantum Nightly 60.0a1 (macOS) yields wrong date/time when switching privacy.resistFingerprinting on then off again → Firefox Quantum Nightly 63.0a1 yields wrong date/time when switching privacy.resistFingerprinting on then off again
Comment 7•7 years ago
|
||
Maybe it's as simple as adding a call to |tzset()| (resp. |_tzset()|) to nsRFPService::UpdateRFPPref() after updating the TZ environment variable (and before calling |nsJSUtils::ResetTimeZone()|)?
| Assignee | ||
Updated•7 years ago
|
Assignee: nobody → xeonchen
| Assignee | ||
Comment 8•7 years ago
|
||
From the gecko side, I can see the time is displayed correctly, so that probably something wrong within the js part.
(In reply to André Bargull [:anba] from comment #7)
> Maybe it's as simple as adding a call to |tzset()| (resp. |_tzset()|) to
> nsRFPService::UpdateRFPPref() after updating the TZ environment variable
> (and before calling |nsJSUtils::ResetTimeZone()|)?
No, this doesn't work, and it's always incorrect without switch RFP mode if I set |TZ=:/etc/localtime| when Firefox launched.
I guess (In reply to André Bargull [:anba] from comment #5)
> As mentioned in bug 1409973 comment 7 and bug 1409973 comment 45, ICU
> doesn't understand "TZ=:/etc/localtime"
> <https://ssl.icu-project.org/trac/ticket/13694>, which can lead to issues
> when toggling RFP on and off without restarting the browser.
I think this is the root cause.
Updated•7 years ago
|
Priority: P2 → P1
| Assignee | ||
Comment 9•7 years ago
|
||
Turning resistFingerprinting off then calling |new Date().toLocaleTimeString()|, the value in [1] shows the timezone is "Etc/GMT-1" where /etc/localtime actually a symlink to "Europe/Berlin". The DST part therefore been ignored.
[1] https://searchfox.org/mozilla-central/rev/ad36eff63e208b37bc9441b91b7cea7291d82890/js/src/builtin/intl/DateTimeFormat.cpp#659
Comment 10•7 years ago
|
||
The patches in bug 1346211 and bug 1478370 should fix this issue.
| Assignee | ||
Comment 11•7 years ago
|
||
(In reply to André Bargull [:anba] from comment #10)
> The patches in bug 1346211 and bug 1478370 should fix this issue.
Great! Let's see if it works.
| Assignee | ||
Updated•7 years ago
|
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Updated•7 years ago
|
status-firefox62:
--- → fix-optional
| Assignee | ||
Comment 12•7 years ago
|
||
I can confirm this bug is fixed.
Status: REOPENED → RESOLVED
Closed: 7 years ago → 7 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•