1
我正在開發可用作備忘錄的Chrome擴展。Chrome擴展請求本地存儲配額超時錯誤
我搜索了互聯網,發現chrome.storage API可能對我有用。
但是,我總是在本地請求存儲時遇到「QuotaExceededError」。
這裏是我的javascript代碼:
window.onload = function() {
openLocalFileSystem(true);
}
function openLocalFileSystem(isReadMode) {
navigator.webkitPersistentStorage.requestQuota(1024 * 1024 * 10, function(grantBytes) {
window.webkitRequestFileSystem(window.PERSISTENT, grantBytes,
function(fs) {
console.log(grantBytes); // ALWAYS 0! WHY???
onFileSystemOpened(fs, isReadMode);
},
function(e) {
console.log("Couldn't request file system!");
});
});
}
有人可以幫助我在這裏?非常感謝!!!
我在我的json文件中請求了權限:「permissions」:[「syncFileSystem」,「unlimitedStorage」]。但仍然不起作用 – Mapleman 2015-04-02 18:17:48
我用存儲/ localStorage的unlimitedStorage很好,但它可能不適用於文件系統存儲? – 2015-04-04 16:22:22