Open file with system application in a Progressive Web App

don picture don · Jun 6, 2018 · Viewed 11.9k times · Source

I'm trying to figure out if it is possible to open a file from a Progressive Web App with the default system application.

The idea is that a PWA would store for offline use some files (e.g. a .docx file), and that the user would be able to open them without (re)downloading them.

The ideal situation would be that the PWA is able to load into memory the file, make it accessible to the default system application for that file type (e.g. Word for .docx files), watch for changes (i.e. the user saves edits), and then store it back into the PWA storage. Even a read-only solution would be great.

Since there are serious security issues implied, and since from a Google search nothing came up, my best bet is that this is not (yet) supported. However, I'm hoping that there might be a way to do it of which I'm unaware and that does not require the user to download a copy of the file.

Answer

don picture don · Dec 21, 2018

Since this question has gained a lot of attention lately, for anyone interested on the subject there are very exiting news: the Writable Files API.

At this time the proposed new APIs are merely in the design phase, and there is a vivid discussion about the opportunity itself of introducing them. So it looks like we are still far from a production ready solution.

UPDATE 2019-04-12

There is now an explainer (also linked in the above mentioned post) with a lot of useful info on how the proposed APIs will/should work.