How to open a browser within VSCode just like another editor tab

Viewed 13385

For a VSCode extension i want open browser within VSCode not externally, wherein i can load some URL (https://developers.redhat.com/)

I tried looking into various options to achieve it in VScode extension, what i came across is with help of webview i.e 'vscode.previewHtml' we can pass html content which would be rendered with in VSCode editor tab, but what i have is url to load. Can pass it to iframe but i can't open it in iframe

Another option is to open it in browser but it opens external browser.

what i need is to open a browser within IDE (VSCode), experience should be similar to what we get for 'vscode.previewHtml'

or as we see in IDEs like eclipse where browser window is opened right inside IDE.

As we can see below

enter image description here

Please give inputs, suggestions

4 Answers

It's possible now without extension. Open command palette (CTRL+P) and search for "Simple Browser: Show".

This is how it looks:

vscode browser tab

A deleted answer to this question included a link to a Github repo which has a very promising, but very much still in the works, browser tab inside VS code. I can't say whether or how well it works, and it has no compiled extension that I can see, but I thought this link should at least be noticed.

https://github.com/FabianLauer/chrome-vs-code

Microsoft has an extension in development, Live Preview. I use it to view html codecov reports inside of VSCODE and it at least works for that.

You just search for it in extensions and add it to VSCODE

Related