Page 1 of 1

make the browser open the XML file through the "http" rather than "file" protocol

Posted: Wed Feb 24, 2021 4:14 am
by Wolfhart
Hello,

Is there a way to specify the "Default Internet browser" in Oxygen in such a way that the browser will not open the file through the "file" protocol (i.e., "file:///path_to_file/file_name.xml"), but request it from a HTTP server running on the machine (e.g., "http://0.0.0.0:1111/file_name.xml")?

I am asking because Firefox refuses, supposedly for security reasons, to execute the XSL stylesheet associated with my XML files if they are served through the "file" (rather than the "http") protocol. Until recently, I used Chrome because it does execute the stylesheet through the "file" protocol, but now I would like to switch to Firefox because I have run into the so-called "white flash" bug in Chrome. So, in order to be able to browse my XML files with Firefox, I set up the HTTP server. But how can I call the HTTP server from Oxygen when using the "View in browser" action?

I am using Oxygen 22 on Ubuntu.

Thank you in advance for your help!
Wolfhart

Re: make the browser open the XML file through the "http" rather than "file" protocol

Posted: Wed Feb 24, 2021 8:12 am
by Radu
Hi Wolfhart,

The "View in browser" action is not configurable but maybe you can define an external tool:

https://www.oxygenxml.com/doc/versions/ ... tools.html

and launch it from the toolbar. External tools can run a command line and you can also use Oxygen editor variables like ${currentFileURL} which gets expanded to the current file URL.

Regards,
Radu

Re: make the browser open the XML file through the "http" rather than "file" protocol

Posted: Thu Feb 25, 2021 12:12 am
by Wolfhart
Dear Radu,

Thank you for the prompt reply! The idea with the external tool works beautifully. In my case, the command to use is

/usr/bin/firefox http://0.0.0.0:1111/${cfne}

Best regards,
Wolfhart