extension_element_act
Click or fill one element by CSS selector, or send trusted mouse and key input to a surface or page, with no caller code and no allowEval.
Quick start
Click the Save button in the popup
How the agent uses it
Answers the element's state after the act; extension_element_read, extension_dom_snapshot, extension_inspect and extension_logs read, extension_eval runs code. Chromium only.
Page text in the answer
Part of this tool's answer is text a web page or the extension wrote. The server fences it between <untrusted-data-ID> and </untrusted-data-ID> with a fresh random ID per call, named in untrusted.boundary. A fence is a signal to the model, not a gate: pair it with --no-ship when the agent reads pages you do not trust. See Server flags and telemetry.
Reference
| Group | local, on by default |
| Tier | Act |
| Needs | a live Chromium dev or start session with its debug port; no allowEval |
| Read only | no |
| Destructive | no |
| Idempotent | no |
| Reaches the open web | no |
Inputs
| Input | Type | Required | Default | What it does |
|---|---|---|---|---|
projectPath | string | yes | Project root of a running session: extension_dev, extension_start, or npx extension dev|start by hand | |
action | "click" | "fill" | "move" | "press" | "release" | "type" | "key" | "scroll" | no | "click" | click (a real mouse press), fill, text, wait (until visible); move, press, release, type, key, scroll send trusted input. |
selector | string | no | CSS selector matching exactly one element (the point for input actions; focused before type and key). | |
value | string | no | fill: the value to set. | |
x | number | no | press, release, scroll: the point's x in CSS pixels of the viewport, when no selector. | |
y | number | no | The point's y, with x. | |
points | array of object | no | move: the path, one trusted mousemove per point; a selector's center goes first. | |
button | "left" | "middle" | "right" | no | press, release: the mouse button (default left). | |
text | string | no | type: the characters, one key down and up each; a newline is Enter. | |
key | string | no | key: a key name (Enter, Escape, Tab, ArrowDown, F5) or one character. | |
modifiers | array of "Alt" | "Control" | "Meta" | "Shift" | no | Modifiers held during the input. | |
deltaX | number | no | scroll: wheel delta in CSS pixels (positive scrolls right). | |
deltaY | number | no | scroll: wheel delta in CSS pixels (positive scrolls down). | |
context | "popup" | "options" | "sidebar" | "devtools" | "newtab" | "history" | "bookmarks" | no | An open surface (extension_open first). | |
url | string | no | A web page's tab by url. | |
targetId | string | no | Page targetId (extension_open, extension_dom_snapshot listTargets); wins over url. | |
browser | string | no | Running session's browser; needed when several run. | |
timeout | number | no | Timeout ms; wait polls until it (default 10000, max 30000). |
When it fails
- The call is refused because no session is live. Start one with
extension_devorextension_startand call again. - Eval is refused. Eval is the one gate that stays off. Start the session with
allowEval: trueonextension_dev.
Next
- MCP server: install, the three groups and the session gates
- Install in your client
extension_element_read: Read one element's text by CSS selector, or wait until it is visible, in a surface or page.extension_eval: Evaluate JavaScript in an extension's background, surface, content script, page or targetId.extension_open: Open an extension surface or a url in a session, or replay the toolbar click, a menu item or a shortcut, over the control channel (by hand: --allow-control).extension_reload: Reload a running session's background, or one tab, through the control channel (allowControl); answers once it is back.extension_storage_read: Read the extension's storage (chrome.storage or browser.storage) from its background, with no eval.extension_storage_write: Write one key of the extension's storage (chrome.storage or browser.storage) from its background, with no eval.