Phu1237 / vscode-vs-browser

Built-in browser for Visual Studio Code
MIT License
37 stars 3 forks source link

Cross-Origin Frame Blocked when Loading Local HTML File #12

Open acarlstein opened 1 year ago

acarlstein commented 1 year ago

Summary

When trying to open a local HTML file, it doesn't load it because is being blocked (possible due CORS).

I wanted to have a split screen in VSCode where on one screen I see the code and the other screen I can use this plugin to see the changes. Instead of having a separate browser to do it.

Description

In the URL bar, add the path to a local HTML file, then check the console to see an error as such:

Blocked a frame with origin \"vscode-webview://0frhflbpusv2i73i43hco80u16hmrhaf5gt9959na9n2n9kb5c61\" from accessing a cross-origin frame.

I believe that CORS is blocking loading the file. I can open the file in other browsers (such as Firefox, Chrome, etc) but not on this.

Thank you for your time. Have a nice day.

Phu1237 commented 1 year ago

Please use another extension to launch your HTML as a page and then try to access it again by using this extension. As the way this extension work, it can't access domain like file:// or localhost with iframe blocked. Please try again and ask me anything if you need Thanks!