[tor-bugs] #17046 [Tor Browser]: Event.timeStamp reveals startup time

Tor Bug Tracker & Wiki blackhole at torproject.org
Fri Sep 11 22:49:07 UTC 2015


#17046: Event.timeStamp reveals startup time
-------------------------+-------------------------------------------------
     Reporter:           |      Owner:  tbb-team
  arthuredelstein        |     Status:  needs_review
         Type:  defect   |  Milestone:
     Priority:  normal   |    Version:
    Component:  Tor      |   Keywords:  tbb-linkability,
  Browser                |  TorBrowserTeam201509R
   Resolution:           |  Parent ID:
Actual Points:           |
       Points:           |
-------------------------+-------------------------------------------------
Changes (by arthuredelstein):

 * keywords:  tbb-linkability => tbb-linkability, TorBrowserTeam201509R
 * status:  new => needs_review


Comment:

 It turns out that if I set the `'dom.event.highrestimestamp.enabled'` pref
 to `true`, then Event.timeStamp then returns the time in milliseconds
 equivalent to performance.now() (aka, in the main thread,
 `navigationStart`, the time when navigation to the page started). This
 pref activates the fairly new DOMHighResTimeStamp API:
 https://w3c.github.io/hr-time/#dom-domhighrestimestamp

 This behavior for Event.timeStamp seems much better.

 To test this, enter
 {{{
 window.addEventListener("mousedown", e => console.log(e.timeStamp, new
 Event("asdf").timeStamp, performance.now()));
 }}}
 in the web console of any page, and then click once inside the page.

 Here are results with different values for the
 `'dom.event.highrestimestamp.enabled'` pref:

 ||        || Pref value ||Output||
 ||= Firefox =||  false  ||`9414030 1442009210662981 46220.675976000006`||
 ||= Firefox =||  true  ||`68844.30097800001 68844.634829
 68844.65331200001`||
 ||= Tor Browser =||  false  ||`9643300 1442009439993700 7676700`||
 ||= Tor Browser =||  true  ||`68844.30097800001 68844.634829
 68844.65331200001`||

 It seems Mozilla intends to set this pref to 'true' by default, but first
 they want to get the timestamp directly from native OS events:
 https://bugzilla.mozilla.org/show_bug.cgi?id=1026804

 But for TBB we don't want precision in our timestamps anyway, so looks OK
 if we set the pref to `true`. Here's a patch for review:

 https://github.com/arthuredelstein/tor-browser/commit/17046

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/17046#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list