Skip to content

Browser Extension

v2.0.0: Extension upgraded from 8 to 24 commands. New capabilities include tab management, advanced interactions (hover, drag, scroll, key press), storage access, console/network monitoring, and dialog handling. New permissions required: tabs, cookies.

Chrome extension that gives AI agents access to the user’s real browser — with existing cookies, sessions, and authentication. It uses the logged-in browser profile; sites can still reject automation or require user interaction.

Playwright runs in an isolated browser with no cookies or login state. Many sites detect and block automated browsers. The browser extension bridges to the user’s real Chromium instance, so agents can:

  • Navigate and interact with authenticated pages
  • Use existing OAuth sessions (GitHub, Google, etc.)
  • Work in the existing browser session; CAPTCHA challenges may still require the user
  • Take screenshots of real page state
Agent Worker
│
▼
BrowserExtTool (src/tools/browser-ext/)
│
▼
BrowserBridgeService (src/api/browser-bridge.ts)
│ WebSocket (ws://localhost:3005/ws/browser-bridge)
│ (dedicated bridge, separate from /gateway protocol)
▼
Chrome Extension (browser-extension/)
│
├─ Service Worker (background.js) — WebSocket client, command dispatch
├─ Content Script (content.js) — element highlighting
└─ Popup (popup.html/js) — settings, connect/disconnect

Commands are sent as JSON over WebSocket with a unique ID. The extension executes the command and returns the result (or error) with the same ID for promise resolution.

Terminal window
# Manjaro / Arch
sudo pacman -S chromium
# Ubuntu / Debian
sudo apt install chromium-browser
# Fedora
sudo dnf install chromium
  1. Open chromium://extensions
  2. Enable Developer mode (toggle, top right)
  3. Click Load unpacked
  4. Select the browser-extension/ directory (or ~/.octipus/browser-extension/ if installed via setup wizard)
  1. Click the extension icon in the toolbar
  2. Enter the backend URL: ws://localhost:3005
  3. Enter a personal access token or session token (see API authentication); the vault MASTER_KEY is not accepted for API authentication
  4. Click Connect

The badge shows ON when connected, OFF when disconnected.

Run the setup wizard (npm run setup). If Chromium is detected, a “Browser Extension” checkbox appears in optional extras. Selecting it copies the extension to ~/.octipus/browser-extension/ and prints loading instructions.

CommandDescriptionPermission
navigateNavigate active tab to a URLASK
new_tabOpen a new browser tabASK
close_tabClose a tab by IDASK
select_tabSwitch focus to a tab by IDASK
get_tabsList all open tabsALLOW
CommandDescriptionPermission
screenshotCapture visible tab as base64 PNGALLOW
extract_contentExtract text, links, forms from pageALLOW
CommandDescriptionPermission
clickClick element by CSS selector; supports doubleClick parameterASK
fillFill input field with valueASK
selectSelect option in a <select> elementASK
hoverHover over an element by CSS selectorASK
press_keyPress a keyboard key (e.g. Enter, Tab, Escape)ASK
scrollScroll the page or an element by pixel offsetASK
dragDrag an element from one position to anotherASK
CommandDescriptionPermission
wait_forWait for an element or condition to appearALLOW
highlightVisually highlight an element on the pageALLOW
CommandDescriptionPermission
evaluateExecute JavaScript in page contextASK (dangerous)
get_cookiesGet cookies for a domainASK (dangerous)
set_cookiesSet cookies for a domainASK (dangerous)
get_storageRead localStorage or sessionStorage valuesASK (dangerous)
set_storageWrite localStorage or sessionStorage valuesASK (dangerous)
CommandDescriptionPermission
get_consoleRetrieve captured console log entriesALLOW
get_networkRetrieve captured network request/response logASK
CommandDescriptionPermission
handle_dialogAccept or dismiss a browser dialog (alert, confirm, prompt)ASK

The browser-ext tool is available to these roles:

RoleWhy
researchBrowse authenticated sources
qaTest real browser behavior
securityAssess authenticated endpoints
aiInteract with AI platforms
generalFallback access
// Handshake
{ "type": "connect", "version": "2.0.0", "tabCount": 5, "userAgent": "..." }
// Command result
{ "type": "result", "id": "cmd-123", "result": { ... } }
// Error result
{ "type": "result", "id": "cmd-123", "error": "Element not found" }
// Tab change notification
{ "type": "tab_update", "tab": { "id": 1, "url": "...", "title": "..." } }
// Connected acknowledgment
{ "type": "connected" }
// Command request
{ "type": "command", "id": "cmd-123", "command": "navigate", "params": { "url": "..." } }
// Pong
{ "type": "pong" }
  • WebSocket authenticated via personal access token or session token (passed as token query parameter)
  • evaluate, get_cookies, set_cookies, get_storage, set_storage, and get_network marked as dangerous — require explicit permission approval
  • Navigation, tab management, and interaction commands require ASK-level approval
  • Screenshots, content extraction, console capture, and element highlighting default to ALLOW
  • v2.0.0 requires the tabs and cookies browser permissions

Extension won’t connect:

  • Check that the backend is running (npm run dev)
  • Verify the API key is a valid personal access token (from Settings → API Tokens) or session token; do not use MASTER_KEY
  • Check the service worker console in chromium://extensions for errors

Commands time out:

  • Default timeout is 30 seconds
  • Check that the target tab is loaded and responsive
  • Try with a specific tabId if multiple tabs are open

Badge shows ”!”:

  • Connection error or authentication failure
  • Click the extension icon to see status details

Edit this page in the repository.