The Problem
AI agents often need to interact with a user’s logged‑in browser, but existing solutions force agents to open new windows, lose session state, or block the user’s workflow. A clean integration that preserves the user’s session, runs in a separate visible window, and allows human hand‑off for captchas or confirmations is missing.
What This Does
BrowserSkill lets an AI agent control a real browser tab while the user continues normal work.
- Tab borrowing –
apps/extension/src/content/BorrowConfirmationOverlay.tsxandHelpRequestOverlay.tsximplement the human‑in‑loop workflow. - Full‑page screenshots –
apps/extension/src/long-screenshot/long-screenshot.browser.tscaptures arbitrary pages, whileapps/extension/src/long-screenshot/exports.tswrites the image file. - Command bridge –
crates/bsk-protocoldefines JSON‑RPC messages; the CLI (crates/bsk-cli/src/main.rs) serialises commands and the extension (apps/extension/src/lib/audit-bridge.ts) deserialises them to drive UI actions.
How It Is Wired
- Entry point –
crates/bsk-cli/src/main.rsparses CLI args (bsk screenshot …) and sends aScreenshotRequestviabsk-protocol. - Daemon – The Rust binary spins a WebSocket server (
crates/bsk-cli/src/daemon.rs– not shown but inferred). - Extension background –
apps/extension/src/entrypoints/background.tslistens on the same WebSocket, forwards messages to the visible agent window (apps/extension/src/entrypoints/popup/App.tsx) and to content scripts (apps/extension/src/entrypoints/content.ts). - Content scripts –
apps/extension/src/content/record-capture.tsperforms DOM actions,long-screenshot.tscaptures frames, andoverlay-controller.tsmanages UI overlays. - Result delivery – The extension writes files via
apps/extension/src/long-screenshot/storage.ts; the CLI reads the file and returns the path.
The communication chain has four hops: CLI → daemon → background → content. Each hop uses a small, well‑named function (sendRequest, handleMessage, executeCommand), limiting blast radius. The module graph shows a single cycle between daemon-connection-preference.ts and daemon-port-preference.ts, which centralises port selection; changing it would affect all connection logic.
How To Use It
Setup
git clone https://github.com/moses-y/BrowserSkill
cd BrowserSkill
# Rust toolchain
rustup target add x86_64-unknown-linux-gnu
cargo install --path crates/bsk-cli
# Extension build
pnpm i
pnpm run build
Configuration – Set BSK_HOME to a writable directory (e.g., ~/.bsk). Running
# Start the daemon
bsk daemon
# Use the CLI
bsk screenshot --session 12345 --full-page --out page.png
The extension must be loaded as an unpacked extension from apps/extension/dist in Chrome/Edge.
Real‑World Use
An agent can request a screenshot of a logged‑in page:
bsk screenshot --session 42 --full-page --out dashboard.png
The CLI forwards the request to the daemon, the extension captures dashboard.png, and the agent receives the file for further analysis.
Code Health & Issues
- Low/Secret – Test fixtures contain
cert.pemandkey.pemundercrates/bsk-cli/tests/fixtures/remote-tls/. They are flagged as secret‑shaped paths but are only used in tests, not in production. - No other static‑analysis findings are reported.
- The repository includes a comprehensive test suite (≈200 tests) and CI (
.github/workflows/ci.yml).
The Bottom Line
BrowserSkill offers a pragmatic, low‑overhead bridge between shell‑able AI agents and a logged‑in browser. The code is split cleanly between Rust (daemon/CLI) and TypeScript (extension), with clear entry points and a small, well‑contained communication layer. The main trade‑off is that the extension must be manually loaded or installed from the store; automated deployment requires extra scripting. Overall, it is a solid foundation for agents needing real‑browser interaction without disrupting the user.