Search code examples
javascriptgoogle-chromegoogle-chrome-extensionhtml5-filesystem

Is the Chrome FileSystem API only available for Chrome Apps (from Chrome Web Store)?


I downloaded the Chrome App samples from https://github.com/GoogleChrome/chrome-app-samples and tried running the FileSystem sample.

The code works when installed from Chrome Web Store, but I'm interested to know whether the FileSystem API can be made to work for non-Chrome-app cases. A simple experiment trying loading index.html on localhost served by my local Apache webserver exhibits a failure because chrome.filesystem is undefined.

Is Chrome Filesystem intended only for Chrome Apps (I can see that clues might be in the name of the samples repo and the fact that it uses a manifest.json) or is there a way of making it work for general (non-Chrome-app) web applications?

Thanks


Solution

  • Is Chrome Filesystem intended only for Chrome Apps

    Yes.

    is there a way of making it work for general (non-Chrome-app) web applications?

    No. Normal web applications are subject to many security limitations (because you "install" them by visiting a webpage).


    A simple experiment trying loading index.html on localhost served by my local Apache webserver

    Loading resources over HTTP can be done using the XMLHttpRequest object. No escalated privileges on the client required.