Skip to content
Last updated • May 2026

Chrome DevTools Access. The browser's deepest layer, gated.

Chrome DevTools Access lets a script you have installed use the Chrome DevTools Protocol on the pages it already matches: read network responses including cross-origin iframes, send genuinely-trusted input to canvas apps that ignore synthetic events, rewrite requests mid-flight, set breakpoints, or capture full-page screenshots. It is the most powerful capability Customaise exposes, so it is fenced behind a switch you control. You or your AI agent build the script; Customaise exposes the capability and gates it.

Key takeaways

  • CM_devtools gives an installed script the Chrome DevTools Protocol on its matched pages, the same protocol the DevTools panel runs on.
  • Reach for it only when the DOM, CM_findElement, and fetch fall short: network bodies across cross-origin iframes, trusted input for canvas apps, mid-flight request rewriting, breakpoints, or full-page screenshots.
  • CDP is tab-scoped, so its events fire across every frame including cross-origin iframes; that reach is usually the reason to use it.
  • It is off by default and resets every Chrome restart. A script must declare @grant CM_devtools plus a written @devtools-justification you read before installing.
  • Chrome shows its own banner for the whole session, one switch ends every session at once, and every session is recorded to a local audit log. Your AI agent reads the full reference over MCP.

One protocol. Four things the page cannot do alone.

The Chrome DevTools Protocol reaches past the page's own JavaScript sandbox.

Observe

Network across every frame

Read request and response bodies for the whole tab, including cross-origin iframes the page itself cannot reach with fetch.

Act

Genuinely-trusted input

Drive canvas-based apps (spreadsheets, design tools, browser games) that ignore synthetic JavaScript events.

Intercept

Mid-flight requests and breakpoints

Rewrite a request as it goes out, or pause at a function to understand a page before automating it.

Capture

Full-page screenshots

Capture an entire scrollable page in one image, or any tab, without bringing it to the front.

Use it sparingly

Reach for the simplest tool that works

Most scripts never need CDP. The DOM, CM_findElement for resilient targeting, and fetch interception cover the vast majority of work, with no banner and no toggle. Turn to CM_devtools only when those genuinely fall short.

What you needReach for
Read or change content that is on the pageThe DOM
Target an element reliably across redesignsCM_findElement
Same-origin requests, or allow-listed cross-originfetch / GM_xmlhttpRequest
Network bodies inside a cross-origin iframeCM_devtools
Input a canvas app accepts as realCM_devtools
Change a request while it is in flightCM_devtools
A full-page or any-tab screenshotCM_devtools
Behavior to know

Four things CDP does differently

CDP is tab-scoped, not frame-scoped.

Network and DOM events fire across every frame in the tab, including cross-origin iframes the page cannot reach itself. That reach is usually why you are here.

@connect does not gate CDP.

Your @connect allowlist applies to GM_xmlhttpRequest, not to CDP. Your justification should reflect what your CDP code actually reads or changes cross-origin.

Acquire inside the function that uses it, release before returning.

Do not hold a session across page changes. Cross-origin navigation auto-detaches, and idle sessions detach after a short window. CM_withDevtools makes the lifecycle obvious.

Cancel locks the tab.

If the user clicks Cancel on Chrome's banner, re-attach is refused for about five minutes or until the tab reloads.

Safety model

Turning it on, and the guardrails

Installing a script that declares the grant does not give it access. You enable the capability yourself, per session, under Settings → Scripts → Chrome DevTools Access. It is off by default and resets every Chrome restart, so the capability never quietly accumulates trust over time.

  • A script must declare // @grant CM_devtools and a written // @devtools-justification (80 to 500 characters) explaining why it needs it. You see that justification before you install, and on the script row afterward.
  • The Chrome DevTools Access switch is off until you turn it on, and resets on every Chrome restart.
  • Chrome shows its own yellow banner the whole time a script holds a session. Click Cancel on it to stop, which locks the tab against re-attaching for about five minutes.
  • One switch ends every active session at once. Turning the capability off tears down anything live immediately.
  • Every session is written to a local audit log that never leaves your device.
  • Marketplace scripts that use it are reviewed before they are listed.
Build it

Anatomy of a CM_devtools script

Declare the grant and the justification in the metadata header, then acquire a session, do your work, and release it. The scoped helper CM_withDevtools acquires and releases for you, even if your code throws. In an AgentScript, the same call goes inside a tool's execute body.

