We used to have built-in browser in IDEA but had to abandon it - it turned out that external browser was the better choice since a) external browser is closer to the one needed for your target (e.g. targeting Chrome, Mobile Safari / Opera, etc) b) embedded browser does not live well with Swing application (e.g. focus quirks).
Is this still the case? I have a html page in my project which renders an viewer/editor for certain file types. In my intelliJ plugin I would like to use this page inside an intelliJ tab to show/edit files of these types inside my project. What would be the best approach?
It does not work due to access restrictions to the local file system. My viewer works if I change the url parameter to http://localhost:63342/my-intellij-plugin/my-intellij-plugin.main/html/viewer.html?url=http://localhost:63343/untitled/test.xml?_ijt=cb42s61vredg568buriphjcrfl How can I generate such a secured file url exposing my project file under localhost?
The approach is not flexible or robust.
Currently http://localhost:63342/camunda-intellij-plugin/camunda-intellij-plugin.main/html/viewer.html is hardcoded. How can I assemble the viewer url dynamically? Apart from the project name, how is this url going to change on different installations? Will this approach work in a full; installed plugin? Is there any way to control port, web application context root?
It would be very helpful to see source of a plugin that does the same as using the "Open in Browser" function manually. If you are aware of any, please point me to it.
Often I may have multiple projects going at the same time and having the browser for "this" project in "this" Intellij window and "that" in "that" would be very helpful and convenient.
We used to have built-in browser in IDEA but had to abandon it - it turned out that external browser was the better choice since
a) external browser is closer to the one needed for your target (e.g. targeting Chrome, Mobile Safari / Opera, etc)
b) embedded browser does not live well with Swing application (e.g. focus quirks).
But probably we'll consider re-evaluating this feature.. Please feel free to vote for https://youtrack.jetbrains.com/issue/WEB-10499 to be notified on any progress with it
Is this still the case? I have a html page in my project which renders an viewer/editor for certain file types. In my intelliJ plugin I would like to use this page inside an intelliJ tab to show/edit files of these types inside my project. What would be the best approach?
yes, still the case, nothing has changed
Thank you. So accepting that the page will be opened in an external browser, I tried using
which leads to:
http://localhost:63342/my-intellij-plugin/my-intellij-plugin.main/html/viewer.html?url=file://C:/Users/my%20name/IdeaProjects/untitled/src/test.xml
It does not work due to access restrictions to the local file system. My viewer works if I change the url parameter to http://localhost:63342/my-intellij-plugin/my-intellij-plugin.main/html/viewer.html?url=http://localhost:63343/untitled/test.xml?_ijt=cb42s61vredg568buriphjcrfl
How can I generate such a secured file url exposing my project file under localhost?
The approach is not flexible or robust.
Currently http://localhost:63342/camunda-intellij-plugin/camunda-intellij-plugin.main/html/viewer.html is hardcoded.
How can I assemble the viewer url dynamically?
Apart from the project name, how is this url going to change on different installations?
Will this approach work in a full; installed plugin? Is there any way to control port, web application context root?
It would be very helpful to see source of a plugin that does the same as using the "Open in Browser" function manually. If you are aware of any, please point me to it.
Ndcain, there now is a plugin called GIdeaBrowser which opens websites inside of IntelliJ IDEA. Unfortunately it only supports YouTube URLs. :-(
WebStorm 2021.1 will come with the built-in HTML preview; you can try in in EAP builds. See https://blog.jetbrains.com/webstorm/2021/01/webstorm-2021-1-eap-1/
This feature would be great for reading documentation or following a tutorial.
Particularly being able to have https://www.packtpub.com/ books/tutorials in one window within the IDE would be super.
Upvote!
Often I may have multiple projects going at the same time and having the browser for "this" project in "this" Intellij window and "that" in "that" would be very helpful and convenient.