configure_session
Reads or updates a browser session's stealth, humanized input, CPU/network throttling, and init scripts, applying only specified fields while validating values and returning resulting settings.
Instructions
Read or change a session's settings: stealth, humanized input, CPU and network throttling, and init scripts. With only sessionId it changes nothing and returns every setting (a new session has stealth off, humanize on unless open_browser_session turned it off, no throttling and no init scripts). With any other field it applies just those fields, keeps the rest, and returns the settings that result. Every field is checked before anything changes, so a bad value changes nothing and the error names the field. Settings apply to every tab of the session, open now or opened later (popups included), until changed or the session closes.
Stealth: stealth: true disables the CDP Runtime domain (removes the Runtime.enable automation tell that anti-bot systems like Cloudflare detect); load and navigate pages in this mode to pass CDP-based bot gates. The cost is no console capture, and evaluate runs in an isolated world (can't read page globals like window.dataLayer). stealth: false brings both back, with the CDP tell. Typical flow: stealth true, navigate, stealth false, evaluate. Leave it off for sites without bot detection, and read it before evaluate or list_console_messages, whose behavior it changes.
Throttling measures a page as a slow phone or connection sees it (load time, hydration, layout shift, flaky taps); it is in place when this returns, so navigate right after. Typical mid-range phone: cpuThrottlingRate 4 with network "slow4g" and useMobileUA on open_browser_session. cpuThrottlingRate 1 and network "off" stop throttling.
Init scripts run JavaScript at the start of every page load, before any of the page's own scripts, in the page's main world (the page sees what they define). Use them to record timings or DOM changes from the very first moment of a load (a MutationObserver, PerformanceObserver or console hook writing to a window global you read later with evaluate), or to stub an API before the page uses it. They take effect from each tab's next navigation, not the page already loaded. addInitScripts returns their ids in addedInitScripts; removeInitScripts takes ids from initScripts, and fails on an id the session doesn't have. Throttling and init scripts need the listener role, and fail if no tab confirms within 5s.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sessionId": "<sessionId>"
},
"name": "configure_session"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| network | No | A preset ("slow3g", "slow4g", "fast4g" as in Chrome DevTools, "offline", or "off" for none) or custom {latencyMs, downloadKbps, uploadKbps}. | |
| stealth | No | true turns stealth on, false turns it off. | |
| humanize | No | true makes input look human (curved cursor paths, a typing rhythm, wheel scrolling; a click takes about half a second), false makes it instant. On by default. | |
| sessionId | Yes | The id returned by open_browser_session. Errors if no open session has it. | |
| addInitScripts | No | Init scripts to add, each { source }: the JavaScript to run, as a script body (not a function). | |
| cpuThrottlingRate | No | CPU slowdown factor from 1 (none) to 100. 4 is a mid-range phone, 6 a low-end one. | |
| removeInitScripts | No | Ids of init scripts to remove, from `initScripts`. Pages already loaded keep what they did. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| network | Yes | Network throttling; null means none. | |
| stealth | Yes | Whether stealth is on: no CDP Runtime domain, so no console capture and `evaluate` in an isolated world. | |
| humanize | Yes | Whether input is humanized: curved cursor paths, a typing rhythm and wheel scrolling. | |
| initScripts | Yes | ||
| addedInitScripts | No | Ids of the init scripts this call added, in the order given. | |
| cpuThrottlingRate | Yes | CPU slowdown factor; 1 means none. |