question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adopt VS Code's 'asWebviewUri' API

See original GitHub issue

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:

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: https://github.com/microsoft/vscode/issues/97962

Let me know if you have any questions about this change

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
rchiodocommented, Jun 3, 2020

Yeah it’s not in any code the runs for a user. WebPanelServer can’t use cspSource because it doesn’t create a webview. But the server react code can (or should be removed).

0reactions
IanMatthewHuffcommented, Jun 3, 2020

Created microsoft/vscode-python#12140 for removing the old code. And validating this one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Adopt VS Code's 'asWebviewUri' API · Issue #305 - GitHub
Hi, I maintain VS Code's Webview API. Issue. Our telemetry suggests that your extension uses webviews and may be loading resources in these ......
Read more >
Webview API - Visual Studio Code
The webview API allows extensions to create fully customizable views within Visual Studio Code. For example, the built-in Markdown extension uses webviews to ......
Read more >
How to Build a Webview-Powered VS Code Extension with LWC
One way in which you can create VS Code extensions is using Webviews and the Webview API. You can think of a Webview...
Read more >
Xamarin.Forms WebView - Microsoft Learn
This article explains how to use the Xamarin.Forms WebView class to present local or network web content and documents to users.
Read more >
Do VSCode webviews support Web Workers? - Stack Overflow
Yes, you can. I don't know about seperate files, but you can use URL.createObjectUrl() to create a worker. Here is some code that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found