Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to attach the VSCode debugger to the Brave browser?

When I open my web application in the Chrome browser I can attach the VSCode debugger to it.

The debugger configuration is:

{     "name": "Attach to Chrome",     "type": "chrome",     "request": "attach",     "port": 9222,     "url": "http://localhost:4200/*",     "webRoot": "${workspaceFolder}", }, 

But when I open the web application in the Brave browser I cannot attach the VSCode debugger.

The web application is an Angular one opened at http://localhost:4200/users

I'm running:

Chrome Version 70.0.3538.102 (Build officiel) (64 bits) Brave Version 0.56.12 Chromium: 70.0.3538.77 (Build officiel) (64 bits) VSCode Version 1.23.0 

on a Lubuntu 16.04 box.

Is the Brave browser not yet ready for debugging ? Or is there some port restriction I should remove ? I have put the shiled down for this web application. But VSCode still does not attach to it.

like image 824
Stephane Avatar asked Nov 19 '18 17:11

Stephane


People also ask

How do you debug in Brave?

Debugging Content You can open the loaded content dev tools using Command+Alt+I on macOS or Control+Alt+I on Windows. If you'd like to see code run on each page load, you can edit app/extensions/brave/brave-default.

How do I enable remote debugging in Brave?

Remote debugging can now be enabled via brave://settings/privacy … This commit was signed with the committer's verified signature. Learn about vigilant mode. Remote debugging can now be enabled via brave://settings/privacy …

How do I use VS code debugger in Chrome?

To debug any project in either Chrome or Microsoft Edge, all you need to do is to start a session by pressing F5 or activating the debug icon in the menu bar and selecting “Run and debug”. Alternatively, you can also use the Visual Studio Code command palette and run the “Debug: Open Link” command.


2 Answers

For MacOS users

I was able to connect to create a configuration in launch.json so that the Brave browser launches on MacOS. I appended the "userData": true property because I was getting an error. I figured that out by looking at this page. https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome

{     "type": "chrome",     "request": "launch",     "name": "Brave",     "runtimeExecutable": "/Applications/Brave Browser.app/Contents/MacOS/Brave Browser",     "userDataDir": true,     "url": "http://localhost:8080",     "webRoot": "${workspaceFolder}" } 
like image 52
villaa19 Avatar answered Sep 20 '22 18:09

villaa19


A little late but.... get brave-dev following this

then add to your launch.json a "runtimeExecutable": "/usr/bin/brave" entry and change the path that suits you.

rest of the settings can be default

like image 34
Eduardo Portal Geroy Avatar answered Sep 19 '22 18:09

Eduardo Portal Geroy