尝试使用时
chrome.fileSystem.chooseEntry({
type: 'openFile'
},chooseEntryCallback)`
在 Canary 28.0.1483.0 上,我在控制台中收到以下错误:
chrome.fileSystem is not available: You do not have permission to access this API. Ensure that the required permission or manifest property is included in your manifest.json.
我只需要读取访问权限, list 文件中的权限
选项如下所示:
"permissions": [
{
"fileSystem": []
},
"contextMenus",
"clipboardWrite",
"storage"
],
这适用于稳定版 26.0.1410.64,因此问题是是否存在一些需要更新的明显权限更改。
注意:Chrome 在 Windows 8 上运行,通过拖放打开文件时,打开文件不会出现错误。所以我猜测 chooseEntry
存在一些问题?
最佳答案
根据 @sowbug 的评论,我通过更改列表项的 fileSystem
权限解决了此问题:
"permissions": [
"fileSystem"
],
编辑:
要包含扩展写入
权限:
"permissions": [
"fileSystem",
"fileSystem.write"
],
关于google-chrome-app - 尝试使用 chrome.fileSystem ChooseEntry 时出现权限错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16114752/