Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preview not showing due to CORS issue in CEF (embedded browser) #117

Open
tomas-pecserke opened this issue Nov 25, 2024 · 0 comments
Open

Comments

@tomas-pecserke
Copy link

Describe the bug
The file editor preview does not show anything in IntelliJ IDEA 2023.2.1, and shows only an error message in PyCharm 2024.3.

To Reproduce

  1. Install latest version of either IntelliJ IDEA or PyCharm IDE.
  2. Install latest version of this plugin.
  3. Create a minimal test model (code in the snippet).
  4. Open preview or split file editor.

Code snippet

cube(size=[1,1,1], center=false);

Expected behavior
I would expect to see a model rendering in the editor preview window.

Screenshots
IDEA:
IDEA
PyCharm:
PyCharm

Desktop (please complete the following information):

  • OS: Windows 11
  • Jetbrains platform and version: IntelliJ IDEA 2023.2.1 Community, IntelliJ IDEA 2023.2.1 Ultimate, PyCharm 2024.3 Community, PyCharm 2024.3 Proffesional
  • OpenSCAD plugin version: Version 2.4.0

Additional context
I was able to open CEF browser dev tools and there is CORS error loading main.js file:

Access to script at 'file:///<HOME_DIR>/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/2023.2.1/b51a90b0b585e631c033896a64083d706ed6d71d/ideaIC-2023.2.1/bin/html/main.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome-extension, chrome, https, chrome-untrusted.

It seems recent version of CEF (embedded Chromium) enforces CORS rules for ES5 module loading even for file URIs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant