-
Notifications
You must be signed in to change notification settings - Fork 62
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
Adopt VS Code's 'asWebviewUri' API #183
Comments
Hi @mjbvz, thanks for reaching out. The The files are being loaded by 3rd-party JavaScript frameworks such as BabylonJS, CesiumJS, and ThreeJS, embedded in the Webview. When these frameworks load the file, they will be looking for relative paths from the glTF file's root folder, to find the binary and image files that belong to the 3D model. Because I'm still looking into this, but this appears to be a massively breaking change, at least for formats like glTF. |
|
Version |
Hi, I maintain VS Code's Webview API
Issue
Our telemetry suggests that your extension uses webviews and may be loading resources in these webviews using hardcoded
vscode-resource:
URIs. These URIs have some important limitations and don't work properly when VS Code is run in a browser. We are also making changes in the desktop version of VS Code that may cause these URIs to not work properly in future versions of VS Code.While we are making our best effort to continue support existing webview extensions that use
vscode-resource:
URIs on desktop versions of VS Code, we will not able to fully support all uses cases.Fix
To ensure that your extension continues to work in as many environments as possible—including on web and remotely—please:
Switch to use the
Webview.asWebviewUri
function for loading resources.Switch to use the
Webview.cspSource
property in content security policies.These APIs shipped around 2 years ago so they should be available in all modern versions of VS Code. You can find additional information about the issue here: microsoft/vscode#97962
Let me know if you have any questions about this change
The text was updated successfully, but these errors were encountered: