chromium-devtools-mcp
v0.6.0MCP server that lets AI agents drive your Chromium browser through the DevTools Protocol
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_tabs
List tabs of the session or tabs available to claim.
| Parameter | Type | Description |
|---|---|---|
limit | integer | Maximum tabs to return. Defaults to 100. |
scope | string | Owned tabs or tabs available to claim. Defaults to owned. |
popup_list
List available popups opened by an owned tab, optionally waiting for IDs absent from a baseline.
| Parameter | Type | Description |
|---|---|---|
baselineIds | array | Previously observed popup IDs to exclude. Omit to list all available popups. |
tab | string | Opener tab id. Defaults to the selected tab. |
timeoutMs | integer | Maximum wait for a matching popup in milliseconds. Defaults to 0. |
window_list
List distinct windows containing tabs owned by this session without focusing them.
| Parameter | Type | Description |
|---|---|---|
limit | integer | Maximum windows to return. Defaults to 100. |
list_sessions
List open sessions of the daemon without their tab details.
select_tab
Select a tab of the session, claiming an available tab when needed.
| Parameter | Type | Description |
|---|---|---|
tab * | string | Tab id returned by the tab tools. |
new_tab
Open a new background tab and select it. With a url it waits until the page has loaded or timeoutMs passes, and returns the committed url, the load state reached and the document readyState.
| Parameter | Type | Description |
|---|---|---|
select | boolean | Select the new tab. Defaults to true. |
timeoutMs | integer | How long to wait for the page to load. Defaults to 30000 ms. |
url | string | URL to open: http, https or about:blank. Defaults to about:blank. |
tab_duplicate
Open the current address of an owned tab in a new background tab without copying its history or page state.
| Parameter | Type | Description |
|---|---|---|
select | boolean | Select the new tab. Defaults to false. |
tab | string | Source tab id. Defaults to the selected tab. |
timeoutMs | integer | Maximum load wait in milliseconds. |
close_tab
Close a tab opened by this session.
| Parameter | Type | Description |
|---|---|---|
tab | string | Tab id. Defaults to the selected tab. |
bring_to_front
Bring a tab and its window to the front and take the keyboard focus. Call it only when the user asked to see the tab. It works only when the owner enabled allowFocus.
| Parameter | Type | Description |
|---|---|---|
tab | string | Tab id. Defaults to the selected tab. |
page_info
Read the URL, title, viewport and scroll position of a tab.
| Parameter | Type | Description |
|---|---|---|
tab | string | Tab id. Defaults to the selected tab. |
page_history
List the recent navigation history of a tab with redacted addresses.
| Parameter | Type | Description |
|---|---|---|
limit | integer | Maximum number of entries. Defaults to 50. |
tab | string | Tab id. Defaults to the selected tab. |
browser_info
Read the version of the browser the session is connected to, for bug reports and for checking what a page runs on.
| Parameter | Type | Description |
|---|---|---|
tab | string | Tab id. Defaults to the selected tab. |
page_extract
Read links, headings, meta tags, tables and form structure of the top document without form values.
| Parameter | Type | Description |
|---|---|---|
kinds | array | What to read: links, headings, meta, forms, tables. Defaults to all five. |
limit | integer | Most items per kind. Defaults to 50, at most 200. |
tab | string | Tab id. Defaults to the selected tab. |
js_evaluate
Run JavaScript in a tab and return the result. Page exceptions come back as data, not as tool errors.
| Parameter | Type | Description |
|---|---|---|
expression * | string | JavaScript expression to evaluate. |
awaitPromise | boolean | Await a promise result. Defaults to true. |
maxResultChars | integer | Maximum characters of the returned value. Defaults to 50000. |
tab | string | Tab id. Defaults to the selected tab. |
target | object | Run the expression against an element. A function expression is called as is, anything else runs as the body of function (element) { ... }. Both receive the element as this and as the first argument. |
timeoutMs | integer | How long to wait for the result. Defaults to 10000 ms. |
dom_query
Find elements by a CSS selector and read their text, attributes and boxes. Total counts every match in the page; the text filter scans at most the first 2000 matches and pierce visits at most 20000 elements; truncated reports when more matches exist than returned or a cap applied.
| Parameter | Type | Description |
|---|---|---|
selector * | string | CSS selector to match. Use >>> to chain through shadow roots, for example my-app >>> #inner. |
all | boolean | Return up to limit matches instead of one. Defaults to false. |
attributes | array | Attribute names to include. |
frame | string | Frame id from dom_snapshot or an iframe CSS selector that matches exactly one iframe. Defaults to the main frame. |
includeBox | boolean | Include bounding boxes. Defaults to true. |
limit | integer | Maximum matches to return. Defaults to 20 with all and to 1 without it. |
pierce | boolean | Match through open shadow roots. Closed shadow roots need a >>> chain. Defaults to false. |
tab | string | Tab id. Defaults to the selected tab. |
text | string | Keep only elements whose text contains this, case insensitively. |
dom_snapshot
Read a compact text snapshot of the page with element ids for later calls. Take a new snapshot after the page changes. It reads at most 20000 accessibility nodes, at most 50 levels deep, and the DOM to 10 levels; truncated reports when a cap applied.
| Parameter | Type | Description |
|---|---|---|
includeHidden | boolean | Include hidden elements. Defaults to false. |
interactiveOnly | boolean | List interactive elements with ancestor context. Defaults to false. |
maxChars | integer | Maximum characters of the snapshot text. Defaults to 50000. |
maxFrames | integer | Maximum iframe contents to include. Defaults to 20. Frames beyond the limit are listed with omitted true. |
mode | string | Choose which page content to show. Defaults to all, or interactive when interactiveOnly is true. |
root | object | Limit the snapshot to the subtree of this element. |
tab | string | Tab id. Defaults to the selected tab. |
a11y_snapshot
List the accessibility tree of a tab as structured nodes with role, name, value and states, and count the controls that have no accessible name.
| Parameter | Type | Description |
|---|---|---|
includeHidden | boolean | Include hidden nodes. Defaults to false. |
interactiveOnly | boolean | List only interactive nodes such as buttons, links and fields. Defaults to false. |
maxNodes | integer | Maximum nodes to return, up to 2000. Defaults to 500. |
roles | array | List only nodes with one of these roles, for example heading or link. |
root | object | Limit the tree to the subtree of this element. |
tab | string | Tab id. Defaults to the selected tab. |
dom_selector
Turn an element into a CSS selector and a role locator that find it again, checked to match only that element.
| Parameter | Type | Description |
|---|---|---|
target * | object | Element uid from a snapshot or query, or any other target. |
tab | string | Tab id. Defaults to the selected tab. |
find_in_page
Find visible text in the top document of a tab, list where it is, and with scroll true bring one match to the middle of the view.
| Parameter | Type | Description |
|---|---|---|
text * | string | Text to find. A match lies inside one text node. |
caseSensitive | boolean | Match the case exactly. Defaults to false. |
index | integer | Which listed match to scroll to when scroll is true. Defaults to 0. |
maxMatches | integer | Most matches to list. Defaults to 10, at most 50. |
scroll | boolean | Scroll a match into view. Defaults to false, which changes nothing. |
tab | string | Tab id. Defaults to the selected tab. |
dom_edit
Edit one element without JavaScript: attributes, text, HTML, removal or classes. Returns the previous value for a revert.
| Parameter | Type | Description |
|---|---|---|
action * | string | What to do. |
target * | object | Element uid from a snapshot or query, or a CSS selector. |
className | string | Class token, for add_class, remove_class and toggle_class. |
html | string | HTML content, for set_html, up to 100000 characters. |
name | string | Attribute name, for set_attribute and remove_attribute. |
tab | string | Tab id. Defaults to the selected tab. |
text | string | Text content, for set_text, up to 20000 characters. |
value | string | Attribute value, for set_attribute, up to 20000 characters. |
css_inspect
Read the computed style, matched CSS rules and box of an element. The box is null for an element without a rendered box, such as display none.
| Parameter | Type | Description |
|---|---|---|
target * | object | Element uid from a snapshot or query, or a CSS selector. |
forceStates | array | Pseudo classes to apply to the element while it is read, for example hover or focus, so the computed style and the matched rules show that state. They are removed again before the call returns. |
includeBox | boolean | Include the box model. Defaults to true. |
includeMatchedRules | boolean | Include the matched CSS rules. Defaults to true. |
maxRules | integer | Maximum matched rules to return. Defaults to 30. |
properties | array | Computed style properties to return. Defaults to a curated layout and typography list. |
tab | string | Tab id. Defaults to the selected tab. |
event_listeners
Inspect the event listener types and options registered directly on an element.
| Parameter | Type | Description |
|---|---|---|
target * | object | Element uid, CSS selector or locator. |
limit | integer | Maximum listeners to return. Defaults to 100. |
tab | string | Tab id. Defaults to the selected tab. |
css_edit
Edit page styles without JavaScript: inline styles of one element, or rules in a page style tag. Returns the previous values for a revert.
| Parameter | Type | Description |
|---|---|---|
action * | string | What to do. |
target * | object | Element uid from a snapshot or query, or a CSS selector. For add_rule and remove_rule it selects the document, or the shadow root, that holds the rule. |
declarations | object | Property to value map, for set_style and add_rule. An empty value removes an inline property. |
ruleId | string | Rule id from add_rule, for remove_rule. |
selector | string | Rule selector, for add_rule. |
tab | string | Tab id. Defaults to the selected tab. |
console_logs
Read console messages, uncaught exceptions and browser messages of a tab. Only messages since capture started, plus what the browser replays.
| Parameter | Type | Description |
|---|---|---|
afterId | integer | Return entries after this id for paging. |
clear | boolean | Empty the buffer after reading. Defaults to false. |
levels | array | Keep only these severities. |
limit | integer | Maximum entries to return. Defaults to 100. |
order | string | Entry order. Defaults to oldest. |
tab | string | Tab id. Defaults to the selected tab. |
textContains | string | Keep only messages containing this text. |
network_requests
Read HTTP requests of a tab since network capture started. Sensitive query values and header values are replaced by [redacted].
| Parameter | Type | Description |
|---|---|---|
afterId | integer | Return records after this id for paging. |
clear | boolean | Empty the buffer after reading. Defaults to false. |
failedOnly | boolean | Keep only failed requests. |
includeHeaders | boolean | Include redacted request and response headers. Defaults to false. |
limit | integer | Maximum records to return. Defaults to 50. |
methods | array | Keep only these HTTP methods. |
resourceTypes | array | Keep only these CDP resource types. |
statusMax | integer | Keep only responses with at most this status. |
statusMin | integer | Keep only responses with at least this status. |
tab | string | Tab id. Defaults to the selected tab. |
urlContains | string | Keep only URLs containing this text. |
urlRegex | string | Keep only URLs matching this regular expression, up to 200 characters. A match that takes longer than 50 ms is stopped and fails the call. |
network_har
Save the HTTP requests of a tab as a HAR file that DevTools and other tools open, with redacted URLs and headers and no bodies.
| Parameter | Type | Description |
|---|---|---|
clear | boolean | Empty the network buffer of the tab after saving. Defaults to false. |
failedOnly | boolean | Keep only failed requests. |
methods | array | Keep only these HTTP methods. |
resourceTypes | array | Keep only these CDP resource types. |
statusMax | integer | Keep only responses with at most this status. |
statusMin | integer | Keep only responses with at least this status. |
tab | string | Tab id. Defaults to the selected tab. |
urlContains | string | Keep only URLs containing this text. |
urlRegex | string | Keep only URLs matching this regular expression. |
downloads
Let a tab save files it downloads into a private directory, then list them or wait for one to finish.
| Parameter | Type | Description |
|---|---|---|
action * | string | allow starts saving downloads of the tab, deny stops it, list shows them, wait returns the next finished download. |
id | string | With wait: wait for this download instead of the next one that finishes. |
tab | string | Tab id. Defaults to the selected tab. |
timeoutMs | integer | With wait: how long to wait, up to 120000 ms. Defaults to 30000. |
network_response_body
Read the response body of a request from network_requests. Binary bodies need asBase64.
| Parameter | Type | Description |
|---|---|---|
requestId * | integer | Record id from network_requests. |
asBase64 | boolean | Return binary content as base64. Defaults to false. |
maxChars | integer | Maximum characters of the returned body. Defaults to 50000. |
tab | string | Tab id. Defaults to the selected tab. |
network_mock
Mock network responses or fail requests of a tab by URL pattern. The first matching rule in insertion order wins.
| Parameter | Type | Description |
|---|---|---|
action * | string | What to do. |
id | string | Rule id, for the remove action. |
rule | object | Rule to add, for the add action. |
tab | string | Tab id. Defaults to the selected tab. |
page_dialogs
See and resolve JavaScript dialogs (alert, confirm, prompt, beforeunload) of a tab, or set an automatic policy.
| Parameter | Type | Description |
|---|---|---|
action | string | What to do. Defaults to status. |
policy | string | Automatic handling for dialogs that open later. Defaults to none and is cleared on reset. |
promptText | string | Text for a prompt, up to 10000 characters. |
tab | string | Tab id. Defaults to the selected tab. |
page_wait
Wait for a selector, text, URL, load state, a quiet document, a network response or an expression in a tab. A timeout is a result with met false, not an error. The expression condition runs arbitrary page JavaScript.
| Parameter | Type | Description |
|---|---|---|
domQuietMs | integer | Wait until the document has not changed for this many ms (child nodes, attributes and text, not inside shadow roots). Unlike a selector it needs no known element. |
expression | string | JavaScript expression that must become truthy. |
frame | string | Frame id from dom_snapshot to wait in. Only with a selector condition. Defaults to the main frame. |
includePrevious | boolean | With a response condition: also accept a response that was captured before the call. Defaults to false. |
loadState | string | Page load state to wait for. |
ms | integer | Plain sleep in ms, up to 60000. |
pierce | boolean | Match the selector through open shadow roots. Only with a selector condition. Defaults to false. |
pollMs | integer | Poll interval in ms. Defaults to 100. |
responseStatus | integer | With responseUrl or responseUrlRegex: the status the response must have. |
responseUrl | string | Wait for a network response whose URL contains this text, after the call starts. |
responseUrlRegex | string | Wait for a network response whose URL matches this regular expression, after the call starts. A match that takes longer than 50 ms is stopped and fails the call. |
selector | string | CSS selector to wait for. |
state | string | Selector state. Defaults to visible. |
tab | string | Tab id. Defaults to the selected tab. |
text | string | Substring of the visible page text to wait for. |
timeoutMs | integer | How long to wait. Defaults to 10000 ms. |
url | string | URL substring to wait for. |
urlRegex | string | URL regular expression to wait for, up to 200 characters. A match that takes longer than 50 ms is stopped and fails the call. |
storage_read
Read local storage, session storage or cookies of the page origin; the result lists keys and value sizes, and values are hidden unless you pass includeValues: true.
| Parameter | Type | Description |
|---|---|---|
kind * | string | What to read. |
includeValues | boolean | Include values. Defaults to false; pass true to read them. Cookie values are secrets. |
keys | array | Storage keys to read, for local and session. Defaults to all. |
maxEntries | integer | Maximum entries to return. Defaults to 100. |
maxValueChars | integer | Maximum characters per value. Defaults to 500. |
tab | string | Tab id. Defaults to the selected tab. |
storage_write
Write local storage, session storage or cookies of the page origin. Values are never echoed back.
| Parameter | Type | Description |
|---|---|---|
action * | string | What to do. |
kind * | string | What to write. |
confirm | boolean | Required true for clear. |
cookies | array | Cookies to set. |
entries | object | Entries to set, for local and session. At most 100. |
keys | array | Keys to remove, for local and session. |
remove | array | Cookies to remove. |
tab | string | Tab id. Defaults to the selected tab. |
page_pdf
Print a tab to PDF. Needs a headless managed browser when the headed browser refuses to print.
| Parameter | Type | Description |
|---|---|---|
landscape | boolean | Use landscape orientation. Defaults to false. |
margins | object | Margins in inches. Defaults to 0.4 on every side. |
maxBytes | integer | Maximum PDF bytes. Defaults to 8 MiB. |
pageRanges | string | Page ranges like 1-3,5. |
paperHeight | number | Paper height in inches. Defaults to A4. |
paperWidth | number | Paper width in inches. Defaults to A4. |
preferCSSPageSize | boolean | Prefer the CSS page size. Defaults to false. |
printBackground | boolean | Print background graphics. Defaults to true. |
scale | number | Scale factor. Defaults to 1. |
tab | string | Tab id. Defaults to the selected tab. |
page_metrics
Read performance counters, layout metrics and navigation timing of a tab.
| Parameter | Type | Description |
|---|---|---|
tab | string | Tab id. Defaults to the selected tab. |
perf_trace_start
Start recording a performance trace of a tab. Optionally reload the page so the whole load is recorded. Interact with the page, then call perf_trace_stop. Only one trace can record at a time in the browser.
| Parameter | Type | Description |
|---|---|---|
ignoreCache | boolean | With reload: ignore the cache. Defaults to false. |
reload | boolean | Reload the page once the trace has started, so the load is recorded. Defaults to false. |
tab | string | Tab id. Defaults to the selected tab. |
perf_trace_stop
Stop the trace of a tab, save it as a file that the Performance panel of Chrome DevTools opens, and report the Core Web Vitals, long tasks, main thread activity, requests and a rating of each. The file and the numbers keep the events of the frames of the tab and the address free events of its processes, not those of other tabs.
| Parameter | Type | Description |
|---|---|---|
tab | string | Tab id. Defaults to the selected tab. |
heap_snapshot
Take a heap snapshot of a tab and report what is in memory: the total, the size by kind of object, the biggest classes and the detached DOM nodes. The page freezes while the snapshot is taken. The snapshot file can be saved for you to open in the Memory panel of Chrome DevTools; the result never holds the contents of strings.
| Parameter | Type | Description |
|---|---|---|
collectGarbage | boolean | Run a garbage collection first, so only live objects are counted. Defaults to true. |
save | boolean | Save the snapshot as a .heapsnapshot file for the Memory panel of Chrome DevTools. Defaults to true. The file holds all the page memory, including secrets, so pass false to get the summary only. |
tab | string | Tab id. Defaults to the selected tab. |
topClasses | integer | How many classes to list, 1 to 50. Defaults to 15. |
screencast_start
Start recording what a tab shows as a series of frames. The tab keeps rendering in the background, no window is raised. Call screencast_stop to get the recording. A static page produces few frames because a frame is made only when the page changes.
| Parameter | Type | Description |
|---|---|---|
fps | integer | Frames per second at most, 1 to 30. Defaults to 10. |
maxDurationMs | integer | Stop recording after this many milliseconds, 1000 to 120000. Defaults to 30000. |
maxWidth | integer | Widest frame in pixels, larger pages are scaled down. Defaults to 1280. |
quality | integer | JPEG quality of the frames, 1 to 100. Defaults to 60. |
tab | string | Tab id. Defaults to the selected tab. |
screencast_stop
Stop the screencast of a tab and save it. With ffmpeg on the PATH of the server the result is an MP4 file, or WebM when the MP4 encoder is missing; without ffmpeg the frames are saved as JPEG files in a directory with their durations, and the result says how to get a video.
| Parameter | Type | Description |
|---|---|---|
tab | string | Tab id. Defaults to the selected tab. |
lighthouse_audit
Audit a page with the Lighthouse program installed on this machine and report the scores and the failed checks for accessibility, best practices and SEO (performance is optional; perf_trace_stop measures it better). It loads the page in a separate clean browser, so it sees the page as a new visitor without the logins of your tabs and does not touch your tabs. When Lighthouse is not installed the call fails and says what the user has to install.
| Parameter | Type | Description |
|---|---|---|
categories | array | What to audit. Defaults to accessibility, best-practices and seo. |
device | string | Screen and network to emulate. Defaults to desktop. |
tab | string | Tab id. Defaults to the selected tab. |
timeoutMs | integer | How long to wait for the audit, 10000 to 300000 ms. Defaults to 120000. |
url | string | Page to audit, http or https. Defaults to the page of the tab. |
webauthn
Test passkey and security key sign-in on a tab with a virtual authenticator: add one, let the page register and sign in, and list, add, remove or clear its credentials. Chrome lets a page use WebAuthn only on the tab that has the focus of the browser, and a tab in the background fails with 'The page does not have focus', so pass bringToFront with add_authenticator (it needs allowFocus) or call bring_to_front first. The private keys are never returned.
| Parameter | Type | Description |
|---|---|---|
action * | string | What to do. |
authenticatorId | string | The authenticator, from add_authenticator or list_authenticators. |
automaticPresence | boolean | add_authenticator: answer every touch prompt at once, as there is no one to touch the key. Defaults to true. |
bringToFront | boolean | add_authenticator: bring the tab to the front first, because WebAuthn needs its focus. Needs allowFocus. Defaults to false. |
credentialId | string | add_credential and remove_credential: the credential id as base64url, as in PublicKeyCredential.id. |
privateKey | string | add_credential: the private key as base64 of PKCS#8, an ECDSA P-256 key for the usual ES256 passkey. |
protocol | string | add_authenticator: ctap2 supports passkeys, u2f is the older security key. Defaults to ctap2. |
residentCredential | boolean | add_credential: whether it is a discoverable credential. Defaults to true. |
residentKey | boolean | add_authenticator: whether it stores discoverable credentials, which passkeys need. Defaults to true for ctap2; u2f cannot. |
rpId | string | add_credential: the relying party id, the domain of the site, such as example.com. |
signCount | integer | add_credential: the signature counter. Defaults to 0. |
tab | string | Tab id. Defaults to the selected tab. |
transport | string | add_authenticator: internal is a platform authenticator such as Touch ID, the others are security keys. Defaults to internal for ctap2 and usb for u2f. |
userDisplayName | string | add_credential: the display name shown with the passkey. |
userHandle | string | add_credential: the user handle as base64url. |
userName | string | add_credential: the user name shown with the passkey. |
userVerification | boolean | add_authenticator: whether it can verify the user, for example by PIN or fingerprint. Defaults to true for ctap2; u2f cannot. |
userVerified | boolean | add_authenticator and set_user_verified: whether the user passes the verification. Defaults to true. |
pwa_info
Read what a tab says about being an installable web app: its manifest, the app id, why Chrome would not offer to install it, and its service workers. It only reads: nothing is installed or launched.
| Parameter | Type | Description |
|---|---|---|
tab | string | Tab id. Defaults to the selected tab. |
screenshot
Capture a tab as an image. Defaults to jpeg quality 80 to keep outputs small; works on background tabs without focusing them.
| Parameter | Type | Description |
|---|---|---|
clip | object | Clip to this CSS rectangle in page coordinates measured from the document origin. Rejected together with target. |
format | string | Image format. Defaults to jpeg. |
fullPage | boolean | Capture beyond the viewport. Defaults to false. |
maskElements | array | Elements to cover in the image; inspect the result before sharing. |
maskPasswords | boolean | Cover password fields in the image. Dynamic page changes can still expose content. |
maxBytes | integer | Maximum image bytes. Defaults to 4 MiB. |
maxDimension | integer | Clamp the longest side to this many pixels. Defaults to 4096. |
quality | integer | Quality for jpeg and webp. Defaults to 80. |
scale | number | Scale factor. Defaults to 1. |
tab | string | Tab id. Defaults to the selected tab. |
target | object | Clip to this element after scrolling it into view. |
list_devices
List the built in devices for emulate_device, with an optional name or kind filter.
| Parameter | Type | Description |
|---|---|---|
kind | string | Keep only phones, tablets or desktops. |
query | string | Case insensitive substring filter on the name. |
emulate_device
Emulate a device size, pixel ratio, mobile viewport, touch and user agent on a tab. Reads back what the page reports. The Chrome version in a device user agent follows the connected browser. Client hints metadata is not emulated.
| Parameter | Type | Description |
|---|---|---|
device | string | Device name from list_devices, case insensitive. |
deviceScaleFactor | number | Explicit pixel ratio, 0.5 to 5. |
height | integer | Explicit CSS height, 100 to 10000. |
landscape | boolean | Swap width and height. Defaults to false. |
mobile | boolean | Explicit mobile viewport behavior. |
reset | boolean | Remove the device overrides of this tab. Defaults to false. |
tab | string | Tab id. Defaults to the selected tab. |
touch | boolean | Explicit touch emulation. |
userAgent | string | User agent for explicit emulation. Defaults to the real one. |
width | integer | Explicit CSS width, 100 to 10000. Needs height, deviceScaleFactor, mobile and touch. |
emulate_media
Emulate a media type and media features on a tab. Only the given fields change; reset removes every media override.
| Parameter | Type | Description |
|---|---|---|
colorScheme | string | Emulated prefers-color-scheme. |
contrast | string | Emulated prefers-contrast. |
forcedColors | string | Emulated forced-colors. |
media | string | Media type to emulate, empty clears the type. |
reducedMotion | string | Emulated prefers-reduced-motion. |
reset | boolean | Remove the media overrides of this tab. Defaults to false. |
tab | string | Tab id. Defaults to the selected tab. |
emulate_network
Emulate network conditions on a tab: offline, slow-3g (2000 ms, 400/400 Kbps), fast-3g (562 ms, 1600/750 Kbps), 4g (170 ms, 9000/9000 Kbps), wifi (28 ms, 30000/15000 Kbps) or none. Shares Network.enable with the capture manager, never disables capture.
| Parameter | Type | Description |
|---|---|---|
blockUrls | array | URL patterns to block with CDP wildcards, at most 50. |
downloadKbps | integer | Download ceiling in Kbps, at least 1, -1 disables throttling. 0 is rejected because it stalls the link. |
latencyMs | integer | Added latency in ms, 0 to 60000. |
offline | boolean | Emulate disconnection. Defaults to false. |
preset | string | Named conditions. none restores a normal connection and clears blocked URLs. |
reset | boolean | Restore a normal connection and clear blocked URLs. Defaults to false. |
tab | string | Tab id. Defaults to the selected tab. |
uploadKbps | integer | Upload ceiling in Kbps, at least 1, -1 disables throttling. 0 is rejected because it stalls the link. |
emulate_cpu
Request CPU throttling for a tab; the observed slowdown depends on the browser and workload.
| Parameter | Type | Description |
|---|---|---|
reset | boolean | Remove the CPU throttling override. Defaults to false. |
slowdown | number | Requested slowdown, from 1 to 20. 1 removes the override. |
tab | string | Tab id. Defaults to the selected tab. |
emulate_locale
Emulate locale, timezone and Accept-Language on a tab. Applies to new page loads: navigator.language changes after the next navigation, and number and date formatting follow the locale. Use emulate_geolocation for the location. reset restores the real locale and timezone.
| Parameter | Type | Description |
|---|---|---|
acceptLanguage | string | Accept-Language header value, printable ASCII. Merges with the device user agent. |
locale | string | BCP 47 tag such as de-DE. Merges with the previous timezone and accept language. |
reset | boolean | Remove the locale overrides of this tab. Defaults to false. |
tab | string | Tab id. Defaults to the selected tab. |
timezone | string | IANA name such as Europe/Berlin. |
emulate_geolocation
Emulate the geolocation of a tab and allow the page origin to read it, without a prompt. The page needs a secure context (https or localhost). Other tabs of the same origin in a shared browser read the real position while it is allowed. reset removes the override and the permission.
| Parameter | Type | Description |
|---|---|---|
accuracy | number | Accuracy in meters. Defaults to 10. |
latitude | number | Latitude in degrees, -90 to 90. |
longitude | number | Longitude in degrees, -180 to 180. |
origin | string | Origin to allow, such as https://example.com. Defaults to the origin of the tab. Pass it to set the location before the first navigation. |
reset | boolean | Remove the geolocation override and permission of this tab. Defaults to false. |
tab | string | Tab id. Defaults to the selected tab. |
permissions
Grant, deny or reset a browser permission for a specific origin in this session's browser context.
| Parameter | Type | Description |
|---|---|---|
name * | string | Permission to control. |
origin * | string | Exact http or https origin without a path. |
setting * | string | Override or release this session's override. |
click
Click an element at the DOM level with element.click() semantics, without moving the mouse.
| Parameter | Type | Description |
|---|---|---|
target * | object | Element uid from a snapshot or query, or a CSS selector. |
scrollIntoView | boolean | Scroll the element into view first. Defaults to true. |
tab | string | Tab id. Defaults to the selected tab. |
timeoutMs | integer | How long to wait, in milliseconds, for the element to be visible, enabled and not covered before refusing. Defaults to 2000; 0 does not wait. |
input_click
Click an element, or a point of the viewport given in CSS pixels (a pixel of a screenshot divided by its pixelRatio), with trusted CDP mouse events, like a real user, without focusing the window.
| Parameter | Type | Description |
|---|---|---|
button | string | Mouse button. Defaults to left. |
clickCount | integer | How many clicks in a row, 1 to 3. Defaults to 1. |
force | boolean | With target: skip the hit test and click through a covering element. Defaults to false. |
modifiers | array | Held modifiers, for example Control for a control click. |
point | object | Viewport point to click, for example read from a screenshot. Pass this or target. |
position | object | With target: offset in CSS pixels from the top left corner of the element. Defaults to the center. |
tab | string | Tab id. Defaults to the selected tab. |
target | object | Element uid from a snapshot or query, or a CSS selector. Pass this or point. |
timeoutMs | integer | How long to wait, in milliseconds, for the element to be visible, enabled and not covered before refusing. Defaults to 2000; 0 does not wait. |
input_hover
Hover an element with trusted CDP mouse events, so hover styles and menus react.
| Parameter | Type | Description |
|---|---|---|
target * | object | Element uid from a snapshot or query, or a CSS selector. |
force | boolean | Skip the hit test and hover through a covering element. Defaults to false. |
position | object | Offset in CSS pixels from the top left corner of the element. Defaults to the center. |
tab | string | Tab id. Defaults to the selected tab. |
timeoutMs | integer | How long to wait, in milliseconds, for the element to be visible, enabled and not covered before refusing. Defaults to 2000; 0 does not wait. |
input_drag
Drag from one element or viewport point to another and drop there, with trusted CDP mouse events. Works for pointer based drags and for HTML5 drag and drop.
| Parameter | Type | Description |
|---|---|---|
from * | Where to press: an element (uid or selector) or a viewport point {x, y} in CSS pixels. | |
to * | Where to release: an element (uid or selector) or a viewport point {x, y} in CSS pixels. | |
steps | integer | Mouse moves between the two ends, 1 to 50. Defaults to 8. |
tab | string | Tab id. Defaults to the selected tab. |
input_type
Type text into a field with trusted input events, focusing it first without clicking.
| Parameter | Type | Description |
|---|---|---|
text * | string | Text to type, up to 20000 characters. |
clear | boolean | Select all and delete in the field first. Defaults to false. |
delayMs | integer | Delay between characters in ms, 0 to 200. With 0 the text is inserted at once. delayMs times the text length must not exceed 60000 ms. Defaults to 0. |
submit | boolean | Press Enter after typing. Defaults to false. |
tab | string | Tab id. Defaults to the selected tab. |
target | object | Element uid from a snapshot or query, or a CSS selector. Omit to type into the focused element. |
timeoutMs | integer | How long to wait, in milliseconds, for the element to be visible, enabled and not covered before refusing. Defaults to 2000; 0 does not wait. |
input_key
Press a key or chord like Enter or ControlOrMeta+C with trusted CDP key events.
| Parameter | Type | Description |
|---|---|---|
key * | string | Key or chord, for example Enter, Tab, Control+A, ControlOrMeta+C, Shift++ (a trailing plus names the plus key). |
repeat | integer | How many times to press, 1 to 20. Modifiers are held across repeats. Defaults to 1. |
tab | string | Tab id. Defaults to the selected tab. |
target | object | Element uid from a snapshot or query, or a CSS selector. The element is focused first; omit to press into the focused element. |
timeoutMs | integer | How long to wait, in milliseconds, for the element to be visible, enabled and not covered before refusing. Defaults to 2000; 0 does not wait. |
input_scroll
Scroll the page by wheel deltas, to an edge, or an element into view, with trusted wheel events.
| Parameter | Type | Description |
|---|---|---|
at | object | Point where the wheel turns. Defaults to the viewport center. |
block | string | Vertical alignment inside the viewport when scrolling to an element. Defaults to center. |
deltaX | integer | Horizontal pixels to scroll, negative scrolls left. |
deltaY | integer | Vertical pixels to scroll, negative scrolls up. |
tab | string | Tab id. Defaults to the selected tab. |
target | object | Element uid from a snapshot or query, or a CSS selector. Scrolls it into view; combine with block. |
to | string | Scroll to the top or the bottom of the page. |
input_select
Choose options of a select element by value, label or index, firing input and change.
| Parameter | Type | Description |
|---|---|---|
target * | object | Element uid from a snapshot or query, or a CSS selector. Must resolve to a select. |
indexes | array | Option indexes to select, exactly one of values, labels or indexes. |
labels | array | Visible option labels to select, exactly one of values, labels or indexes. |
tab | string | Tab id. Defaults to the selected tab. |
timeoutMs | integer | How long to wait, in milliseconds, for the element to be visible, enabled and not covered before refusing. Defaults to 2000; 0 does not wait. |
values | array | Option values to select, exactly one of values, labels or indexes. |
input_upload
Attach local files to a file input. The most sensitive input tool: it sends local files to a web page.
| Parameter | Type | Description |
|---|---|---|
files * | array | Absolute local paths to attach, at most 20. Each must be a readable file under 100 MiB. |
target * | object | Element uid from a snapshot or query, or a CSS selector. Must resolve to an input of type file. |
tab | string | Tab id. Defaults to the selected tab. |
fill_form
Fill several form fields in one call, in order: text and textarea fields, selects, checkboxes and radio buttons. Stops at the first field that fails and says which fields were filled.
| Parameter | Type | Description |
|---|---|---|
fields * | array | Fields to fill, 1 to 30. |
tab | string | Tab id. Defaults to the selected tab. |
timeoutMs | integer | How long to wait, in milliseconds, for the element to be visible, enabled and not covered before refusing. Defaults to 2000; 0 does not wait. |