且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

无法连接到目标:连接ECONNREFUSED 127.0.0.1:9222

更新时间:2022-11-16 23:34:14

我不确定您仍然需要它,但是我找到了解决方案,因为我自己也遇到了同样的问题.

I'm not sure you still need it, but I found the solution, since I was facing the same issue myself.

您必须在启用了远程调试的情况下启动Chrome,才能将扩展程序附加到它.

You must launch Chrome with remote debugging enabled in order for the extension to attach to it.

Windows

右键单击Chrome快捷方式,然后选择属性在目标"字段中,附加--remote-debugging-port = 9222或者在命令提示符下,执行/chrome.exe --remote-debugging-port = 9222

Right click the Chrome shortcut, and select properties In the "target" field, append --remote-debugging-port=9222 Or in a command prompt, execute /chrome.exe --remote-debugging-port=9222

OS X

在终端中,执行/Applications/Google \ Chrome.app/Contents/MacOS/Google \ Chrome --remote-debugging-port = 9222

In a terminal, execute /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222

Linux

在终端中,启动google-chrome --remote-debugging-port = 9222

In a terminal, launch google-chrome --remote-debugging-port=9222

我在vs代码chrome扩展的github上找到了以下信息: https://github.com/Microsoft/vscode-chrome-debug

I've found this info on the vs code chrome extension's github: https://github.com/Microsoft/vscode-chrome-debug

注意-如果您已经在运行Chrome实例.打开更新的Chrome窗口之前,请先关闭它们.参考:- https://github.com/Microsoft/vscode-chrome-debug/Issues/111

Note - If you have already running instances of Chrome. Close them first before opening the updated Chrome window. Ref:- https://github.com/Microsoft/vscode-chrome-debug/issues/111