Just starting out using Visual Studio Code. I can have the browser in a preview, but I want to have the browser linked instead.
I’m using a Mac.
I tried dragging the new browser page next, but that does not work as they do not connect.
What else can I do?
I am guessing you mean you want your browser side by side next to the VSCode app. You can copy the absolute file path(I think it is just called ‘Copy Path’) of the html file and paste the path in the browser.
Or you can do as Andre Sampaio said and download Live Server extension on VSCode. The extension updates your codes in the browser every time you save in VSCode. After you download the extension through the extension tab in VSCode, you right-click(or control + click) and click ‘Open with Live Server’ in the HTML file.
Another solution for Live-Server
- Go to
https://nodejs.org/en/and download Node.js for your Mac
- Go to VSCode and press ‘Control + ~` and it will open up the terminal inside VSCode
- Type in
sudo npm install live-server -g
- Enter your password
- Type in
live-serverin Terminal and the file should pop up on the browser
In the future, all you have to do is type in live-server in VSCode’s Terminal. The node won’t disappear unless you kill the active Terminal instance by clicking on the trash can in VSCode’s Terminal