// @grant                   CM_devtools
// @devtools-justification  Reads the page's GraphQL responses to expose
//                          order data as a tool; CDP is needed because the
//                          calls live in a cross-origin iframe.

// Scoped session: auto-acquires, auto-releases (even on throw).
const requests = await CM_withDevtools(async (dt) => {
  await dt.send('Network.enable');
  const seen = [];
  const off = dt.on('Network.requestWillBeSent', (p) => {
    seen.push({ method: p.request.method, url: p.request.url });
  });
  // dt.on returns synchronously; give the subscription a beat to land.
  await new Promise((r) => setTimeout(r, 50));
  triggerTheActionYouWantToCapture();
  await new Promise((r) => setTimeout(r, 3000));
  off();
  return seen;
});

CDP method names come from the official DevTools Protocol reference. Customaise does not wrap or rename them; you call the protocol directly. Calls throw an Error with a .code you branch on, such as DEVTOOLS_DISABLED_BY_USER (the toggle is off) or DEBUGGER_BUSY (the DevTools panel is already open); your AI agent has the full set from the conventions.

Or just ask your AI agent

Customaise ships this whole reference to your AI agent over MCP, the same conventions an agent reads before building any script. Cursor, Claude Code, Codex, and other connected agents already know the grant, the session lifecycle, the usage patterns, and the full error-code table. Describe what you want captured or automated, and let the agent build the script. You review it and turn the capability on.

How Customaise MCP works
Same engine

Screenshots of any tab

The same Chrome debugger that powers CM_devtools also powers screenshots. Ask the agent in your IDE to screenshot a page and it can capture any open tab, not only the one in front, and return a full-page image of the whole scrollable page rather than just the visible part.

Because it attaches to a specific tab rather than the focused window, the capture never pulls a background tab to the front or takes focus from whatever you are doing. As with any debugger use, Chrome's yellow banner appears for the moment of capture and clears as soon as it finishes.

Frequently asked

It is gated in depth. The control is off by default and resets every time you restart Chrome, so nothing uses it until you actively turn it on for that session. Only a script that declares @grant CM_devtools can reach it, and that grant requires a written justification you can read before installing. While a session is held, Chrome shows its own yellow "is debugging this browser" banner that a script cannot fake or hide, and a single switch ends every active session immediately. Every session is recorded to a local audit log on your device.

That banner is Chrome's standard notice that something is using the debugger on the tab. Customaise does not draw it and cannot suppress it, which is exactly why it is trustworthy: it appears for the whole time a session is held and clears the moment the session ends. You can click Cancel on it to stop the session yourself; doing so locks that tab against re-attaching for about five minutes, and reloading the tab clears the lock.

Same protocol. When you press F12 you are driving the Chrome DevTools Protocol by hand; CM_devtools lets a script you enabled drive the same protocol programmatically on the pages it matches. Because a tab can only have one debugger client at a time, you cannot have F12 DevTools open and a CM_devtools session running on the same tab at once (a call returns DEBUGGER_BUSY until you close DevTools).

Only if you have allowed Customaise in Incognito at chrome://extensions. Without that, a CM_devtools call on an Incognito tab returns DEBUGGER_NO_INCOGNITO_ACCESS and nothing attaches.

Yes, and that is the intended path. Customaise ships the full CM_devtools reference to your agent over MCP (the same conventions an agent reads before building any script), so Cursor, Claude Code, Codex, or any connected agent already knows the grant, the lifecycle, the usage patterns, and the error codes. Describe what you want captured or automated and let the agent write the script; you review it and turn the capability on.

Building, installing, and running a CM_devtools script is part of the free Customaise extension. The only paid line is the MCP Server bridge to your IDE, which is free up to a daily and weekly cap and unlimited on Power User; that cap counts agent tool calls, not whether a script may use CDP.

AgentScripts

User-built WebMCP tools your AI agent calls on the sites you already use.

Read more

UserScripts

Reshape any site with a small script, written from a sentence.

Read more

Customaise MCP

Connect your IDE agent to your real, signed-in browser session.

Read more

See Customaise in action

How it all fits together: AI editing, the MCP bridge, cross-device sync, and the built-in browser tools.

See how it works

Give your scripts the deepest layer.

Add Customaise to Chrome, then build a CM_devtools script yourself or ask your AI agent to. You stay in control of the switch.