使用今天最新版本的 Android Chrome,我可以使用以下命令请求持久性 IndexedDB 存储吗?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
?
navigator.webkitPersistentStorage.requestQuota
仅适用于沙盒文件系统 api。
你想要新的navigator.storage.persist()
适用于所有站点存储的 api。
https://developers.google.com/web/updates/2016/06/persistent-storage https://developers.google.com/web/updates/2016/06/persistent-storage
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)