Expose (some) CDP commands
See original GitHub issueI’d love to play around with the Page.captureScreenshot
request for an experimental VS Code extension.
It would be awesome if the VS Code Debug Adapter would expose some request that would allow to call these CDB requests through debugSession.customRequest
.
Advantages
- This would allow for some cool (experimental) VS Code extensions. The captureScreenshot request could be used to show a screenshot of variables that point to an HTML element. I guess there are also some other cool methods exposed by chrome that could further push the debugging experience.
Risks
- User experience could be degraded if such extensions bring the debug adapter in an inconsistent state by calling some CDP requests they are not supposed to call.
I guess to mitigate 1), the exposed CDP requests could be allow-listed (e.g. only when using the non-insiders build to enable exploring ideas). Page.captureScreenshot
should be pretty risk free.
What do you think?
Issue Analytics
- State:
- Created 3 years ago
- Comments:21 (21 by maintainers)
Top Results From Across the Web
CDP Command Reference - Cisco
This chapter describes commands used to monitor the router and network using Cisco Discovery Protocol. (CDP). • cdp enable, page 2. • cdp...
Read more >Administrative commands | CDP Private Cloud
The subcommands of hdfs haadmin are extensively used for administering an HA cluster.
Read more >Learn how CDP neighbor works on Routers and Switches
My courses you can buy at Lowest Price.1. Cisco Nexus Training : Go from Beginner to ...
Read more >Understanding CDP (Cisco Discovery Protocol)
If for some reason it was previously disabled, and you want to re-enable it, you can use the cdp run command in global...
Read more >CDP ( Cisco Discovery Protocol) and LLDP (Link Layer ...
Some of the important facts about CDP Protocols are given below:- ... information about them, you can the “show cdp neighbors' command:.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I would prefer a design where you don’t actually proxy ‘everything’. For example, you may not care about
scriptParsed
events for your use case and only request/response pairs andoutput
events. CDP is chatty and latency is important, I don’t want to add extra work unnecessarily.~Sorry for the delay. I had a look today, but I was not able to debug the debug-adapter. I opened the debug-adapter in the latest vscode insider build, ran
npm run watch
and launched the “Extension” launch config. The entry point of the extension called. However, my breakpoints in the constructor of theDebugAdapter
are not hit.~~I also get this error in the Extension Development Host:~
~I guess its a trivial mistake, but I’m stuck.~
I didn’t figure out that I had to uninstall the bundled JavaScript Debugger Extension. I didn’t even know this is possible… My breakpoints are being hit now 😉
It works nicely:
I’ll try to prepare a PR soon that exposes this cdp method. I think a hover provider can be implemented that shows a screenshot of HTML elements when hovering on an HtmlElement while debugging the code.