Claude Code Bridge Extension
The browser half of the bridge
Manifest V3 · Chrome & Edge · WebSocket client · Content script injection
# What It Can Do
Read Pages
Accessibility tree parsing, full text extraction, and DOM structure analysis. Works on any tab including backgrounded ones.
Interact
Click, type, scroll, fill forms, and upload files via content script injection. React/Vue-compatible event dispatch.
Execute & Monitor
Run arbitrary JavaScript, capture console output, monitor network requests, and record interactions as GIFs.
# Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Extension (Manifest V3) โ
โ โ
โ background.js (service worker) โ
โ โโโ WebSocket client โ ws://127.0.0.1:18963 โ
โ โโโ chrome.tabs API (navigate, list, create) โ
โ โโโ chrome.scripting (JS execution) โ
โ โโโ Persistent port messaging (reliable on Android) โ
โ โโโ 15s heartbeat / auto-reconnect โ
โ โ
โ content.js (injected per-tab) โ
โ โโโ DOM interaction (click, type, scroll) โ
โ โโโ Accessibility tree with WeakMap ref index โ
โ โโโ Form input with native setter + event dispatch โ
โ โโโ Console interceptor (log, warn, error) โ
โ โ
โ popup.html (diagnostics UI) โ
โ โโโ Connection status, message log (200 entries) โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Native Messaging Protocol
4-byte LE length prefix + UTF-8 JSON.
Max message size: 1 MiB.
CDP Integration
Browser-level DevTools Protocol connection.
Network monitoring, device metrics, target management.
Port configurable via BRIDGE_PORT.
# Permissions
| Permission | Why |
|---|---|
| tabs | List, navigate, and create browser tabs |
| scripting | Execute JavaScript and inject content scripts |
| activeTab | Access the currently active tab |
| webRequest | Monitor network requests for CDP integration |
| cookies | Access cookies for authenticated page context |
| <all_urls> | Content script injection on any page |
All communication stays on localhost. No data is sent to external servers. See the privacy policy.
# Known Limitations
No screenshot on Android Edge
captureVisibleTab is unavailable on mobile Edge. The bridge falls back to ADB screencap when ADB is connected.
Service worker suspension
Edge may suspend the background service worker after idle. The extension auto-reconnects when woken by a new tool call.
Protected pages
chrome://, edge://, and extension pages block content script injection. These tabs can still be listed and navigated.
CRX install is manual
Android Edge has no programmatic extension install API. The --setup command serves the CRX and opens Edge, but you must tap "Add extension" manually.