Quick Open in Default Browser
Open local files from VS Code in your system default browser.
Features
- Command:
Open in Default Browser: Open in Default Browser
- Command id:
openInDefaultBrowser.open
- Explorer context menu support, including multi-select
- Editor context menu and editor title menu support
- Keybinding:
Ctrl+Alt+B on Windows/Linux, Cmd+Alt+B on macOS
- Falls back to the active editor when no Explorer resource is supplied
The extension intentionally opens only file: scheme URIs. Remote, untitled, and virtual documents are rejected with a concise error.
Configuration
| Setting |
Default |
Description |
openInDefaultBrowser.showNotification |
true |
Show a confirmation notification after opening files in the default browser. |
Development
npm install
npm run compile
Press F5 in VS Code to launch an Extension Development Host.
Testing
Run the same checks used by CI:
npm run test:ci
This lints, builds, typechecks, packages the VSIX, and verifies that the package includes the runtime open dependency without shipping source files. GitHub Actions runs this on Ubuntu, Windows, and macOS.
The CI test also starts a VS Code Extension Host and mimics the user entry points:
- Explorer right-click command for one file
- Explorer multi-select context command
Ctrl+Alt+B / Cmd+Alt+B command path through the active editor fallback
- Package contribution checks for Explorer, editor, title, and keyboard entries
The browser opener is replaced by a test double in CI, so the test verifies the OS opener call without launching a real browser.
Packaging
npm run package