problem description
when I am working on the chrome extension, I need to use the api, of fileSystem to add the fileSystem permission to permissions, but at run time, chrome.fileSystem is still undefined, which is the configuration of permissions
"permissions": [
"contextMenus",
"tabs",
"webRequest",
"webRequestBlocking",
"storage",
"system.display",
"fileSystem"
],
Why is this?
later I used the native fileSystem api, of html5 because I wanted to persist the data and could not be cleared by the operation of clearing the browser cache, so I wrote the following code in the background.js of the plug-in,
window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;
navigator.webkitPersistentStorage.requestQuota(bytes, function (grantedBytes) {
alert(":" + grantedBytes);
window.requestFileSystem(window.PERSISTENT, grantedBytes, initFs, errorHandler);
}, errorHandler);
as a result, the grantedBytes value in the callback function is 0.
does it mean that plug-ins can"t apply for presistent space?