navigator.webkitPersistentStorage.requestQuota是否适用于IndexedDB? [英] Does navigator.webkitPersistentStorage.requestQuota apply to IndexedDB?

查看:301
本文介绍了navigator.webkitPersistentStorage.requestQuota是否适用于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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