vscode-vs-browser icon indicating copy to clipboard operation
vscode-vs-browser copied to clipboard

Doesn't work in WSL Ubuntu

Open Se7enSquared opened this issue 2 years ago • 14 comments

Not sure if this is anything to do with your extension, but it would be nice if someone at least knows a workaround. I am using the Remote extension in VS Code and running my project through WSL2 Ubuntu. I have MS Edge installed on the Ubuntu system but when I open a new VS Browser instance, it's blank. Doesn't give an error or anything. Just a blank window

image

Se7enSquared avatar Jul 18 '22 20:07 Se7enSquared

First, do you use the proxy mode? It is turned off by default and you can't go to localhost web if you turn it on. Second, can you open the Inspect window by clicking the bug icon and taking a screenshot for me? The necessary information should be in there. Maybe your website is blocked by CORS. Please help me check it so I can fix it for you. Thanks!

Phu1237 avatar Jul 21 '22 01:07 Phu1237

@Phu1237 Thank you so much for helping me look into this.

do you use the proxy mode? It is turned off by default and you can't go to localhost web if you turn it on.

This is off and I also cannot visit google or any website

can you open the Inspect window by clicking the bug icon and taking a screenshot for me?

image

Se7enSquared avatar Jul 21 '22 14:07 Se7enSquared

@Se7enSquared Sorry for the missing step. Please capture log in the Console window because the error will show in there like a normal browser. Step: Open the Inspect window by clicking the bug icon > Console > Taking a screenshot for me Thanks!

Phu1237 avatar Jul 21 '22 14:07 Phu1237

Here's one of the errors image

Here's another image

Se7enSquared avatar Jul 21 '22 18:07 Se7enSquared

Same with google image

Se7enSquared avatar Jul 21 '22 18:07 Se7enSquared

Thanks! Can you give me the development environment like language, framework, etc?. So that I can make a project on my PC to test and fix it. Because the error shows me that the 127.0.0.1 is access successful but the WebSocket (maybe auto-reload) isn't. Thanks!

Phu1237 avatar Jul 22 '22 01:07 Phu1237

I am using Python and Django on WSL Ubuntu Windows 11. I am using the Remote-WSL extension

Realized localhost server is not active in the photos. I have included a new screenshot witht the localhost activated. image

Se7enSquared avatar Jul 22 '22 02:07 Se7enSquared

Thanks, I will try to fix it on my PC. Maybe the problem is your localhost block iframe options so that the extension can't be accessed. image

Phu1237 avatar Jul 22 '22 03:07 Phu1237

@Phu1237 I really appreciate your help :) I have to admit I have no idea what my localhost block iframe options are. I should actually try to see if this happens in Windows without using the Remote WSL extension because my first thought was that it's because of using linux in windows

Se7enSquared avatar Jul 24 '22 17:07 Se7enSquared

@Phu1237 Well my assumption was wrong! I cannot use the browser in Windows either.

This time, when not running VS Code through remote Ubuntu, it says

chromewebdata/:1 Refused to display 'https://www.google.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

In my very short bit of research I came across this - I'm sure you found it too but just in case, here it is https://stackoverflow.com/questions/6666423/overcoming-display-forbidden-by-x-frame-options#answer-7469997

Se7enSquared avatar Jul 24 '22 17:07 Se7enSquared

@Phu1237 OK so I found out that there is also a "Simple browser" extension and I get the same result! So I guess this is not the fault of your extension. I wish I could figure it out.

Se7enSquared avatar Jul 24 '22 17:07 Se7enSquared

One more update: VS Browser (and the "simple browser") both work when browsing https://xkcd.com/!

Se7enSquared avatar Jul 24 '22 17:07 Se7enSquared

@Se7enSquared I know about the error and I'm working on it (local proxy server). But it is not working correctly yet because my main language isn't nodejs so it will take some time to take effect. You can try the local proxy server, but it may not work as expected. Thank you for using my extension!

Phu1237 avatar Jul 28 '22 01:07 Phu1237

@Se7enSquared I know about the error and I'm working on it (local proxy server). But it is not working correctly yet because my main language isn't nodejs so it will take some time to take effect. You can try the local proxy server, but it may not work as expected. Thank you for using my extension!

Thank you.

Se7enSquared avatar Jul 28 '22 13:07 Se7enSquared