Epoc
Epoc

Reputation: 7486

Check the real availability of IndexedDB in Firefox

I have to check the IndexedDB availability for the Firefox browser only. Currently I do the trick with this :

var IDB_SUPPORTED = 'indexedDB' in window;

Simple. But if I disable IndexedDB in about:config (with the dom.indexedDB.enabled parameter), IDB_SUPPORTED is still true.

How can I check the real availability of IndexedDB in Firefox without any third-party library like Modernizr?

Upvotes: 2

Views: 501

Answers (1)

user2010925
user2010925

Reputation:

This did it for me:

try { window.indexedDB } catch (err) { IDB_SUPPORTED = false; }

Upvotes: 2

Related Questions