首页 > 解决方案 > How to send Chromium debugger a command (set breakpoint)?

问题描述

I'm using an advanced text editor (but not a totally IDE) while developing web based applications, so I do rely on Chromium's debugger.

I want to provide an easier way to put a temporary breakpoints in the runtime via text editor's window.

All I need is to be able to send a breakpoint information in the runtime to the Chromium Debugger. Is there a way to achieve this?

标签: google-chrome-devtoolschromium

解决方案


您要么需要将文本编辑器连接到 Chrome 开发者工具,要么编写一些连接到 Chrome 开发者工具并发出适当setBreakpoint命令的小(ish)程序。

设置断点基本上只是将一些 JSON 发送到 Chrome 开发人员工具,但要使其正常工作,您需要首先向 Chrome 请求 Websocket 连接,连接到该 Websocket,然后发出您的命令。有多种方法可以自动化用于 Pyhon、NodeJS、C# 和 Perl(由我编写)的 Chrome 开发人员工具,所以如果你能告诉我们你喜欢哪种语言,我们可能会建议具体的库来与 Chrome 进行通信/铬给你。

也可以看看

https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-setBreakpoint


推荐阅读