[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #21308 [Applications/Tor Browser]: Fix modernizr breakage for TBB/ESR52
#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
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs