A powerful system that enables GitHub Copilot to control your browser automatically, similar to Google's Antigravity browser agent. This creates a bidirectional communication channel between VS Code, GitHub Copilot, and your browser for automated testing, debugging, and web automation.
- Bidirectional Communication: Commands flow from Copilot β Browser, results flow back Browser β Copilot
- Browser Automation: Click, type, navigate, scroll, and interact with web pages
- Real-time Monitoring: Console logs, network requests, DOM changes, performance metrics
- Data Extraction: Screenshots, DOM structure, storage data, cookies
- JavaScript Execution: Run custom code directly in the browser context
- Privacy-First: All communication happens locally (localhost), no cloud dependencies
- GitHub Copilot Integration: Copilot can naturally interact with your browser through conversation
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β VS Code ββββββββββΊβ Relay Server ββββββββββΊβ Browser Extensionβ
β Extension β WebSocketβ (localhost:8080)β WebSocketβ (Chrome) β
β β β β β β
β GitHub Copilot β β Message Broker β β Command Executorβ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
- Relay Server (Node.js): WebSocket message broker that routes commands and responses
- Browser Extension (Chrome/Edge): Executes commands in web pages and captures browser data
- VS Code Extension: Sends commands and integrates with GitHub Copilot
- Node.js v18+ installed
- VS Code installed
- Chrome or Edge browser
Option A: Chrome Web Store (Recommended)
- Install from the Chrome Web Store.
Option B: Manual Install (GitHub)
- Download Copilot.Browser.zip.
- Extract the file to a folder.
- Open Chrome/Edge and navigate to
chrome://extensions/. - Enable "Developer mode" (top-right toggle).
- Click "Load unpacked" and select the extracted folder.
Option A: VS Code Marketplace (Recommended)
- Install from the VS Code Marketplace.
Option B: Manual Install (VSIX)
- Download copilot-browser-vscode.vsix.
- In VS Code, press
Ctrl+Shift+P(Windows) orCmd+Shift+P(Mac) β "Extensions: Install from VSIX..." - Select the
.vsixfile.
That's it! NO separate server installation is required.
-
Zip the Extension: Use the build script to generate a production zip:
node scripts/package-all.js. (This createsdist/Copilot.Browser.zipfor you) -
Upload:
- Go to Chrome Web Store Developer Dashboard
- Click "New Item"
- Upload
dist/Copilot.Browser.zip - Fill in store listing details and publish.
I have provided a unified build script to package everything:
-
Run Build Script:
node scripts/package-all.js
This generates version-independent files in the
dist/folder:copilot-browser-vscode.vsixCopilot.Browser.zip
-
Publish:
- Upload
copilot-browser-vscode.vsixto the VS Code Marketplace. - Upload files to GitHub Releases.
- Upload
Or manually:
- Open VS Code
- Press
F5to open Extension Development Host - Or press
Cmd+Shift+Pβ "Install from VSIX" (after packaging)
-
Launch Browser: In VS Code, run command "Browser Agent: Launch Isolated Browser".
-
Wait: Chrome will launch automatically.
-
Verify: VS Code status bar should show "Browser: Connected".
-
Open browser with the extension installed
-
Check extension popup - should show "Connected" with a green indicator
-
Open VS Code - status bar should show "Browser: Connected"
-
Navigate to a website in your browser
-
In VS Code, press
Cmd+Shift+Pand type:- "Browser Agent: Get Console Logs"
- "Browser Agent: Click Element"
- "Browser Agent: Take Screenshot"
Once everything is connected, you can ask Copilot to control your browser naturally:
Example Copilot Conversations:
You: "Check the console logs on the current page"
Copilot: [executes browserAgent.getConsole command and shows logs]
You: "Click the submit button"
Copilot: [asks for selector and executes click command]
You: "Navigate to google.com and search for 'VS Code'"
Copilot: [executes navigate and type commands]
You: "Take a screenshot of the current page"
Copilot: [captures and displays screenshot]
You: "What's the page load performance?"
Copilot: [retrieves and displays performance metrics]
browserAgent.navigate- Navigate to URLbrowserAgent.click- Click element by CSS selectorbrowserAgent.type- Type text into input fieldbrowserAgent.scroll- Scroll to element or positionbrowserAgent.hover- Hover over elementbrowserAgent.submit- Submit form
browserAgent.getConsole- Get browser console logsbrowserAgent.getDOM- Get DOM structure (full page or element)browserAgent.screenshot- Capture screenshotbrowserAgent.getPerformance- Get performance metricsbrowserAgent.getCookies- Get browser cookiesbrowserAgent.getStorage- Get localStorage/sessionStorage
browserAgent.executeJS- Execute custom JavaScript code
browserAgent.connect- Connect to relay serverbrowserAgent.disconnect- Disconnect from relay server
{
"browserAgent.relayServerUrl": "ws://localhost:8080",
"browserAgent.autoConnect": true,
"browserAgent.commandTimeout": 10000
}{
"port": 8080,
"host": "localhost",
"maxConnections": 10,
"heartbeatInterval": 30000,
"messageTimeout": 10000,
"logLevel": "info"
}All messages follow this JSON structure:
{
"id": "unique-message-id",
"type": "command | response | event",
"from": "vscode | browser",
"timestamp": 1234567890,
"command": "command-name",
"params": {},
"data": {},
"success": true,
"error": null
}browser-copilot-integration/
βββ relay-server/ # WebSocket relay server
β βββ index.js # Main server code
β βββ config.json # Server configuration
β βββ package.json
βββ browser-extension/ # Chrome extension
β βββ manifest.json # Extension manifest
β βββ background.js # Service worker
β βββ content.js # Content script
β βββ popup/ # Popup UI
βββ vscode-extension/ # VS Code extension
βββ extension.js # Main extension code
βββ package.json
Terminal 1 - Relay Server:
cd relay-server
npm startTerminal 2 - VS Code Extension:
cd vscode-extension
npm install
# Then press F5 in VS CodeBrowser:
Load unpacked extension from browser-extension folder
- Start relay server
- Load browser extension
- Open a test webpage (e.g., https://example.com)
- Test commands from VS Code:
// In VS Code, open command palette:
"Browser Agent: Navigate to URL" β https://example.com
"Browser Agent: Get Console Logs" β Shows console output
"Browser Agent: Click Element" β Enter selector: h1
"Browser Agent: Get DOM" β Shows HTML structure
"Browser Agent: Take Screenshot" β Displays imagenpm testAsk Copilot to test your web application:
- Fill out forms
- Navigate through user flows
- Verify page content
- Check for errors
Debug web applications with Copilot's help:
- Inspect console errors
- Check network requests
- Analyze performance issues
- Examine DOM structure
Extract data from websites:
- Get page content
- Extract specific elements
- Capture screenshots
- Monitor changes
Monitor web performance:
- Load times
- Resource usage
- Layout shifts
- Memory consumption
- Local-only communication: All traffic stays on localhost
- No external servers: No data sent to cloud services
- User consent: Extension requires explicit permissions
- Sandboxed execution: JavaScript runs in isolated context
- Rate limiting: Prevents command spam
- Timeout protection: Commands automatically timeout
- Check if port 8080 is already in use:
lsof -i :8080 - Change port in
relay-server/config.json
- Check if relay server is running
- Open browser console (F12) and check for errors
- Click extension icon and verify connection status
- Check Output panel β "Browser Agent" for logs
- Verify relay server URL in settings
- Try reconnecting: "Browser Agent: Connect"
- Increase timeout in settings
- Check if browser is responding (open DevTools)
- Verify network connection to relay server
- Phase 1: Foundation (Relay Server, Browser Extension, VS Code Extension)
- Phase 2: Core Commands (Navigation, Click, Type, Data Retrieval)
- Phase 3: Advanced Features (Event Monitoring, Advanced APIs)
- Phase 4: Copilot Chat Participant (@browser)
- Phase 5: Multi-browser Support (Firefox, Safari)
- Phase 6: Visual Testing (Screenshot comparison)
- Phase 7: AI-powered Element Detection
- Phase 8: Test Automation Framework Integration
Contributions are welcome! Please read our contributing guidelines.
MIT License - See LICENSE file for details
Inspired by:
- Google's Antigravity browser agent
- Playwright and Puppeteer
- Browser automation tools
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Made with β€οΈ for the developer community
Connect GitHub Copilot to your browser and unlock new possibilities! π