-
Notifications
You must be signed in to change notification settings - Fork 270
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 #305
Comments
Thanks for reaching out about this! I've been trying to manage when it would be best to increase the minimum version requirement of the extension, and I've been aware of the limitations of Up until recently there was minimal benefit to upgrade the minimum version requirement of the extension to support As you've indicated that |
Yes I guess it's still 2020 :) A very high percentage of users are either on the current VS Code release or one version back so you generally don't have to worry very much about breaking users by updating the minimum VS Code version. We on VS Code only support the current release |
Thank you, it’s really useful to know that a high percentage of Visual Studio Code users are using the current release or one version back! |
@mjbvz It looks like the latest vscode insiders build requires Is there any way for you to revert this change to extend support for the old I can ship a release of Git Graph if it is non-negotiable in the next few days. |
@mhutchie The current insiders build is using the old |
For mhutchie/vscode-git-graph#305 This was removed when switching over to the `vscode-webview-resource` since it handles the rewritting on the html input instead of for each request
Should be fixed by microsoft/vscode@8e45a2f Thanks for catching this |
Thanks @mjbvz for fixing this so quickly. I'll let the Git Graph users know that it should be fixed in one of the next insiders build. |
…rom 1.31.0 to 1.38.0. Migrated to use asWebviewUri & cspSource.
This will be available in v1.24.0. If you'd like to use it before the next release, you can download v1.24.0-beta.2, and install it following the instructions provided here. |
Hi @mjbvz, After making the changes you mentioned with The rendered CSP element:
blocks the following styles & scripts:
It appears that because the value of Another extension that also uses a Webview is having the same issue.
|
@mjbvz, I’d appreciate it if you were able to respond to my questions regarding I’m needing to have browser support (including Microsoft Codespaces) in Git Graph 1.24.0, and this is the last deliverable holding back the release. |
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: