I have an extension that uses chrome.webRequest, chrome.browserAction etc., but my extension also need to access the file system(unsandboxed), I found that chrome.fileSystem can do this, but it's only available in Chrome apps. Since I have to choose either extension or app, so this means that I can't use chrome.webRequest and chrome.fileSystem at the same time?

I wonder why Chrome extension doesn't allow the fileSystem API, I think it will be very useful.

有帮助吗?

解决方案

Short answer: security reasons.

Extensions are considered much more risky than apps. Extensions can do a lot of things that apps can't, like hook into web request or inject script into pages, for example. Apps are kind of sealed via CSP and their run time model is much more isolated.

For this reason APIs which are considered risky - and fileSystem is probably the most risky API we have - are by default not made available in extensions.

Having said that there is ongoing discussion about how we can make more APIs available to extensions.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top