I have a Chrome app that can record streaming contents from various websites. It works by downloading fragments (typically HLS or HDS) and saving and appending the file to the local filesystem.
The app heavily relies on the excellent chrome.fileSystem API to get a handle to a directory chosen by the user in which it can add and modify files.
(This use case is similar to adamzr’s podcast app)
Some thoughts of the implementation:
In chrome.fileSystem only file or directory operations initiated by the user are allowed. Thus, it is not possible for a Chrome app to suddenly write to a certain directory without asking for permission. It can’t even suggest a directory (except the previously chosen).
As I see it, there is really no reason why a native file API should be much different than chrome.fileSystem. Everyone can install a Chrome app in three seconds and thus grant access to their filesystem with all the advantages and risks it can introduce. And as others have pointed out, such a permission is really not more dangerous than downloading some native app (or executable) which can in fact potentially do much more harm.
What is important is that the file access is not given ad libitum to the user’s system and that the user is properly warned when installing, and - to a lesser degree - when using the web app. And as such, it is important that the user truly understands that they are in fact installing an app and not just using a website.
Now when Google finally has come up with a EOL of Chrome apps I really hope this writable file API will be implemented fairly soon.