I find myself frequently needing to have Chrome do XSLT transformations on local XML files. This only works with the aforementioned switch. I am inclined to just add it to my Chrome default shortcut.
Does this switch rule out some functionality?
2 Answers
What are the drawbacks of '--allow-file-access-from-files'?
I can't see any drawbacks to this, apart from possible local security problems if you have infected local files.
You might also want to take a look at Allow Local File Access in Chrome (Windows) where someone has commented that --allow-file-access-from-files does not allow xslt transformation:
–allow-file-access-from-filesdoes not allow anymorexslttransformation from local files. How to get that to work in chrome?xlouk said this on June 12, 2014 at 4:32 am | Reply
I don’t believe this will work with any current Chrome startup options. I would suggest using node and http.server. You can easily create a local http server from a directory. I’ll create a post showing the process.
chrisbitting said this on June 12, 2014 at 8:36 am | Reply
This of course, may be true for older versions of chrome ... but not your version.
--allow-file-access-from-files
By default,
file://URIs cannot read otherfile://URIs. This is an override for developers who need the old behavior for testing.
Source List of Chromium Command Line Switches:
2Regarding drawbacks,
One alternative to adding it to your application shortcut is to set a bash alias to your .bash_profile or equivalent in your terminal launcher so that you can always easily/quickly launch Chrome with file access it when you need it. This rules out the potential security drawback of using it all the time/keeps it a conscious decision to use it.
Example:alias cdev='open -a "Google Chrome" --args --allow-file-access-from-files' >> .bash_profile.
This allows me to simply type cdev from terminal to launch chrome with the appropriate flag.