Chrome Extension HTML Filesystem Access

2019-01-25 00:02发布

问题:

I am looking to save a file to a local path.

I have the weblink for example (http://www.website.com/files/info.pdf) and a config setting storing the users desired path (defaulted to download directory, but they can change it.

Everything I am reading implies this functionality now exist but I cannot figure out how to do it.

Thanks

回答1:

Chrome doesn't allow you to write directly to the filesystem. It provides an API that gives you access to a sandboxed environment, but doesn't allow you to access anything outside of that.

Firefox allows filesystem read/write access through XPCOM components, but users must enable access through about:config (can't remember the key offhand, but I'll look and will edit if I find it again).