ext claude-code-bridge v1.9.1

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.

โ€บ Accessibility tree
โ€บ Full page text
โ€บ Element search by text/role/aria
๐Ÿ–ฑ

Interact

Click, type, scroll, fill forms, and upload files via content script injection. React/Vue-compatible event dispatch.

โ€บ Click / type / scroll
โ€บ Form input with framework compat
โ€บ File upload
โšก

Execute & Monitor

Run arbitrary JavaScript, capture console output, monitor network requests, and record interactions as GIFs.

โ€บ JavaScript execution
โ€บ Console message capture
โ€บ Network request monitoring

# 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.

# Source Files

edge-claude-ext/
โ”œโ”€โ”€ manifest.json Manifest V3 config, permissions, service worker
โ”œโ”€โ”€ background.js Service worker โ€” WS client, tab management, tool dispatch
โ”œโ”€โ”€ content.js DOM interaction, accessibility tree, form handling
โ”œโ”€โ”€ popup.html Diagnostics popup โ€” connection status, message log
โ”œโ”€โ”€ popup.js Popup logic โ€” status display, log rendering
โ””โ”€โ”€ launcher.html Bridge launch page (cfcbridge:// URL handler)