3

I came across the same problem, which is described in that question. The most upvoted solution worked fine for me and I also applied the same patch to my shortcut as indicated by this answer. Works awesome, too.

This allows me to open the Chrome Browser first and then open my xml file inside that browser instance with Drag&Drop. The xml stylesheet is applied as desired.

However, if I want to open my xml file directly by double-clicking on it, I want that a new Chrome Browser Instance is started (Chrome is my default browser), which displays the xml as desired. This does not happen, because the option --allow-file-access-from-files is not applied. It is only applied, if I start Chrome via my desktop shortcut.

How can I make the --allow-file-access-from-files option to be applied by default?

tangoal
  • 724
  • 1
  • 9
  • 28

1 Answers1

1

It sounds like you are on windows. You can write a one-line batch script chrome-file-access.bat that runs

c:\path\to\chrome.exe --allow-file-access-from-files %1

and then associate the .xml file type with the batch file.

Instructions for associating file types on windows in case you need it: https://www.digitaltrends.com/computing/how-to-set-default-programs-and-file-types-in-windows-10/

You can use a similar approach on other OS's as well.

Dovev Hefetz
  • 1,346
  • 14
  • 21
  • It does not work exactly how you indicated. The filename of the xml file is passed to the batch and you need it to pass it to chrome as well like this: `c:\path\to\chrome.exe --allow-file-access-from-files %1` – tangoal Apr 13 '18 at 12:04