[tbb-bugs] #21308 [Applications/Tor Browser]: Fix modernizr breakage for TBB/ESR52

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Feb 6 19:00:22 UTC 2017


#21308: Fix modernizr breakage for TBB/ESR52
---------------------------------------------+-----------------------------
 Reporter:  arthuredelstein                  |          Owner:  tbb-team
     Type:  defect                           |         Status:
                                             |  needs_review
 Priority:  Medium                           |      Milestone:
Component:  Applications/Tor Browser         |        Version:
 Severity:  Normal                           |     Resolution:
 Keywords:  ff52-esr, TorBrowserTeam201702R  |  Actual Points:
Parent ID:  #20680                           |         Points:
 Reviewer:                                   |        Sponsor:  Sponsor4
---------------------------------------------+-----------------------------
Changes (by arthuredelstein):

 * keywords:  ff52-esr, TorBrowserTeam201702 => ff52-esr,
     TorBrowserTeam201702R
 * status:  new => needs_review


Comment:

 Here's a patch for review:
 https://github.com/arthuredelstein/tor-browser/tree/21308

 To explain this patch a little:

 In private browsing mode, calling
 {{{
 var req = window.indexedDB.open("anydbname")
 }}}
 returns without throwing an error, but results in
 {{{
 req.name = "InvalidStateError".
 }}}
 Whereas dom.indexeddb.enabled = false, `var req =
 window.indexedDB.open("anydbname")` throws an `InvalidStateError` instead.

 The Modernizr script fails to handle the latter case. So this patch
 changes the behavior of the code when dom.indexedb.enabled = false so that
 no error is thrown, but instead `window.indexedDB = null`. This is
 correctly handled by Modernizr, and also matches the convention where the
 use of a JS API is preceding by checking for its presence, e.g.:
 {{{
 if (window.indexedDB) {
   var req = indexedDB.open(...)
   // More indexedDB usage
 }
 }}}

 I also tested this with Twitter and it appears to get it working properly
 again.

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


More information about the tbb-bugs mailing list