Chrome 34确认消息PERSISTENT

时间:2014-04-10 19:16:51

标签: javascript google-chrome filesystems persistent

我的网站使用PERSISTENT存储。 http://spinlock.idletime.tk/web/ffmpeg_pnacl/

Chrome 33只确认了一次PERSISTENT Storage。 但Chrome 34确认每一次!

Chrome 34 Bug?或者我的JavaScript错了?

(function openFS() {
navigator.webkitPersistentStorage.requestQuota(1024*1024*100000, function(bytes) {
    window.webkitRequestFileSystem(window.PERSISTENT, bytes, function(fs) {
FS = fs;}, onError);   
});
})();

为什么???

谢谢。

1 个答案:

答案 0 :(得分:0)

我的回答

(function openFS() {
    navigator.webkitPersistentStorage.queryUsageAndQuota(function(used, remaining) {
    if(used+remaining < 1)
        navigator.webkitPersistentStorage.requestQuota(1024*1024*100000, function(bytes) {
        webkitRequestFileSystem(window.PERSISTENT,bytes, function(fs) {
            FS = fs;}, onError);});
    else 
            webkitRequestFileSystem(window.PERSISTENT,1024*1024*100000, function(fs) {
            FS = fs;}, onError);
    }, onError );
})();