# Daedalus for Chrome A Chrome extension (Manifest V3) that lets the [Daedalus](https://github.com/anchor-inference/daedalus) agent work in tabs of your own Chrome, where you are already signed in: tabs the agent opens in a window of its own (or, while your Chrome is full screen, in the background of your window, so you are never taken out of it), and tabs you give it, each set in a tab group titled "Daedalus · …". The extension never sizes, moves or focuses a window on the agent's behalf. Its side panel frames the Daedalus app beside the page, so you can start a conversation about the page in front of you and answer the agent's questions without leaving it. The extension does nothing on its own. It relays between Chrome's `chrome.debugger` API and the Daedalus browser daemon (`browserd`, started with `--backend attach`), which decides what to do; the extension is the second wall that decides what may be done. - Extension id: `lkhhklicnjlplokpadpccndipomikoaj` (pinned by `key` in the manifest) - Native-messaging host: `com.daedalus.browser` - Chrome 125 or newer (`chrome.debugger` addresses a frame of another site from that version on) - Interface in English and Russian, following Chrome's language ## Install **From a release.** Download `daedalus-chrome-extension-.zip` from the [releases](https://github.com/anchor-inference/daedalus-chrome-extension/releases), check it against the release's `SHA256SUMS` (`sha256sum -c SHA256SUMS`), and unpack it into a folder that will stay where it is: Chrome remembers an unpacked extension by its folder. Open `chrome://extensions`, switch on Developer mode, choose "Load unpacked" and pick that folder. To update, unpack the next release over the same folder and press the reload button on the extension's card. **With the Daedalus desktop application.** Each desktop release carries the extension and keeps it up to date in `browser-extension/` of the application's local state, after checking every file against its checksums and the key against the pinned id; Settings → Environments → Your Chrome shows that path. Load that folder unpacked once, as above, and every later release refreshes it in place. **From source.** `npm ci && npm run build`, then load `dist/` unpacked. **Chrome Web Store.** Not yet published. The id is pinned by the public key in the manifest, so a store release will keep the same id and the same native-messaging registration. ## Pairing with Daedalus The extension reaches Daedalus in one of two ways, and the side panel's settings show which one is in use. An unconnected Chrome's side panel opens on both, as two cards of the same weight with an "or" between them: "Daedalus on this computer" first, then "Daedalus on a server". **Daedalus on this computer (native messaging).** Press *Connect to this computer* in the first card, once *Register* in Daedalus → Settings → Environments → Your Chrome has been pressed: the desktop application then writes the native-messaging host `com.daedalus.browser`, allowed to this extension's id alone. The extension calls `chrome.runtime.connectNative`, Chrome starts `browserd bridge`, and the bridge checks the extension's origin and forwards frames to the running daemon. Nothing to type. Chrome reads host registrations when it starts, so restart Chrome once after the first registration. If the side panel says, in that card, that the Daedalus app did not answer, the app is not installed or that button has not been pressed yet. **Daedalus on a server (WebSocket).** In the Daedalus app, Settings → Environments → Your Chrome gives a one-time pairing code. In the second card, type the server's address (a bare name means HTTPS) and the code, with or without its dash, and press Enter or *Pair*. A wrong or expired code, too many wrong codes and a server that cannot be reached are each said under the field they concern. The extension posts the code, a random id for this Chrome profile, its name and the extension's and Chrome's versions to `https:///api/browser/pair` and receives a token, which it keeps in `chrome.storage.local` and sends in the first frame of `wss:///api/browser/relay`. Only HTTPS is accepted, except for a loopback address. "Disconnect" forgets the token; the server can revoke it at any time, and the extension then asks to pair again. Once connected, the host hands the side panel a short-lived credential over the relay. The panel keeps it in `chrome.storage.session` and passes it to the framed app at `/app/panel` in the bridge's handshake only, never in an address. That credential opens the conversations switched to this Chrome and nothing else of the installation. The relay protocol is versioned (`PROTO` in `src/protocol.ts`), and `test/frames.json` holds one golden frame of every kind, the same file the daemon tests against in the Daedalus repository. When the two sides speak different versions, the side panel says which one to update. ## Permissions | Permission | Why | |---|---| | `debugger` | The relay itself: the daemon drives agent tabs through the DevTools protocol, and only those tabs. | | `tabs` | Open, find and close the agent's tabs, follow their address and title, and see which tab is active for the side panel. | | `tabGroups` | Each agent conversation works in a tab group of its own; dragging a tab in or out gives or takes it back. | | `scripting` | Inject the content script that draws the border and the agent's cursor in agent tabs and reports your own input there, and read a page's text or selection when you attach it from the side panel. | | `downloads` | Tell the daemon where a file an agent tab downloaded landed. Only a download an agent tab announced can be found; your download history is out of reach. | | `cookies` | Answer the daemon with the names, domains and flags of a site's cookies, so the agent can tell whether you are signed in. Never a value. | | `nativeMessaging` | Talk to Daedalus on this computer through `browserd bridge`. | | `declarativeNetRequest` | A session rule, limited to the agent's tab ids, that blocks requests from agent tabs to loopback, private, link-local and metadata addresses, even while the debugger is detached. | | `storage` | The agent's groups (session storage, so a restarted service worker still knows them), the pairing token and your settings (local storage). | | `contextMenus` | "Let Daedalus use this tab" and "Ask Daedalus about this page". | | `alarms` | Wake the service worker once a minute so a dropped relay reconnects. | | `sidePanel` | The panel that frames the Daedalus app. | | `notifications` | Tell you when a conversation in this Chrome is waiting for you or has finished. | | `` (host) | The agent may be asked to work on any site, and the content script and the debugger need the page's origin to do so. The allowlist below, not the host list, is what limits it. | ## Privacy - **Nothing leaves the extension except to your own Daedalus.** It talks to the native host on this computer or to the one server you paired it with. No analytics, no telemetry, no third party. - **Only the agent's tabs.** A tab is in scope when the extension holds it as a member: one the agent opened, a page an agent tab opened, or one you gave it. Every other tab is invisible to the daemon, and a command naming one is refused. - **A second wall.** The extension allows only a fixed set of DevTools domains (Page, Runtime, DOM, DOMDebugger, DOMSnapshot, Input, Accessibility, Log, Fetch, Network, part of Emulation, and two Target methods). Any method that names a cookie, the Storage and Browser domains, and every other domain are refused by the extension itself, so a daemon or bridge that was taken over still cannot read your cookies or reach your other tabs (`src/allowlist.ts`). - **You stay in control.** Your own clicks and keys in an agent tab are reported so control passes to you; a group can be paused, given back or stopped from the side panel; Chrome's own "is debugging this browser" bar can cancel any tab. - **The page reads are yours to start.** Attaching a picture of the page, its text or the selection to a conversation needs your click in the side panel a moment before. - **What is stored:** the pairing token, the profile's random id and name, and your settings in `chrome.storage.local`; the agent's groups and the panel's credential in `chrome.storage.session`, which Chrome clears when it quits. ## Build and test Node 22 or newer. ```sh npm ci npm run check # the type check npm test # vitest against a fake chrome.* (test/fake-chrome.ts) npm run build # tsc, then the static files: dist/ is the folder Chrome loads npm run package # build, then release/: the zip and its SHA256SUMS ``` `DAEDALUS_FRAMES=/browserd/internal/relay/testdata/frames.json npm test` also compares `test/frames.json` with the daemon's copy byte for byte; without it that one test is skipped. `test/e2e/smoke.py` loads the built extension into a real, unbranded Chromium (branded Chrome ignores `--load-extension` since 137) with a stub native host, and checks hello and welcome, ping and pong, the app's check flashing, the side panel's check confirmed, a tab created and driven, a cookie read refused by the extension itself, and the agent's cursor drawn only in its own tab. It needs Python and Playwright: ```sh npm run build && CHROMIUM= python test/e2e/smoke.py ``` `test/e2e/panel.py` opens the built side panel as a page with a stand-in `chrome` and checks the two ways to connect (the cards and their order, the code formatted as typed, Enter sending it, each refusal under its field, the native card connecting and saying why it could not); `--shots ` also saves pictures of it in both languages and both themes: ```sh npm run build && CHROMIUM= python test/e2e/panel.py --shots ``` ## Layout | File | What it is | |---|---| | `static/manifest.json` | permissions, the pinned key, `minimum_chrome_version` | | `src/worker.ts` | the service worker: registers every listener and hands events to the relay | | `src/relay.ts` | the connection, the DevTools proxy, scope changes, the calls, the badge | | `src/protocol.ts` | the frames, the host name, session names | | `src/allowlist.ts` | which DevTools methods may run at all | | `src/scope.ts` | the agent's groups and tabs, kept in `chrome.storage.session` | | `src/transport.ts` | native messaging and the server WebSocket, and what their failures mean | | `src/guard.ts` | the request rule that keeps agent tabs off loopback and private addresses | | `src/content.ts` | the border and cursor on agent tabs and the report of your own input | | `src/panel.ts`, `static/panel.html` | the side panel: the strip, the framed app at `/app/panel`, the settings view | | `src/settings.ts` | the settings view: the two ways to connect, status, the connection check, the group controls, the name, the window mode | | `src/pairing.ts` | the pairing form: the code's format, Enter, each refusal under its field, one request at a time | | `src/bridge.ts` | the side panel's bridge to the framed app: the handshake, the port, the requests it takes | | `src/capture.ts` | what the side panel attaches from the page: a picture, its text, the selection | | `src/mic.ts`, `static/mic.html` | the tab that asks for the microphone, which a side panel cannot | | `src/i18n.ts` | every word, in Russian and English | | `src/chrome.d.ts` | the part of the extension API used here, typed by hand | | `scripts/assemble.mjs` | puts the static files and the icons beside the compiled code in `dist/` | | `scripts/package.mjs` | the release zip and its checksums | ## Release 1. Raise `version` in `package.json` and `static/manifest.json` together (a test keeps them equal) and in `package-lock.json`, and commit. 2. Tag the commit `v` and push the tag. The `ci` workflow checks, tests and packages it, and refuses a tag that does not name the manifest's version. 3. It attaches `daedalus-chrome-extension-.zip` and `SHA256SUMS` to a draft release. Check the draft, then publish it. A published release's files are never replaced; a fix is a new version. 4. Daedalus picks the release up by version and digest; raise the pinned version there. The private half of the manifest's key is kept by the maintainers, outside the repository. An unpacked load needs only the public key already in the manifest; the private half is needed only to publish the same id to the Chrome Web Store. ## License MIT, see [LICENSE](LICENSE).