navigator.webkitPersistentStorage.requestQuota是否适用于IndexedDB? [英] Does navigator.webkitPersistentStorage.requestQuota apply to IndexedDB?
问题描述
使用今天最新版的Android版Chrome浏览器,我是否可以请求使用navigator.webkitPersistentStorage.requestQuota
进行持久化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); }
);
或者,navigator.webkitPersistentStorage.requestQuota
仍然仅适用于FileSystem API
吗?
Or, does navigator.webkitPersistentStorage.requestQuota
still only apply to the FileSystem API
?
推荐答案
navigator.webkitPersistentStorage.requestQuota
仅适用于沙盒文件系统api.
navigator.webkitPersistentStorage.requestQuota
is only for the sandboxed filesystem api.
您想要适用于所有站点存储的新navigator.storage.persist()
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
这篇关于navigator.webkitPersistentStorage.requestQuota是否适用于IndexedDB?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!