Skip to content

Report non-scriptable pages the same way (AGE-259) - #256

Merged
cursor[bot] merged 1 commit into
mainfrom
cursor/age-259-restricted-page-reporting-555d
Oct 27, 2026
Merged

cursor[bot] merged 1 commit into
mainfrom
cursor/age-259-restricted-page-reporting-555d

Conversation

@tedjames

Copy link
Copy Markdown
Member

Summary

Agents that land on a page the extension cannot script now get one shared result instead of a generic "only http(s)" or an empty log.

The fields, for navigation errors, page info, and each tab in listBrowserTabs:

  • access: "metadata-only"
  • message: "metadata only, can't read or act"
  • scriptable: false
  • kind: chrome, devtools, view-source, web-store, pdf, extension, or browser
  • detail: one sentence naming the page

AGE-584's tab list and background navigate can import restrictedPage / restrictedPageFields from browser-tools-mcp/src/restricted-page.ts and keep this wording.

Covered pages: chrome:// (and chrome-error://, chrome-untrusted://), devtools://, view-source:, the Chrome Web Store (chromewebstore.google.com and chrome.google.com/webstore), extension pages, the built-in PDF viewer (Chromium id mhjfbmdgcfjbbpaeojofohoefgiehjai and *.pdf), plus edge://, brave://, and similar browser pages. about:blank stays scriptable.

Behavior:

  • Navigation to those pages is refused before the browser is asked, with the JSON above. Tool text is that JSON (MCP clients validate structuredContent against the success schema, so the object is in the text). The local API returns HTTP 422 RESTRICTED_PAGE with the same fields.
  • An http(s) PDF can still load. The result then says the tab moved (navigated: true) and the viewer cannot be scripted.
  • A tab already on one of these pages can still be navigated to an allowed http(s) URL.
  • Screenshot, storage, selected element, refresh, console, network, and audits on that tab return the same result instead of an empty success. Chrome's own "Cannot access contents of url devtools://…" is translated into it.
  • getPageInfo and listBrowserTabs stay successful and include the fields, because listing the page is the metadata that is allowed.

No version bump, no npm publish, no Vitest change.

Tests

npm test (unit + integration): 36 files, 573 tests passed.

  • browser-tools-mcp/test/unit/restricted-page.test.ts — classification and the shared error object
  • browser-tools-mcp/test/unit/capability-gates.test.ts — leave a chrome:// tab; still refuse acting on it
  • browser-tools-mcp/test/integration/restricted-page.test.ts — connector, local API, HTTP client, MCP tools, and the CLI invoke path
  • Updated capture and audit assertions in connector-flow and connector-security
Open in Web Open in Cursor 

chrome://, DevTools, view-source, the Chrome Web Store, extension pages,
and the PDF viewer now return access "metadata-only" and the wording
"metadata only, can't read or act", so agents stop treating those pages
as scriptable. An http(s) PDF can still load and is reported after.

Co-authored-by: werbel.ted <werbel.ted@gmail.com>
@cursor
cursor Bot force-pushed the cursor/age-259-restricted-page-reporting-555d branch from f94daae to a46d3e2 Compare October 27, 2026 04:34
@cursor
cursor Bot merged commit 15d6444 into main Oct 27, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants