Skip to content

extension_storage_write ​

Write one key of the extension's storage (chrome.storage or browser.storage) from its background, with no eval.

Quick start ​

Set settings.theme to dark in chrome.storage.local

Asked to set a storage key, the agent writes it through the control channel and reads it back.

Asked to set a storage key, the agent writes it through the control channel and reads it back.

How the agent uses it ​

Answers the key read back in value.readBack; extension_storage_read reads. Needs the session's control channel (on by default in extension_dev).

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 ​

Groupextras, off unless named: on with --features=local,platform,extras or --features=local,extras
TierAct
Needsthe server started with extras in --features, as in --features=local,platform,extras; a dev session, which carries control unless started with allowControl: false
Read onlyno
Destructiveyes
Idempotentno
Reaches the open webno

Inputs ​

InputTypeRequiredDefaultWhat it does
projectPathstringyesProject root of a running session: extension_dev, extension_start, or npx extension dev|start by hand
action"set"no"set"get: a key, or the whole area; set: one key, read back in value.readBack.
area"local" | "sync" | "session" | "managed"no"local"local (this device), sync (the browser account), session (until restart) or managed (policy, read-only).
keystringnoKey to read or write; omitted with get, the whole area answers.
valueanynoValue to set; for null or "" use valueJson.
valueJsonstringnoValue as JSON text; not with value.
observeboolean | stringnofalsetrue adds value.observation, the settled surface's elements; a surface name (e.g. popup) reads that one.
browserstringnoRunning session's browser; needed when several run.
timeoutnumbernoTimeout ms (default 30000; Firefox 10000; debug port 15000).

When it fails ​

  • The call is refused because no session is live. Start one with extension_dev or extension_start and call again.
  • The control channel is off. The session was started with allowControl: false. Start it again without that flag.
  • The tool is missing from the client's list, or the call answers E_TOOL_DISABLED. The extras group is off unless named. Start the server with --features=local,platform,extras, or --features=local,extras without the platform tools; see Server flags and telemetry.

Next ​

  • MCP server: install, the three groups and the session gates
  • Install in your client
  • 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.
  • 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.