Skip to content

Browser extension with a shared LLM + Jev core - #39

Merged
ahamsel merged 1 commit into
mainfrom
claude/browser-extension
Sep 28, 2026
Merged

ahamsel merged 1 commit into
mainfrom
claude/browser-extension

Conversation

@ahamsel

@ahamsel ahamsel commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Summary

A Manifest V3 side-panel extension for Chrome, Edge, Brave and Arc. WebPilot works in the user's current tab, with the logins they already have: "summarize this page", "find that email about relocation" with their inbox open, "find some recent tents on Kijiji". It asks before anything irreversible.

Shared core (plain TypeScript + fetch; runs in the extension and in Node tests):

  • lib/cdp/driver.ts: a browser driver over the Chrome DevTools Protocol for any transport, chrome.debugger in the extension or Playwright's CDP session in tests. Input is sent as real mouse/keyboard events; navigations are awaited.
  • lib/cdp/snapshot.ts: converts Chrome's accessibility tree (~60-170ms for a large page) into the same snapshot text Playwright MCP produces, so lib/jev/page.ts, fast mode and the planner read pages identically. Refs are b<backendDOMNodeId>, stable for the life of the document.
  • lib/core/run-task.ts: the task flow over any TaskBrowser: Jev preflight (chat vs browse), a starting page that is aware of the current tab, fast mode, answer check, LLM planner fallback and confirmations. It streams events for the UI and cancels through an AbortSignal.

Extension (extension/):

  • chrome.debugger transport.
  • React side panel with a live flight log: each step is tagged JEV or LLM with timings, and an amber "Hold on — this can't be undone" card offers Allow/Cancel.
  • Connect OpenRouter (OAuth PKCE via chrome.identity) or a pasted key; settings in local extension storage.
  • npm run extension:build / extension:dev (esbuild) / extension:smoke.
  • Docs in extension/README.md, covering permissions and privacy.

Agent changes for desktop and extension:

  • Requests that change something (buy, book, send, delete, submit) skip fast mode and use the careful planner. Jev's preflight asks this in the same call. Probing Jev directly showed it prefers "Back to all tents" over "Add to cart" (0.9 vs 0.06) on a product page, so it is weak at multi-step flows; finding and reading stay in fast mode. The desktop purchase flow went from 20-44s to 16.6s.
  • Fast mode now sees short excerpts of earlier pages (e.g. the price list), so it can judge the current one.
  • Stop aborts in-flight model and Jev requests. Previously it waited for the current call, which can take up to 120s.

Testing

  • npm run build, npm run extension:build
  • npm run health
  • Electron syntax checks (not changed)
  • UI: npm run extension:smoke loads the built extension into Chromium and drives the real side panel against the local webmail/shop: current-page question, relocation email, prompt-injection email, and "buy" cancelled at the confirmation. 4/4, headless and headed. Screenshots were checked (light theme, flight log, confirmation card).
  • npm test (46 pass; new tests/cdp-snapshot.test.ts, gate and abort tests), npm run lint, npx tsc --noEmit
  • npm run bench:fast-mode -- --engine cdp --suite all: the full 17-scenario suite on the extension engine in both modes, 34/34 passed. On the realistic suite fast mode's median was 5.4s vs 32s for the LLM-only path; e.g. Kijiji 17.6s vs 123s, injection inbox 3.9s vs 125s.
  • Not verified: the "Connect OpenRouter" OAuth round trip, which needs an interactive openrouter.ai login. Pasting a key is tested.

Checklist

  • No API keys, cookies, browser profile data, or local run artifacts are included
  • Documentation is updated when behavior or setup changed
  • Screenshots or video are attached for meaningful UI changes

🤖 Generated with Claude Code

A Manifest V3 side-panel extension for Chrome, Edge, Brave and Arc that
works in the user's current tab with their existing logins.

Shared core (used by the extension, testable in Node):
- lib/cdp/driver.ts: browser driver over the Chrome DevTools Protocol
  for any transport (chrome.debugger, or Playwright's CDP session in
  tests); real mouse/keyboard input, waits for navigations
- lib/cdp/snapshot.ts: Chrome accessibility tree -> the same snapshot
  text Playwright MCP produces, so the page parser and fast mode are
  shared; refs are stable backend node ids
- lib/core/run-task.ts: the task flow (Jev preflight, starting page
  aware of the current tab, fast mode, answer check, LLM planner
  fallback, confirmations) with UI events and cancellation

Extension (extension/): chrome.debugger transport, React side panel with
a live step log and an Allow/Cancel card for irreversible actions,
Connect OpenRouter (OAuth PKCE) or a pasted key, local settings.
npm run extension:build / extension:dev / extension:smoke.

Agent changes for both desktop and extension:
- Requests that change something (buy, book, send, delete, submit) skip
  fast mode and use the careful planner; Jev's preflight asks this in
  the same call. Jev is weak at multi-step flows like add to cart ->
  checkout.
- Fast mode sees short excerpts of earlier pages (e.g. the price list).
- Stopping a task aborts in-flight model and Jev requests.

Scenario harness: --engine cdp runs the suite on the extension engine.
Results: 34/34 on the extension engine (fast mode median 5.4s on the
realistic suite vs 32s LLM-only); extension smoke through the real side
panel 4/4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ahamsel
ahamsel merged commit 6464f56 into main Sep 28, 2026
1 check passed
@ahamsel
ahamsel deleted the claude/browser-extension branch September 29, 2026 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant