How to intercept "Open in Browser"?

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

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

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,

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.


Please sign in to leave a comment.