4

I am trying to open "remote debugging mode" in an already running chrome browser.

Here is the command I am executing:
chrome.exe --remote-debugging-port=9222 --user-data-dir="C:\Users\Ideal\AppData\Local\Google\Chrome\User Data"

But when I visit http://127.0.0.1:9222/json/version, nothing shows up.

However, if I close the browser and then run the same process, then http://127.0.0.1:9222/json/version works great.

So how can I open remote debugging mode in an already running Chrome browser?

Yaakov Bressler
  • 9,056
  • 2
  • 45
  • 69
  • Confused, can you clarify: the "already running chrome", did you start that with those options already? And you somehow run into a situation where to get the debug port to work, you end up having to kill it and start again the second time with those same options? Or you are trying to connect to the "already running chrome" that was started without those options? – Ivan Balepin Aug 03 '23 at 05:33
  • "Or you are trying to connect to the "already running chrome" that was started without those options?" That seems to be the case. – Joakim L. Christiansen Aug 03 '23 at 22:19

1 Answers1

1

Opening remote debugging mode in an already running Chrome browser is not directly supported by default, as the --remote-debugging-port flag is typically used to enable remote debugging during Chrome's startup. Once Chrome is running, changing this flag will not take effect.

You can try creating a new user profile on the fly and then use that profile to run Chrome with remote debugging enabled

xcopy "%LOCALAPPDATA%\Google\Chrome\User Data\Default" C:\TempProfile /E /I /H /C /K /O /X

"C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 --user-data-dir="C:\TempProfile"
user1874594
  • 2,277
  • 1
  • 25
  • 49