This setup hooks up Visual Studio Code (VSCode) with Brave Browser and Yarn for a seamless, automated debugging experience.
- Brave Browser Automation: Launches with remote debugging (
port 9222) with last session - Smart Server Handling: Starts
yarn scriptonly if the server’s not up onport 8000. - Debugger Bliss: Attaches VSCode to Brave.
- Terminal Zen: Auto-closes after launching Brave
- VSCode installed
- Brave Browser installed
- Yarn installed
Create the Browser Launcher
- In VSCode, go to
File > New Fileand name itrun-browser.shin your project root. - See
run-browser.shin this repo for the code.
Set Up VSCode Tasks
- Open the Command Palette (
Cmd + Shift + P). - Type "Configure Tasks" and select
Tasks: Configure Tasks. - Choose
Create tasks.json file from template > Others. - Replace the default with a config to run the browser script and manage
yarn script—check.vscode/tasks.jsonin this repo. - Save the file
Configure the Debugger
- Open the Debug view (
Cmd + Shift + D). - Click the gear icon and select
Chrome. - Replace the default with a config to attach to Brave on
port 9222—see.vscode/launch.jsonin this repo. - Save the file
Kick It Off
- Open your project in VSCode.
- Hit
F5—watch the magic:
- Brave fires up (or tabs in) on
port 9222. - Server spins up (or chills) on
port 8000.
Shift+F5: Kills the debug session.Ctrl+C: Stopsyarn scriptif it’s running.- Close Brave when you’re done —your call.
- Brave Ghosting You? Test
bash /path/to/run-browser.sh. Tweak the path or bump the sleep time. - Terminal Lingering? Check
close: trueintasks.json. - Debugger doesn't attach? Check
/path/to/run-browser.shis executable
chmod +x /path/to/your-app/run-browser.sh
Crafted with care! Thanks 🤘