Skip to content

Chrome extension

The app (https://agent.dudko.dev/app/) in Chrome’s side panel - its providers with your own keys, models per role, images, web search, voice, memory, skills, MCP servers, chats and files - plus tools for the browser’s tabs and windows and the pages you allow it on: it reads a page (its text and its elements, or a picture of it), acts on it (click, type, pick, scroll, navigate) in any tab - background ones included -, and works canvas apps (Flutter web, games, design tools) by pictures and real mouse and keyboard input. Everything runs in your browser: each model is called straight from the side panel with its provider’s key, nothing goes through a server of ours.

Stage 1 was the panel, the chat, the key, and tabs / windows; stage 2 pages - reading, acting, pictures, DevTools, canvas apps - and the page context; stage 3 (this) is sites’ own WebMCP tools, behind a switch (see “Sites’ own tools”).

Not on npm. For the Chrome Web Store the owner uploads the zip by hand (see Publishing); or build it and load it unpacked. Privacy: https://agent.dudko.dev/privacy/#chrome.

Terminal window
pnpm install
pnpm nx build chrome # → apps/chrome/dist (builds the packages it uses first)
  1. Open chrome://extensions and turn on Developer mode (top right).
  2. Load unpacked → pick apps/chrome/dist.
  3. Click the extension’s toolbar button (pin it from the puzzle-piece menu): the side panel opens on the app’s first screen.
  4. Connect a provider with your API key (Google, Anthropic, OpenAI, OpenRouter, DeepSeek, Qwen, Kimi, or your own OpenAI-compatible server) - more later in Settings → Providers.
  5. Open a page and press Allow on in the bar above the message box: Chrome asks you to let the extension read and change that site. Only then can the agent read or act there.

The extension keeps its own data (its own origin): the keys, chats, files and settings of the app at agent.dudko.dev are not here, and the other way round. A key stored by an earlier build of the extension (its own settings form) is not read: connect the provider again.

After a rebuild, press the reload button on the extension’s card in chrome://extensions. Chrome 116 or newer (the side panel API).

The owner’s, by hand: bump version in manifest.json (a PR of its own), merge, run the Package Chrome extension workflow (.github/workflows/package-chrome.yml) from main. It attaches agent-chrome.zip (the STORE build of dist/, manifest.json at its root, no source maps) to a chrome-v<version> GitHub release; upload that zip in the Chrome Web Store developer dashboard. Locally: pnpm nx build chrome && pnpm --filter chrome pack:store.

The store build has no page_run_js. pack:store builds dist/ again with --store (src/edition.ts): the tool, its card and the service worker’s operation are not in the package at all - the store’s package runs no code the model wrote, so its “remote code” answer is a plain No - and pack:store refuses to zip a build in which any of it is left (scripts/store-check.mjs). A build you load unpacked (pnpm nx build chrome) keeps the tool; run it again after pack:store to get that build back. The store listing’s privacy policy is https://agent.dudko.dev/privacy/ - keep it true to what the extension does.

The panel is a build of apps/app with this extension’s host (src/app-host/, through the app’s host seam - apps/app/src/host/): the same screens, settings and agent, nothing copied. The host adds:

  • the browser’s tools (below) with their consent rules, which the app puts over its own - closing a tab or a window asks every time, in any mode;
  • Settings → Browser: page access per site (Allow / Ask / Deny, Remove), DevTools access, sites’ own tools (WebMCP), the microphone, and what is shared with each message;
  • the site bar above the message box (“Allow on ”, or the site’s rule);
  • the page context (the active tab, its selection, the focus).

And leaves out what an extension must not or need not carry:

Left out Why
Chat on this device (WebLLM) it downloads each model’s library - WebAssembly, i.e. code - from GitHub at the first download; an extension runs no remote code
PDF → Markdown, a scan’s pages as pictures, raster → SVG @dudko.dev/pdf-to-md-core / @dudko.dev/vectorize-core are licensed to the app ONLY at https://agent.dudko.dev/app/ (the site’s /terms/): their workers are not in the build at all; a PDF is attached as a file
The PWA (service worker, install) Chrome installs and updates the extension
MCP Apps (a server’s interactive views) their sandbox page answers the site’s address only; an app falls back to the chat’s opaque frame and says it cannot run

Two of the app’s features work differently here:

  • Models on this device (search by meaning, speech to text - Settings → Memory and → Voice): their runtime - transformers.js and onnxruntime-web’s WebAssembly - is in the package; only the models’ weights are downloaded, from Hugging Face at pinned commits and checked by size and SHA-256, after your yes. No code is fetched (wasmPaths is the extension’s own file, and transformers.js’ CDN default is cut out of the build).
  • Signing in to an MCP server (OAuth) goes through Chrome’s own sign-in window (chrome.identity.launchWebAuthFlow, the identity permission): the authorization server sends you back to https://<extension id>.chromiumapp.org/mcp, an address only this extension receives. The answer is taken only from that address and only with the state of the request the extension opened; the tokens are kept in the extension’s vault.

Chrome’s side panel names the extension above the page, so the bars show the mark without the word “Agent”. The packed extension (pack:store) is about 6.3 MB.

Tool What it does Asks first?
tabs_list the open tabs (all, or of one window): id, window, position, title, address, active no (reads)
tabs_get_active the tab you are looking at no (reads)
windows_list the windows: id, focused, type, state, number of tabs, the active tab’s title no (reads)
tabs_focus switch to a tab and bring its window to the front no (changes only what you see)
windows_focus bring a window to the front no
tabs_open open an http(s) address in a new tab yes
tabs_close close a tab (the card shows its title) yes, every time
tabs_move move a tab to another position or window (the card shows its title) yes
windows_create open a new window, optionally with an http(s) address yes
windows_close close a window and every tab in it (the card shows its tab count and active tab) yes, every time

Pages (on a site you allowed - see “Page access”):

Tool What it does Asks first?
page_snapshot a page’s text and an outline of its elements (role, name, state), each with a ref ([ref=e12-k3f9q]: valid on that page only - after a navigation or a reload it is refused) for the actions; says when the page draws on a canvas, and whether a Flutter app’s accessibility tree is off by the site’s rule
page_screenshot a picture of the visible part of a tab, which the model sees (fullPage: the whole page, DevTools) by the site’s rule
page_zoom a part of the last picture, enlarged (small text, icons) - no new picture no
page_wait until a text appears (up to 15 s), or for some seconds by the site’s rule
page_scroll scroll a page, or bring an element into view by the site’s rule
page_click click an element by its ref (the card names it: button “Pay”) yes (unless the site is Allow)
page_type type into a field by its ref (the card shows the field and the text) yes; a password, card or code field every time
page_select pick an option of a <select> yes
page_navigate / page_back open an address in the tab / go back yes; another site’s rule counts too (Deny there refuses, Allow here does not cover it)
page_enable_semantics a Flutter web app: turn on its accessibility tree (“Enable accessibility”), so the snapshot has refs yes
page_click_at / page_type_text / page_press_key / page_scroll_at canvas pages: real mouse and keyboard at the picture’s pixels (DevTools); each answers with a new picture yes (scrolling: by the site’s rule)
devtools_console / devtools_network / devtools_accessibility the page’s console, its requests (no query strings), Chrome’s full accessibility tree (DevTools) by the site’s rule
page_run_js runs JavaScript the agent wrote in the page, as the DevTools console does: what it logs (it shows in the page’s console too), the value of its last expression or the error it threw (DevTools) - not in the Chrome Web Store’s build (Publishing) every time, the whole code on the card - on an Allow site and in Auto too; refused in Read-only
site_tools_list the tools the page itself offers to agents (WebMCP: name, description, input schema) - only while “Use sites’ own tools” is on by the site’s rule
site_tool_call calls one of them by name with an input - only while that switch is on every time, the site, the tool and the whole input on the card - on an Allow site and in Auto too; refused in Read-only

“Asks first” is the chat’s consent card (Allow once / Deny). The chat’s mode switch can change it for the conversation (Ask before changes - the default -, Ask always, Auto, Read only); the rules above still hold in each. Closing a tab or a window asks every time, in any mode, and its card has no “Always allow”. The title (and for a window the number of tabs) on the card is checked against the real tab before anything is closed or moved: if it differs, nothing happens.

The app’s own tools are there too (files, run_js, run_sql, memory, web search when on, images, your MCP servers’ tools). A page’s picture reaches the model when every role of the run is on Google, Anthropic or OpenAI (their adapters carry a picture in a tool result); with OpenRouter, DeepSeek, Qwen, Kimi or a local server in a role the agent is told it cannot see it and works from snapshots.

  • Sites are granted one by one, by you. The extension asks for no site at install. “Allow on ” (the bar above the message box) asks Chrome for that site (https://<site>/* and http://<site>/*, optional host permissions); Remove gives it back.
  • Each site has a rule: Allow (no cards on that site), Ask (the default: a card before every read and every action) or Deny (nothing, reading included). The rule is yours: no tool writes it, and a page cannot change it. The chat’s mode switch does not loosen it: in Auto an action on an Ask site still asks; Read-only refuses every action on a page.
  • Password, card and one-time-code fields: their values are never read (the snapshot says “secret field”), and typing into one asks EVERY time - on an Allow site too - with a card that names the field and shows what is typed. A field counts as one when the page marks it (type=password, autocomplete cc-* / one-time-code / *-password) or names it so (password, card number, CVC, PIN, verification code…).
  • The card shows what is real: before it asks, the agent reads the tab’s title and site and the element’s role and name from the page; the action then runs only if the element is still that one (a page that renames “Add to cart” to “Delete account” after the card gets nothing).
  • DevTools access (Settings → Browser → DevTools access; off by default): Chrome grants the debugger permission at install only - it refuses to let an extension ask for it later -, so the extension holds it and uses it only while this switch is on: pictures of background tabs and whole pages, the console, the network, the full accessibility tree, and real mouse / keyboard input for canvas apps. While the agent uses it, Chrome shows a bar “Agent by dudko.dev started debugging this browser”; Cancel on it detaches at once. It detaches when the panel closes and after 5 minutes unused.
  • Pictures of the visible tab are drawn by Chrome for the tab where you opened the panel from the toolbar button (activeTab); any other tab is drawn through DevTools. The model gets the picture once, at most 1568 px on its longer side; the chat shows a small thumbnail.

Some sites register tools for agents themselves (WebMCP: navigator.modelContext / document.modelContext). Settings → Browser → Use sites’ own tools (WebMCP) - off by default - gives the agent two tools: site_tools_list reads the tools of a tab’s page and site_tool_call calls one. Off, neither exists for the model, and the service worker refuses them too (it reads the switch, dd-agent/webmcp, on every use).

  • Only on a site you granted and whose rule is not Deny, never on a browser, extension or store page or in incognito - the same as the page tools. Listing is reading the page (asked on an Ask site).
  • A site’s tool runs that site’s code as you, with your login there: every call is asked, on a card naming the site, the tab, the tool and the whole input - on an Allow site and in Auto too; Read-only refuses it. Deny sends nothing to the site. The call starts only on the site and the page (document) the card was about; a page that navigates while the tool runs is said so with the result.
  • The extension reads the page’s tools with a small function run in the page’s own JavaScript world (chrome.scripting, world: 'MAIN' - WebMCP lives there), top frame only. What comes back is the site’s: names must be safe (letters, digits, _ . -, up to 128), at most 50 tools, descriptions cut to 1000 characters, schemas to 6000, a whole list to about 40 000 (schemas left out first), results to 12 000, a site’s error to 200, a call’s input to 8000, 20 s at most; descriptions, schemas, results and errors reach the model between nonce markers, marked untrusted - data, never instructions. A call that times out may still have run (the site’s code was started): the agent is told to look at the page before calling again.
  • Where it goes: the input of a call you allowed goes to that page (and from there wherever that site’s own code sends it); the tools’ list and the result go to the model of the chat, like a page’s text. Nothing else is sent anywhere.
  • A page or browser without WebMCP: site_tools_list says so plainly.

Canvas apps (Flutter web, games, design tools)

Section titled “Canvas apps (Flutter web, games, design tools)”

They draw their text and controls on a canvas: the DOM has little to read and clicks by ref (DOM events) do not reach them. page_snapshot says so (canvas), and the agent works by pictures: page_screenshot, then page_click_at / page_type_text / page_press_key / page_scroll_at at the picture’s pixels - mapped to the page’s CSS pixels (device pixel ratio and zoom included) and sent as DevTools input, which a page cannot tell from a person’s - each followed by a new picture; page_zoom enlarges small text. A Flutter app keeps an accessibility tree that is off until its “Enable accessibility” switch is pressed: page_enable_semantics presses it, and the next snapshot lists its flt-semantics buttons and fields with refs - then the usual tools work.

Chrome cannot show its microphone prompt in a side panel. Settings → Browser → Microphone → Allow the microphone… opens a tab of the extension (mic.html) where Chrome asks once; the stream is stopped at once and nothing is recorded there. Then the composer’s microphone (dictation, voice messages - Settings → Voice) works in the panel.

Page context (Settings → Browser → Share with each message)

Section titled “Page context (Settings → Browser → Share with each message)”

Three switches, all off by default; what is on is shown in the “Sharing: …” chip above the message box and goes with each message as quoted data (the core’s context):

  • the active tab’s address (without its query and fragment) and title;
  • the selected text in it;
  • the focused element: its role, label and type - never what is typed in it.

The selection and the focus come from a small content script, registered only while one of those two is on, on the sites you granted. Nothing is shared from a browser page, an extension page or a site whose rule is Deny.

  • Permissions: sidePanel, storage, tabs, scripting, activeTab, debugger and identity at install (Chrome refuses to let an extension ask for debugger later; it is used only while your DevTools switch is on; identity only for an MCP server’s sign-in you start) - no site, no <all_urls>, no content script in the manifest; tabs lets it read the titles and addresses of your tabs. Asked for at run time, on your click: each site (optional_host_permissions).
  • Never a target: browser pages (chrome://, edge://, about:, devtools://, view-source:, file:, …), any extension’s pages (this one’s included) and the extension stores (Chrome Web Store, Edge Add-ons). They are listed, marked protected, and every action on them is refused - even after you allow it. A tab loading such a page counts as one; a window with one such tab is not closed as a whole. Incognito windows are left alone.
  • Titles and addresses are data: a page picks its own title. Every tool result is marked untrusted with a note, titles are clipped to 150 characters, addresses to 300, lists to 100 tabs.
  • Page content is data: a page can write “ignore your instructions” anywhere. A snapshot’s text and outline sit between markers with a fresh random nonce (a page cannot forge the end), every result carries the note, the system prompt says it, and nothing a page says changes a rule, a permission or what is asked. The page agent runs in the extension’s isolated world (the page’s scripts cannot see it or its refs).
  • Your keys: the app’s - the core’s vault (IndexedDB, encrypted with a non-extractable AES-GCM key); never in chrome.storage, Web Storage or a log. Every provider call refuses redirects (a key in a header never follows a 3xx). chrome.storage.local holds the site rules and the switches (DevTools, sites’ own tools, the page context) only.
  • No remote code: everything - the app, the core, the providers’ SDKs, SQLite, QuickJS and onnxruntime-web - is in the package (script-src 'self' 'wasm-unsafe-eval': their WebAssembly is compiled from the package’s own files; no unsafe-eval: zod runs jitless). tests/manifest.test.ts reads dist/ for any import from the network, any address of a script, module or WebAssembly file or of a code CDN, and the code of the features left out.
  • Who may ask the service worker: only this extension’s side panel page (app/index.html); the arguments are checked again there against the same schemas.
../app/ the side panel: the app, built into dist/app/ with this host
src/
app-host/index.ts the app's host: the tools, the page context, the Browser tab, the bar
app-host/browser.ts what the panel knows of the browser (rules, grants, switches, tab)
app-host/BrowserTab.tsx Settings → Browser
app-host/SiteBar.tsx "Allow on <site>" above the message box
mic.html / mic.ts / mic.css the microphone page (a tab: a side panel cannot prompt)
tools.ts the agent's tab / window tools: one message each to the service worker
page-tools.ts the page tools: the target read, the site rule, the card, the call
site-tools.ts sites' own tools (WebMCP): the switch, the card every call, the fence
webmcp.ts WebMCP's caps and the sanitizers of what a page answers
site-rules.ts per-site rules (allow / ask / deny) and the consent decision
page-context.ts what is shared with each message (the three switches)
pictures.ts pictures for the model: size, coordinates, zoom
protocol.ts the message shapes, the sender check
schemas.ts / page-schemas.ts one strict zod schema per operation
background.ts / worker.ts the service worker: the panel's requests → chrome.*
handlers.ts tab / window handlers, over an API object (a fake in tests)
page-handlers.ts page handlers: chrome.scripting, captureVisibleTab, chrome.debugger
page/agent.ts the page agent, injected into a tab (snapshot, refs, actions)
page/dom.ts its rules: roles, names, secret fields, canvas pages
page/context-script.ts the page-context content script (selection, focus)
page/webmcp-page.ts the function run in a page's own world: list / call its WebMCP tools
guard.ts what may never be a target
manifest.json copied into dist/
public/icons/ rendered from the site's mark (pnpm --filter chrome icons)
scripts/build.mjs esbuild → dist/ (worker, page scripts, mic page) + the app → dist/app/
Terminal window
pnpm nx test chrome # node --test: guard, protocol, handlers on a fake chrome API, tools, site rules, page tools, manifest + dist
pnpm nx test:e2e chrome # Playwright: the unpacked extension in Chromium

The browser test loads dist/ into a persistent Chromium context (--load-extension; Chromium’s new headless mode - the headless shell cannot load extensions), opens chrome-extension://<id>/app/index.html directly at the panel’s size (400 x 800), connects Google with a dummy key through the app’s onboarding, and drives the chat against a scripted Gemini (the app’s e2e/providers.ts, served by the context’s routes): no error and no PWA in the panel, listing tabs, closing one after the consent card (in Auto too), refusing the extension’s own page, and Settings → Browser (DevTools, sharing, the microphone page). CHROME_RENDERS=<dir> writes the panel’s renders. Every other request is aborted and fails the test - no real model, no real key.

e2e/pages.spec.ts drives the page tools against local pages (e2e/pages/): a form (reading, typing, picking, clicking - each card; a site set to Allow, Deny, not granted; the password field asked every time; the page agent’s own refusals), a canvas game that counts only trusted clicks and keys (page_click_at at the mapped point, page_type_text, page_press_key), and a stand-in for a Flutter web build (a canvas in <flutter-view>, its flt-semantics-placeholder turning on flt-semantics nodes - the structure Flutter’s engine makes; a real Flutter build needs the Flutter SDK, which the test does not download), plus pictures, the console and the page context. Those tests load a copy of dist/ whose manifest asks at install for what the real one asks at run time (launchExtension({ granted: true })): Chrome’s permission prompt is browser UI a headless test cannot press.

e2e/webmcp.spec.ts drives sites’ own tools against e2e/pages/webmcp.html (a stand-in navigator.modelContext with one tool, add_to_cart): the list asked on an Ask site and fenced, a call asked with the site, the tool and the input - Deny adds nothing; on an Allow site still asked, Allow adds once and the result reaches the model; the switch off - the tools are not offered.

MIT, as the repository.