2

I've written a simple extension to allow cross-origin resource requests when the html file is running locally from a specific directory (my dev/sandbox directory), but I'd also like to allow html files that are running from that directory to be able to make requests to local files. So:

Is it possible to emulate the --allow-file-access-from-files flag using a chrome extension?

  • 2
    Yes, I guess, your extension needs `` permissions and the user will have to manually enable "Allow access to file URLs" in the extension's details on chrome://extensions page. Then your extension will be able to perform requests to file:// URLs and provide the results to the local page - for example by spoofing the page's XHR/fetch API. – wOxxOm Jul 06 '18 at 11:38
  • @wOxxOm Thanks! Sorry for the late reply. I'm going to try this soon and report back. –  Jul 14 '18 at 00:55
  • @Joe How did it go? – Jun Sep 07 '18 at 17:55
  • @Jun I have been meaning to try wOxxOm's solution but haven't gotten around to it unfortunately - other projects have gotten in the way of the one that this question was for. I still do intend to give it a shot at some point. –  Sep 08 '18 at 17:00

0 Answers0