Browser extension (extension/)
- Manifest V3 service worker holds a WebSocket to the local hub and
dispatches commands against the user's real browser — their tabs,
cookies, logged-in sessions
- Popup shows pairing status; auto-reconnect with exponential backoff and
a chrome.alarms keepalive ping so the worker isn't suspended mid-call
- Content script handles DOM operations (CSS or text= selectors)
- Tools exposed: bx.{tabs,open,activate,close,navigate,screenshot,click,
type,extract,scroll,eval}
Bridge
- automate/extension_bus.py bridges sync tool handlers ↔ async WS via a
threading.Event + asyncio.Queue, single-extension semantics
- automate/server/api/extension.py mounts /api/extension/{ws,status}
- /api/status now reports extension_connected; UI shows a live dot
Packaging
- packaging/automate.spec — PyInstaller spec wired to automate/__main__,
bundles the static SPA, excludes heavy ML deps
- .github/workflows/build.yml — manually-triggered Windows / macOS-arm64 /
Linux build matrix that also packs the extension and publishes a
Release with all four artifacts
- Dockerfile + .dockerignore — python:3.12-slim base with Playwright
Chromium preinstalled; binds 0.0.0.0:8765, mounts /data
- Wheel + sdist build verified locally (102KB wheel installs into a
clean venv, `automate doctor` reports 22 tools / 25 providers; bound
server returns 200 on / and correct status JSON)
Restructure
- integrations/ → automate/integrations/ for one-package cohesion;
adapter import path updated; setuptools find scope tightened
- README + README_CN: new install matrix (pip / binary / Docker /
extension), project-layout map, updated tool inventory
https://claude.ai/code/session_01KLygewzdXxieWmndwGVBEf
2.2 KiB
autoMate Bridge — browser extension
Gives the local autoMate hub control of your browser — your tabs, your
logged-in sessions, your cookies. Without this extension, autoMate's
browser.* tools spawn an empty Chromium via Playwright and have to log
in from scratch every time.
Install (Chrome / Edge / Brave / any Chromium ≥ 116)
- Make sure
automate serveis running. - Open
chrome://extensions, toggle Developer mode on (top-right). - Click Load unpacked, select this folder.
- The toolbar icon should flip to a green ON badge within a couple of
seconds. Click the icon to confirm
Connected to autoMate.
That's it. autoMate's chat will now be able to call bx.tabs, bx.click,
bx.extract, etc. against your live browser.
Tools it exposes
| autoMate tool | what it does |
|---|---|
bx.tabs |
list open tabs |
bx.open |
open a new tab at a URL |
bx.activate |
switch focus to a tab |
bx.close |
close a tab |
bx.navigate |
navigate the active tab to a URL |
bx.screenshot |
capture the visible area of the active tab |
bx.click |
click an element (CSS or text=... selector) |
bx.type |
type into an input (optionally submit) |
bx.extract |
pull text / html / links / page meta |
bx.scroll |
scroll up/down/top/bottom |
bx.eval |
evaluate a JS expression in-page (high power) |
Talking to a non-default server
If you ran the server on a custom host/port, click the extension icon, paste
the WebSocket URL (e.g. ws://192.168.1.20:8765/api/extension/ws), and hit
Save & reconnect.
Privacy
The extension talks to 127.0.0.1 by default. No data leaves your machine.
The autoMate server only accepts one extension connection at a time.
Firefox
Firefox MV3 is broadly compatible — chrome.* APIs are aliased — but support
varies. PRs welcome.