Show a browser in a tab

Is it possible to show a browser in a webstorm tab? Is there plugin for this? I would like to preview without having to switch to chrome.

4 comments
Comment actions Permalink

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

0
Comment actions Permalink

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?

0
Comment actions Permalink

yes, still the case, nothing has changed

0
Comment actions Permalink

Thank you. So accepting that the page will be opened in an external browser, I tried using

VirtualFile file = (VirtualFile) e.getData(PlatformDataKeys.VIRTUAL_FILE);
VirtualFile folder = file.getParent();
BrowserUtil.browse(config.getTarget() + file.getUrl());

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.

 

 

0

Please sign in to leave a comment.