Detecting Available Storage with IndexedDB Detecting Available Storage with IndexedDB javascript javascript

Detecting Available Storage with IndexedDB


The only API that is currently available and only for chrome is navigator.webkitTemporaryStorage.queryUsageAndQuota().

Firefox had plans to implement this API too.

There are also two experimental APIs navigator.storageQuota.queryInfo(type) and navigator.storage.estimate() available if you run chrome with --enable-experimental-web-platform-features. More details here: https://groups.google.com/a/chromium.org/forum/#!searchin/blink-dev/quota-api/blink-dev/P6eY26vB91c/Ri4ohXOPBQAJ

I think the Storage quota estimate() API is the most interesting one. It is still a draft but chrome and mozilla are currently implementing this API.

Unfortunately there is currently no public info available when and if Edge and Safari will implement this API.

Edge currently has a very different model for quota - rather than a whole-origin limit, each storage type (indexed db, local storage, etc) has its own limit.

Update: This feature was added to Chrome 52 (experimental flag) and Firefox 51 (nightly)navigator.storage.estimate().then((data)=>console.log(data)) // Object { quota: 2147483648, usage: 0 }