Skip to content

Commit

Permalink
Merge pull request Modernizr#1831 from sheff146/firefox-disabled-cook…
Browse files Browse the repository at this point in the history
…ies-fix

Fix IndexedDB check in Firefox with disabled cookies
  • Loading branch information
patrickkettner committed Jan 13, 2016
2 parents 1a3296b + 715d60b commit 7152423
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion feature-detects/indexeddb.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ define(['Modernizr', 'prefixed'], function(Modernizr, prefixed) {
// - Firefox shipped moz_indexedDB before FF4b9, but since then has been mozIndexedDB
// For speed, we don't test the legacy (and beta-only) indexedDB

var indexeddb = prefixed('indexedDB', window);
var indexeddb;
try {
indexeddb = prefixed('indexedDB', window);
} catch (e) {
}

Modernizr.addTest('indexeddb', !!indexeddb);

if (!!indexeddb) {
Expand Down
7 changes: 6 additions & 1 deletion feature-detects/indexeddbblob.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,17 @@ define(['Modernizr', 'addTest', 'prefixed', 'test/indexeddb'], function(Moderniz

Modernizr.addAsyncTest(function() {
/* jshint -W053 */
var indexeddb = prefixed('indexedDB', window);
var indexeddb;
var dbname = 'detect-blob-support';
var supportsBlob = false;
var request;
var db;

try {
indexeddb = prefixed('indexedDB', window);
} catch (e) {
}

if (!(Modernizr.indexeddb && Modernizr.indexeddb.deleteDatabase)) {
return false;
}
Expand Down

0 comments on commit 7152423

Please sign in to comment.