If you want to use an existing instance of a browser to debug in VSCode - instead of always launching a new one - you have to:
- Change the shortcut that you use to start the browser, to add
--remote-debugging-port=9222
on the end of the command line, so that it always runs in “debug ready” mode. - Use a wildcard for the
url
in yourlaunch.js
config file.
To debug web apps in VSCode with Brave - add this to your launch.js
:
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Brave against localhost",
"type": "chrome",
"request": "launch",
"port": 9222,
"url": "http://localhost:3333/*",
"userDataDir": false,
"webRoot": "${workspaceFolder}",
"runtimeExecutable": "C:/Users/DuncanLock/AppData/Local/BraveSoftware/Brave-Browser/Application/brave.exe"
}
]
}