Raphael Rafatpanah
Raphael Rafatpanah

Reputation: 20007

Does navigator.webkitPersistentStorage.requestQuota apply to IndexedDB?

With today's latest version of Chrome for Android, can I request for persistent IndexedDB storage with navigator.webkitPersistentStorage.requestQuota?

var requestedBytes = 1024*1024*1024; 

navigator.webkitPersistentStorage.requestQuota (
    requestedBytes, function(grantedBytes) {  
        console.log('we were granted ', grantedBytes, 'bytes');

    }, function(e) { console.log('Error', e); }
);

Or, does navigator.webkitPersistentStorage.requestQuota still only apply to the FileSystem API?

Upvotes: 4

Views: 1922

Answers (1)

Daniel Herr
Daniel Herr

Reputation: 20508

navigator.webkitPersistentStorage.requestQuota is only for the sandboxed filesystem api.

You want the new navigator.storage.persist() api which applies to all site storage.

https://developers.google.com/web/updates/2016/06/persistent-storage

Upvotes: 3

Related Questions