You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add origin-scoped clipboard-read permission control (clipboard read fails with NotAllowedError in headless)
#2316
In a headless session, clipboard read fails with NotAllowedError, because navigator.clipboard.readText() needs the clipboard-read permission. The CLI gives no way to grant that permission for one origin.
Environment
agent-browser 0.39.2, headless Chromium
Linux
Reproduction
agent-browser open http://localhost:3000/ (any page served from a local origin)
agent-browser clipboard write "hello"
agent-browser clipboard read
Expected: a caller can first grant clipboard-read for http://localhost:3000, and the read then returns hello.
Actual: the read fails with NotAllowedError (from navigator.clipboard.readText()). There is no CLI command that grants clipboard-read scoped to an origin.
Details
The daemon's permissions action calls Browser.grantPermissions with only a permissions array. It sets neither origin nor browserContextId, so a grant applies to every origin in the browser instead of the page under test.
Callers can't safely send the CDP command themselves. Discovering the endpoint (cdp_url and similar actions) can implicitly launch a browser when none is running.
Proposal
Add an action that works only on an existing browser, for example clipboard permission grant|reset <origin>, which:
validates that <origin> matches the active target's origin exactly;
calls Browser.setPermission with { name: "clipboard-read" }, setting: "granted" (or "prompt" for reset), that origin, and the target's browserContextId;
never launches a browser if none is running.
We patched this locally along those lines and confirmed it with headless Chromium:
reads were refused before the grant and allowed after it;
This discussion was converted from issue #2225 on November 03, 2026 06:47.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Summary
In a headless session,
clipboard readfails withNotAllowedError, becausenavigator.clipboard.readText()needs theclipboard-readpermission. The CLI gives no way to grant that permission for one origin.Environment
Reproduction
agent-browser open http://localhost:3000/(any page served from a local origin)agent-browser clipboard write "hello"agent-browser clipboard readExpected: a caller can first grant
clipboard-readforhttp://localhost:3000, and the read then returnshello.Actual: the read fails with
NotAllowedError(fromnavigator.clipboard.readText()). There is no CLI command that grantsclipboard-readscoped to an origin.Details
permissionsaction callsBrowser.grantPermissionswith only a permissions array. It sets neitheroriginnorbrowserContextId, so a grant applies to every origin in the browser instead of the page under test.cdp_urland similar actions) can implicitly launch a browser when none is running.Proposal
Add an action that works only on an existing browser, for example
clipboard permission grant|reset <origin>, which:<origin>matches the active target's origin exactly;Browser.setPermissionwith{ name: "clipboard-read" },setting: "granted"(or"prompt"for reset), thatorigin, and the target'sbrowserContextId;We patched this locally along those lines and confirmed it with headless Chromium:
All reactions