Closed
Description
Recently several people have asked about wanting to debug the contents webviews in VS Code.
I think is possible if the renderer is launched in debug mode; when debugging VS Code OSS I actually see CDP events for webviews coming down the pipe, e.g
If js-debug was able to attach to the renderer as well, then we should be able to attach to those webviews and debug them natively. There are two things that need to happen for this:
- Currently the way extension host debugging works is that we launch VS Code via a custom
launchVSCode
DAP request, and then we get a subsequent attach request with aport
set to the port of the extension host process. We could have a way to request the renderer to be launched in debug mode in thelaunchVSCode
request, and have arendererPort
or something similar in the attach request. - We want to filter so that we don't attach to any extraneous webviews that might be show in the editor. Right now the CDP events I see for the webview are not very useful. The frame is untitled, doesn't provide URLs over the protocol. Eventually we see an "info changed" where it looks like HTML gets set in the document, but it's not something we can filter on easily. It would be helpful if we could fix the URLs, or perhaps title the webview so that we can determine where it's coming from. Here's a log of the CDP events I see today for the notebook renderer webview. cc @mjbvz
/cc @rebornix @eamodio @RMacfarlane as people who have asked for this :)