How to intercept "Open in Browser"?

Hello,
with Idea, I can open content (an XML file, for instance) in a browser with a simple click.
OpenInBrowser.png
However, I have XML files (DocBook) with an external entity definition inside:

<!DOCTYPE chapter [
        <!ENTITY % myent SYSTEM "../../../../../commonContent/resources/entities.ent">
        %myent;
        ]>


Firefox cannot load the external entity and therefore I cannot view the file in Firefox (I need Firefox).
As a workaround, I want to preprocess the file before it is shown in Firefox. Or in more detail, I want to add the concrete entity definitions right into the XML file.

Can anyone give me any pointers where I can intercept the "Open in Browser" action to do my preprocessing?

Best regards,
Michael

1 comment
Comment actions Permalink

There is no API in IntelliJ IDEA for this. "Open in Browser" works by serving content through an HTTP server embedded in IntelliJ IDEA, and that server does not have any hooks for modifying the content it sends to the browser.

0

Please sign in to leave a comment.