# Scrapfly Documentation

## Table of Contents

### Dashboard

- [Intro](https://scrapfly.io/docs)
- [Project](https://scrapfly.io/docs/project)
- [Account](https://scrapfly.io/docs/account)
- [Workspace & Team](https://scrapfly.io/docs/workspace-and-team)
- [Billing](https://scrapfly.io/docs/billing)

### Products

#### MCP Server

- [Getting Started](https://scrapfly.io/docs/mcp/getting-started)
- [Tools & API Spec](https://scrapfly.io/docs/mcp/tools)
- [Authentication](https://scrapfly.io/docs/mcp/authentication)
- [Examples & Use Cases](https://scrapfly.io/docs/mcp/examples)
- [FAQ](https://scrapfly.io/docs/mcp/faq)
##### Integrations

- [Overview](https://scrapfly.io/docs/mcp/integrations)
- [Claude Desktop](https://scrapfly.io/docs/mcp/integrations/claude-desktop)
- [Claude Code](https://scrapfly.io/docs/mcp/integrations/claude-code)
- [ChatGPT](https://scrapfly.io/docs/mcp/integrations/chatgpt)
- [Cursor](https://scrapfly.io/docs/mcp/integrations/cursor)
- [Cline](https://scrapfly.io/docs/mcp/integrations/cline)
- [Windsurf](https://scrapfly.io/docs/mcp/integrations/windsurf)
- [Zed](https://scrapfly.io/docs/mcp/integrations/zed)
- [Roo Code](https://scrapfly.io/docs/mcp/integrations/roo-code)
- [VS Code](https://scrapfly.io/docs/mcp/integrations/vscode)
- [LangChain](https://scrapfly.io/docs/mcp/integrations/langchain)
- [LlamaIndex](https://scrapfly.io/docs/mcp/integrations/llamaindex)
- [CrewAI](https://scrapfly.io/docs/mcp/integrations/crewai)
- [OpenAI](https://scrapfly.io/docs/mcp/integrations/openai)
- [n8n](https://scrapfly.io/docs/mcp/integrations/n8n)
- [Make](https://scrapfly.io/docs/mcp/integrations/make)
- [Zapier](https://scrapfly.io/docs/mcp/integrations/zapier)
- [Vapi AI](https://scrapfly.io/docs/mcp/integrations/vapi)
- [Agent Builder](https://scrapfly.io/docs/mcp/integrations/agent-builder)
- [Custom Client](https://scrapfly.io/docs/mcp/integrations/custom-client)


#### Web Scraping API

- [Getting Started](https://scrapfly.io/docs/scrape-api/getting-started)
- [API Specification]()
- [Monitoring](https://scrapfly.io/docs/monitoring)
- [Customize Request](https://scrapfly.io/docs/scrape-api/custom)
- [Debug](https://scrapfly.io/docs/scrape-api/debug)
- [Anti Scraping Protection](https://scrapfly.io/docs/scrape-api/anti-scraping-protection)
- [Proxy](https://scrapfly.io/docs/scrape-api/proxy)
- [Proxy Mode](https://scrapfly.io/docs/scrape-api/proxy-mode)
- [Proxy Mode - Screaming Frog](https://scrapfly.io/docs/scrape-api/proxy-mode/screaming-frog)
- [Proxy Mode - Apify](https://scrapfly.io/docs/scrape-api/proxy-mode/apify)
- [(Auto) Data Extraction](https://scrapfly.io/docs/scrape-api/extraction)
- [Javascript Rendering](https://scrapfly.io/docs/scrape-api/javascript-rendering)
- [Javascript Scenario](https://scrapfly.io/docs/scrape-api/javascript-scenario)
- [SSL](https://scrapfly.io/docs/scrape-api/ssl)
- [DNS](https://scrapfly.io/docs/scrape-api/dns)
- [Cache](https://scrapfly.io/docs/scrape-api/cache)
- [Session](https://scrapfly.io/docs/scrape-api/session)
- [Webhook](https://scrapfly.io/docs/scrape-api/webhook)
- [Screenshot](https://scrapfly.io/docs/scrape-api/screenshot)
- [Errors](https://scrapfly.io/docs/scrape-api/errors)
- [Timeout](https://scrapfly.io/docs/scrape-api/understand-timeout)
- [Throttling](https://scrapfly.io/docs/throttling)
- [Troubleshoot](https://scrapfly.io/docs/scrape-api/troubleshoot)
- [Billing](https://scrapfly.io/docs/scrape-api/billing)
- [FAQ](https://scrapfly.io/docs/scrape-api/faq)

#### Crawler API

- [Getting Started](https://scrapfly.io/docs/crawler-api/getting-started)
- [API Specification]()
- [Retrieving Results](https://scrapfly.io/docs/crawler-api/results)
- [WARC Format](https://scrapfly.io/docs/crawler-api/warc-format)
- [Data Extraction](https://scrapfly.io/docs/crawler-api/extraction-rules)
- [Webhook](https://scrapfly.io/docs/crawler-api/webhook)
- [Billing](https://scrapfly.io/docs/crawler-api/billing)
- [Errors](https://scrapfly.io/docs/crawler-api/errors)
- [Troubleshoot](https://scrapfly.io/docs/crawler-api/troubleshoot)
- [FAQ](https://scrapfly.io/docs/crawler-api/faq)

#### Screenshot API

- [Getting Started](https://scrapfly.io/docs/screenshot-api/getting-started)
- [API Specification]()
- [Accessibility Testing](https://scrapfly.io/docs/screenshot-api/accessibility)
- [Webhook](https://scrapfly.io/docs/screenshot-api/webhook)
- [Billing](https://scrapfly.io/docs/screenshot-api/billing)
- [Errors](https://scrapfly.io/docs/screenshot-api/errors)

#### Extraction API

- [Getting Started](https://scrapfly.io/docs/extraction-api/getting-started)
- [API Specification]()
- [Rules Template](https://scrapfly.io/docs/extraction-api/rules-and-template)
- [LLM Extraction](https://scrapfly.io/docs/extraction-api/llm-prompt)
- [AI Auto Extraction](https://scrapfly.io/docs/extraction-api/automatic-ai)
- [Webhook](https://scrapfly.io/docs/extraction-api/webhook)
- [Billing](https://scrapfly.io/docs/extraction-api/billing)
- [Errors](https://scrapfly.io/docs/extraction-api/errors)
- [FAQ](https://scrapfly.io/docs/extraction-api/faq)

#### Proxy Saver

- [Getting Started](https://scrapfly.io/docs/proxy-saver/getting-started)
- [Fingerprints](https://scrapfly.io/docs/proxy-saver/fingerprints)
- [Optimizations](https://scrapfly.io/docs/proxy-saver/optimizations)
- [SSL Certificates](https://scrapfly.io/docs/proxy-saver/certificates)
- [Protocols](https://scrapfly.io/docs/proxy-saver/protocols)
- [Pacfile](https://scrapfly.io/docs/proxy-saver/pacfile)
- [Secure Credentials](https://scrapfly.io/docs/proxy-saver/security)
- [Billing](https://scrapfly.io/docs/proxy-saver/billing)

#### Cloud Browser API

- [Getting Started](https://scrapfly.io/docs/cloud-browser-api/getting-started)
- [Proxy & Geo-Targeting](https://scrapfly.io/docs/cloud-browser-api/proxy)
- [Unblock API](https://scrapfly.io/docs/cloud-browser-api/unblock)
- [File Downloads](https://scrapfly.io/docs/cloud-browser-api/file-downloads)
- [Session Resume](https://scrapfly.io/docs/cloud-browser-api/session-resume)
- [Human-in-the-Loop](https://scrapfly.io/docs/cloud-browser-api/human-in-the-loop)
- [Debug Mode](https://scrapfly.io/docs/cloud-browser-api/debug-mode)
- [Bring Your Own Proxy](https://scrapfly.io/docs/cloud-browser-api/bring-your-own-proxy)
- [Browser Extensions](https://scrapfly.io/docs/cloud-browser-api/extensions)
- [Native Browser MCP](https://scrapfly.io/docs/cloud-browser-api/mcp)
- [DevTools Protocol](https://scrapfly.io/docs/cloud-browser-api/cdp-reference)
##### Integrations

- [Puppeteer](https://scrapfly.io/docs/cloud-browser-api/puppeteer)
- [Playwright](https://scrapfly.io/docs/cloud-browser-api/playwright)
- [Selenium](https://scrapfly.io/docs/cloud-browser-api/selenium)
- [Vercel Agent Browser](https://scrapfly.io/docs/cloud-browser-api/agent-browser)
- [Browser Use](https://scrapfly.io/docs/cloud-browser-api/browser-use)
- [Stagehand](https://scrapfly.io/docs/cloud-browser-api/stagehand)

- [Billing](https://scrapfly.io/docs/cloud-browser-api/billing)
- [Errors](https://scrapfly.io/docs/cloud-browser-api/errors)


### Tools

- [Antibot Detector](https://scrapfly.io/docs/tools/antibot-detector)

### SDK

- [Golang](https://scrapfly.io/docs/sdk/golang)
- [Python](https://scrapfly.io/docs/sdk/python)
- [Rust](https://scrapfly.io/docs/sdk/rust)
- [TypeScript](https://scrapfly.io/docs/sdk/typescript)
- [Scrapy](https://scrapfly.io/docs/sdk/scrapy)

### Integrations

- [Getting Started](https://scrapfly.io/docs/integration/getting-started)
- [LangChain](https://scrapfly.io/docs/integration/langchain)
- [LlamaIndex](https://scrapfly.io/docs/integration/llamaindex)
- [CrewAI](https://scrapfly.io/docs/integration/crewai)
- [Zapier](https://scrapfly.io/docs/integration/zapier)
- [Make](https://scrapfly.io/docs/integration/make)
- [n8n](https://scrapfly.io/docs/integration/n8n)

### Academy

- [Overview](https://scrapfly.io/academy)
- [Web Scraping Overview](https://scrapfly.io/academy/scraping-overview)
- [Tools](https://scrapfly.io/academy/tools-overview)
- [Reverse Engineering](https://scrapfly.io/academy/reverse-engineering)
- [Static Scraping](https://scrapfly.io/academy/static-scraping)
- [HTML Parsing](https://scrapfly.io/academy/html-parsing)
- [Dynamic Scraping](https://scrapfly.io/academy/dynamic-scraping)
- [Hidden API Scraping](https://scrapfly.io/academy/hidden-api-scraping)
- [Headless Browsers](https://scrapfly.io/academy/headless-browsers)
- [Hidden Web Data](https://scrapfly.io/academy/hidden-web-data)
- [JSON Parsing](https://scrapfly.io/academy/json-parsing)
- [Data Processing](https://scrapfly.io/academy/data-processing)
- [Scaling](https://scrapfly.io/academy/scaling)
- [Walkthrough Summary](https://scrapfly.io/academy/walkthrough-summary)
- [Scraper Blocking](https://scrapfly.io/academy/scraper-blocking)
- [Proxies](https://scrapfly.io/academy/proxies)

---

 1. [DevTools Protocol](https://scrapfly.io/docs/cloud-browser-api/cdp-reference)
2. DOM
 
  # DOM

 

This domain exposes DOM read/write operations. Each DOM Node is represented with its mirror object that has an `id`. This `id` can be used to get additional information on the Node, resolve it into the JavaScript object wrapper, etc. It is important that client receives DOM events only for the nodes that are known to the client. Backend keeps track of the nodes that were sent to the client and never sends the same node twice. It is client's responsibility to collect information about the nodes that were sent to the client. Note that `iframe` owner elements will return corresponding document elements as their child nodes.

**Dependencies:** [Runtime](https://scrapfly.io/docs/cloud-browser-api/cdp-reference/Runtime)

 - [Commands (53)](#commands)
- [Events (19)](#events)
- [Types (18)](#types)
 
   

No symbols match your filter.

## Commands

#### `DOM.collectClassNamesFromSubtree`

 Experimental 

Collects class names for the node with given id and all of it's child nodes.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the node to collect class names. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `classNames` | `array<<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-string">string</a>>` | Class name list. |

 

 

 

#### `DOM.copyTo`

 Experimental 

Creates a deep copy of the specified node and places it into the target container before the
given anchor.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the node to copy. |
| `targetNodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the element to drop the copy into. |
| `insertBeforeNodeId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Drop the copy before this node (if absent, the copy becomes the last child of `targetNodeId`). |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the node clone. |

 

 

 

#### `DOM.describeNode`

 

Describes node given its id, does not require domain to be enabled. Does not start tracking any
objects, can be used for automation.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Identifier of the node. |
| `backendNodeId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-BackendNodeId">BackendNodeId</a>` | Identifier of the backend node. |
| `objectId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObjectId">Runtime.RemoteObjectId</a>` | JavaScript object id of the node wrapper. |
| `depth`  (optional) | `integer` | The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0. |
| `pierce`  (optional) | `boolean` | Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false). |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `node` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-Node">Node</a>` | Node description. |

 

 

 

#### `DOM.scrollIntoViewIfNeeded`

 

Scrolls the specified rect of the given node into view if not already visible.
Note: exactly one between nodeId, backendNodeId and objectId should be passed
to identify the node.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Identifier of the node. |
| `backendNodeId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-BackendNodeId">BackendNodeId</a>` | Identifier of the backend node. |
| `objectId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObjectId">Runtime.RemoteObjectId</a>` | JavaScript object id of the node wrapper. |
| `rect`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-Rect">Rect</a>` | The rect to be scrolled into view, relative to the node's border box, in CSS pixels. When omitted, center of the node will be used, similar to Element.scrollIntoView. |

 

 

 

#### `DOM.disable`

 

Disables DOM agent for the given page.

 

 

#### `DOM.discardSearchResults`

 Experimental 

Discards search results from the session with the given id. `getSearchResults` should no longer
be called for that search.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `searchId` | `string` | Unique search session identifier. |

 

 

 

#### `DOM.enable`

 

Enables DOM agent for the given page.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `includeWhitespace`  (optional) Experimental | `string` | Whether to include whitespaces in the children array of returned Nodes. |

 

 

 

#### `DOM.focus`

 

Focuses the given element.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Identifier of the node. |
| `backendNodeId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-BackendNodeId">BackendNodeId</a>` | Identifier of the backend node. |
| `objectId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObjectId">Runtime.RemoteObjectId</a>` | JavaScript object id of the node wrapper. |

 

 

 

#### `DOM.getAttributes`

 

Returns attributes for the specified node.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the node to retrieve attributes for. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `attributes` | `array<<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-string">string</a>>` | An interleaved array of node attribute names and values. |

 

 

 

#### `DOM.getBoxModel`

 

Returns boxes for the given node.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Identifier of the node. |
| `backendNodeId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-BackendNodeId">BackendNodeId</a>` | Identifier of the backend node. |
| `objectId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObjectId">Runtime.RemoteObjectId</a>` | JavaScript object id of the node wrapper. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `model` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-BoxModel">BoxModel</a>` | Box model for the node. |

 

 

 

#### `DOM.getContentQuads`

 Experimental 

Returns quads that describe node position on the page. This method
might return multiple quads for inline nodes.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Identifier of the node. |
| `backendNodeId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-BackendNodeId">BackendNodeId</a>` | Identifier of the backend node. |
| `objectId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObjectId">Runtime.RemoteObjectId</a>` | JavaScript object id of the node wrapper. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `quads` | `array<<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-Quad">Quad</a>>` | Quads that describe node layout relative to viewport. |

 

 

 

#### `DOM.getDocument`

 

Returns the root DOM node (and optionally the subtree) to the caller.
Implicitly enables the DOM domain events for the current target.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `depth`  (optional) | `integer` | The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0. |
| `pierce`  (optional) | `boolean` | Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false). |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `root` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-Node">Node</a>` | Resulting node. |

 

 

 

#### `DOM.getFlattenedDocument`

 Deprecated 

Returns the root DOM node (and optionally the subtree) to the caller.
Deprecated, as it is not designed to work well with the rest of the DOM agent.
Use DOMSnapshot.captureSnapshot instead.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `depth`  (optional) | `integer` | The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0. |
| `pierce`  (optional) | `boolean` | Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false). |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `nodes` | `array<<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-Node">Node</a>>` | Resulting node. |

 

 

 

#### `DOM.getNodesForSubtreeByStyle`

 Experimental 

Finds nodes with a given computed style in a subtree.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Node ID pointing to the root of a subtree. |
| `computedStyles` | `array<<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-CSSComputedStyleProperty">CSSComputedStyleProperty</a>>` | The style to filter nodes by (includes nodes if any of properties matches). |
| `pierce`  (optional) | `boolean` | Whether or not iframes and shadow roots in the same target should be traversed when returning the results (default is false). |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `nodeIds` | `array<<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>>` | Resulting nodes. |

 

 

 

#### `DOM.getNodeForLocation`

 

Returns node id at given location. Depending on whether DOM domain is enabled, nodeId is
either returned or not.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `x` | `integer` | X coordinate. |
| `y` | `integer` | Y coordinate. |
| `includeUserAgentShadowDOM`  (optional) | `boolean` | False to skip to the nearest non-UA shadow root ancestor (default: false). |
| `ignorePointerEventsNone`  (optional) | `boolean` | Whether to ignore pointer-events: none on elements and hit test them. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `backendNodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-BackendNodeId">BackendNodeId</a>` | Resulting node. |
| `frameId` | `<a href="/docs/cloud-browser-api/cdp-reference/Page#type-FrameId">Page.FrameId</a>` | Frame this node belongs to. |
| `nodeId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the node at given coordinates, only when enabled and requested document. |

 

 

 

#### `DOM.getOuterHTML`

 

Returns node's HTML markup.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Identifier of the node. |
| `backendNodeId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-BackendNodeId">BackendNodeId</a>` | Identifier of the backend node. |
| `objectId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObjectId">Runtime.RemoteObjectId</a>` | JavaScript object id of the node wrapper. |
| `includeShadowDOM`  (optional) Experimental | `boolean` | Include all shadow roots. Equals to false if not specified. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `outerHTML` | `string` | Outer HTML markup. |

 

 

 

#### `DOM.getRelayoutBoundary`

 Experimental 

Returns the id of the nearest ancestor that is a relayout boundary.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the node. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Relayout boundary node id for the given node. |

 

 

 

#### `DOM.getSearchResults`

 Experimental 

Returns search results from given `fromIndex` to given `toIndex` from the search with the given
identifier.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `searchId` | `string` | Unique search session identifier. |
| `fromIndex` | `integer` | Start index of the search result to be returned. |
| `toIndex` | `integer` | End index of the search result to be returned. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `nodeIds` | `array<<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>>` | Ids of the search result nodes. |

 

 

 

#### `DOM.hideHighlight`

 

Hides any highlight.

Redirects to: Overlay

 

 

#### `DOM.highlightNode`

 

Highlights DOM node.

Redirects to: Overlay

 

 

#### `DOM.highlightRect`

 

Highlights given rectangle.

Redirects to: Overlay

 

 

#### `DOM.markUndoableState`

 Experimental 

Marks last undoable state.

 

 

#### `DOM.moveTo`

 

Moves node into the new container, places it before the given anchor.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the node to move. |
| `targetNodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the element to drop the moved node into. |
| `insertBeforeNodeId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Drop node before this one (if absent, the moved node becomes the last child of `targetNodeId`). |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | New id of the moved node. |

 

 

 

#### `DOM.performSearch`

 Experimental 

Searches for a given string in the DOM tree. Use `getSearchResults` to access search results or
`cancelSearch` to end this search session.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `query` | `string` | Plain text or query selector or XPath search query. |
| `includeUserAgentShadowDOM`  (optional) | `boolean` | True to search in user agent shadow DOM. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `searchId` | `string` | Unique search session identifier. |
| `resultCount` | `integer` | Number of search results. |

 

 

 

#### `DOM.pushNodeByPathToFrontend`

 Experimental 

Requests that the node is sent to the caller given its path. // FIXME, use XPath

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `path` | `string` | Path to node in the proprietary format. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the node for given path. |

 

 

 

#### `DOM.pushNodesByBackendIdsToFrontend`

 Experimental 

Requests that a batch of nodes is sent to the caller given their backend node ids.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `backendNodeIds` | `array<<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-BackendNodeId">BackendNodeId</a>>` | The array of backend node ids. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `nodeIds` | `array<<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>>` | The array of ids of pushed nodes that correspond to the backend ids specified in backendNodeIds. |

 

 

 

#### `DOM.querySelector`

 

Executes `querySelector` on a given node.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the node to query upon. |
| `selector` | `string` | Selector string. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Query selector result. |

 

 

 

#### `DOM.querySelectorAll`

 

Executes `querySelectorAll` on a given node.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the node to query upon. |
| `selector` | `string` | Selector string. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `nodeIds` | `array<<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>>` | Query selector result. |

 

 

 

#### `DOM.getTopLayerElements`

 Experimental 

Returns NodeIds of current top layer elements.
Top layer is rendered closest to the user within a viewport, therefore its elements always
appear on top of all other content.

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `nodeIds` | `array<<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>>` | NodeIds of top layer elements |

 

 

 

#### `DOM.getElementByRelation`

 Experimental 

Returns the NodeId of the matched element according to certain relations.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the node from which to query the relation. |
| `relation` | `string` | Type of relation to get. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | NodeId of the element matching the queried relation. |

 

 

 

#### `DOM.redo`

 Experimental 

Re-does the last undone action.

 

 

#### `DOM.removeAttribute`

 

Removes attribute with given name from an element with given id.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the element to remove attribute from. |
| `name` | `string` | Name of the attribute to remove. |

 

 

 

#### `DOM.removeNode`

 

Removes node with given id.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the node to remove. |

 

 

 

#### `DOM.requestChildNodes`

 

Requests that children of the node with given id are returned to the caller in form of
`setChildNodes` events where not only immediate children are retrieved, but all children down to
the specified depth.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the node to get children for. |
| `depth`  (optional) | `integer` | The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0. |
| `pierce`  (optional) | `boolean` | Whether or not iframes and shadow roots should be traversed when returning the sub-tree (default is false). |

 

 

 

#### `DOM.requestNode`

 

Requests that the node is sent to the caller given the JavaScript node object reference. All
nodes that form the path from the node to the root are also sent to the client as a series of
`setChildNodes` notifications.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `objectId` | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObjectId">Runtime.RemoteObjectId</a>` | JavaScript object id to convert into node. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Node id for given object. |

 

 

 

#### `DOM.resolveNode`

 

Resolves the JavaScript node object for a given NodeId or BackendNodeId.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the node to resolve. |
| `backendNodeId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-BackendNodeId">DOM.BackendNodeId</a>` | Backend identifier of the node to resolve. |
| `objectGroup`  (optional) | `string` | Symbolic group name that can be used to release multiple objects. |
| `executionContextId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-ExecutionContextId">Runtime.ExecutionContextId</a>` | Execution context in which to resolve the node. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `object` | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObject">Runtime.RemoteObject</a>` | JavaScript object wrapper for given node. |

 

 

 

#### `DOM.setAttributeValue`

 

Sets attribute for an element with given id.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the element to set attribute for. |
| `name` | `string` | Attribute name. |
| `value` | `string` | Attribute value. |

 

 

 

#### `DOM.setAttributesAsText`

 

Sets attributes on element with given id. This method is useful when user edits some existing
attribute value and types in several attribute name/value pairs.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the element to set attributes for. |
| `text` | `string` | Text with a number of attributes. Will parse this text using HTML parser. |
| `name`  (optional) | `string` | Attribute name to replace with new attributes derived from text in case text parsed successfully. |

 

 

 

#### `DOM.setFileInputFiles`

 

Sets files for the given file input element.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `files` | `array<<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-string">string</a>>` | Array of file paths to set. |
| `nodeId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Identifier of the node. |
| `backendNodeId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-BackendNodeId">BackendNodeId</a>` | Identifier of the backend node. |
| `objectId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObjectId">Runtime.RemoteObjectId</a>` | JavaScript object id of the node wrapper. |

 

 

 

#### `DOM.setNodeStackTracesEnabled`

 Experimental 

Sets if stack traces should be captured for Nodes. See `Node.getNodeStackTraces`. Default is disabled.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `enable` | `boolean` | Enable or disable. |

 

 

 

#### `DOM.getNodeStackTraces`

 Experimental 

Gets stack traces associated with a Node. As of now, only provides stack trace for Node creation.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the node to get stack traces for. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `creation`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-StackTrace">Runtime.StackTrace</a>` | Creation stack trace, if available. |

 

 

 

#### `DOM.getFileInfo`

 Experimental 

Returns file information for the given
File wrapper.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `objectId` | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObjectId">Runtime.RemoteObjectId</a>` | JavaScript object id of the node wrapper. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `path` | `string` |  |

 

 

 

#### `DOM.getDetachedDomNodes`

 Experimental 

Returns list of detached nodes

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `detachedNodes` | `array<<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-DetachedElementInfo">DetachedElementInfo</a>>` | The list of detached nodes |

 

 

 

#### `DOM.setInspectedNode`

 Experimental 

Enables console to refer to the node with given id via $x (see Command Line API for more details
$x functions).

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | DOM node id to be accessible by means of $x command line API. |

 

 

 

#### `DOM.setNodeName`

 

Sets node name for a node with given id.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the node to set name for. |
| `name` | `string` | New node's name. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | New node's id. |

 

 

 

#### `DOM.setNodeValue`

 

Sets node value for a node with given id.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the node to set value for. |
| `value` | `string` | New node's value. |

 

 

 

#### `DOM.setOuterHTML`

 

Sets node HTML markup, returns new node id.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the node to set markup for. |
| `outerHTML` | `string` | Outer HTML markup to set. |

 

 

 

#### `DOM.undo`

 Experimental 

Undoes the last performed action.

 

 

#### `DOM.getFrameOwner`

 Experimental 

Returns iframe node that owns iframe with the given domain.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `frameId` | `<a href="/docs/cloud-browser-api/cdp-reference/Page#type-FrameId">Page.FrameId</a>` |  |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `backendNodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-BackendNodeId">BackendNodeId</a>` | Resulting node. |
| `nodeId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the node at given coordinates, only when enabled and requested document. |

 

 

 

#### `DOM.getContainerForNode`

 Experimental 

Returns the query container of the given node based on container query
conditions: containerName, physical and logical axes, and whether it queries
scroll-state or anchored elements. If no axes are provided and
queriesScrollState is false, the style container is returned, which is the
direct parent or the closest element with a matching container-name.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` |  |
| `containerName`  (optional) | `string` |  |
| `physicalAxes`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-PhysicalAxes">PhysicalAxes</a>` |  |
| `logicalAxes`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-LogicalAxes">LogicalAxes</a>` |  |
| `queriesScrollState`  (optional) | `boolean` |  |
| `queriesAnchored`  (optional) | `boolean` |  |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `nodeId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | The container node for the given node, or null if not found. |

 

 

 

#### `DOM.getQueryingDescendantsForContainer`

 Experimental 

Returns the descendants of a container query container that have
container queries against this container.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the container node to find querying descendants from. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `nodeIds` | `array<<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>>` | Descendant nodes with container queries against the given container. |

 

 

 

#### `DOM.getAnchorElement`

 Experimental 

Returns the target anchor element of the given anchor query according to
https://www.w3.org/TR/css-anchor-position-1/#target.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the positioned element from which to find the anchor. |
| `anchorSpecifier`  (optional) | `string` | An optional anchor specifier, as defined in https://www.w3.org/TR/css-anchor-position-1/#anchor-specifier. If not provided, it will return the implicit anchor element for the given positioned element. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | The anchor element of the given anchor query. |

 

 

 

#### `DOM.forceShowPopover`

 Experimental 

When enabling, this API force-opens the popover identified by nodeId
and keeps it open until disabled.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the popover HTMLElement |
| `enable` | `boolean` | If true, opens the popover and keeps it open. If false, closes the popover if it was previously force-opened. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `nodeIds` | `array<<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>>` | List of popovers that were closed in order to respect popover stacking order. |

 

 

 

 

## Events

#### `DOM.attributeModified`

 

Fired when `Element`'s attribute is modified.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the node that has changed. |
| `name` | `string` | Attribute name. |
| `value` | `string` | Attribute value. |

 

 

 

#### `DOM.adoptedStyleSheetsModified`

 Experimental 

Fired when `Element`'s adoptedStyleSheets are modified.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the node that has changed. |
| `adoptedStyleSheets` Experimental | `array<<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-StyleSheetId">StyleSheetId</a>>` | New adoptedStyleSheets array. |

 

 

 

#### `DOM.attributeRemoved`

 

Fired when `Element`'s attribute is removed.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the node that has changed. |
| `name` | `string` | A ttribute name. |

 

 

 

#### `DOM.characterDataModified`

 

Mirrors `DOMCharacterDataModified` event.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the node that has changed. |
| `characterData` | `string` | New text value. |

 

 

 

#### `DOM.childNodeCountUpdated`

 

Fired when `Container`'s child node count has changed.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the node that has changed. |
| `childNodeCount` | `integer` | New node count. |

 

 

 

#### `DOM.childNodeInserted`

 

Mirrors `DOMNodeInserted` event.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `parentNodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the node that has changed. |
| `previousNodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the previous sibling. |
| `node` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-Node">Node</a>` | Inserted node data. |

 

 

 

#### `DOM.childNodeRemoved`

 

Mirrors `DOMNodeRemoved` event.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `parentNodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Parent id. |
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Id of the node that has been removed. |

 

 

 

#### `DOM.distributedNodesUpdated`

 Experimental 

Called when distribution is changed.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `insertionPointId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Insertion point where distributed nodes were updated. |
| `distributedNodes` | `array<<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-BackendNode">BackendNode</a>>` | Distributed nodes for given insertion point. |

 

 

 

#### `DOM.documentUpdated`

 

Fired when `Document` has been totally updated. Node ids are no longer valid.

 

 

#### `DOM.inlineStyleInvalidated`

 Experimental 

Fired when `Element`'s inline style is modified via a CSS property modification.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeIds` | `array<<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>>` | Ids of the nodes for which the inline styles have been invalidated. |

 

 

 

#### `DOM.pseudoElementAdded`

 Experimental 

Called when a pseudo element is added to an element.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `parentId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Pseudo element's parent element id. |
| `pseudoElement` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-Node">Node</a>` | The added pseudo element. |

 

 

 

#### `DOM.topLayerElementsUpdated`

 Experimental 

Called when top layer elements are changed.

 

 

#### `DOM.scrollableFlagUpdated`

 Experimental 

Fired when a node's scrollability state changes.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">DOM.NodeId</a>` | The id of the node. |
| `isScrollable` | `boolean` | If the node is scrollable. |

 

 

 

#### `DOM.adRelatedStateUpdated`

 Experimental 

Fired when a node's ad related state changes.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">DOM.NodeId</a>` | The id of the node. |
| `isAdRelated` | `boolean` | If the node is ad related. |

 

 

 

#### `DOM.affectedByStartingStylesFlagUpdated`

 Experimental 

Fired when a node's starting styles changes.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">DOM.NodeId</a>` | The id of the node. |
| `affectedByStartingStyles` | `boolean` | If the node has starting styles. |

 

 

 

#### `DOM.pseudoElementRemoved`

 Experimental 

Called when a pseudo element is removed from an element.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `parentId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Pseudo element's parent element id. |
| `pseudoElementId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | The removed pseudo element id. |

 

 

 

#### `DOM.setChildNodes`

 

Fired when backend wants to provide client with the missing DOM structure. This happens upon
most of the calls requesting node ids.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `parentId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Parent node id to populate with children. |
| `nodes` | `array<<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-Node">Node</a>>` | Child nodes array. |

 

 

 

#### `DOM.shadowRootPopped`

 Experimental 

Called when shadow root is popped from the element.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `hostId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Host element id. |
| `rootId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Shadow root id. |

 

 

 

#### `DOM.shadowRootPushed`

 Experimental 

Called when shadow root is pushed into the element.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `hostId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Host element id. |
| `root` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-Node">Node</a>` | Shadow root. |

 

 

 

 

## Types

#### `NodeId`

 (integer) 

Unique DOM node identifier.

 

 

#### `BackendNodeId`

 (integer) 

Unique DOM node identifier used to reference a node that may not have been pushed to the
front-end.

 

 

#### `StyleSheetId`

 (string) 

Unique identifier for a CSS stylesheet.

 

 

#### `BackendNode`

 (object) 

Backend node with a friendly name.

###### Properties

 | Name | Type | Description |
|---|---|---|
| `nodeType` | `integer` | `Node`'s nodeType. |
| `nodeName` | `string` | `Node`'s nodeName. |
| `backendNodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-BackendNodeId">BackendNodeId</a>` |  |

 

 

 

#### `PseudoType`

 (string) 

Pseudo element type.

###### Allowed Values

- `first-line`
- `first-letter`
- `checkmark`
- `before`
- `after`
- `picker-icon`
- `interest-hint`
- `marker`
- `backdrop`
- `column`
- `selection`
- `search-text`
- `target-text`
- `spelling-error`
- `grammar-error`
- `highlight`
- `first-line-inherited`
- `scroll-marker`
- `scroll-marker-group`
- `scroll-button`
- `scrollbar`
- `scrollbar-thumb`
- `scrollbar-button`
- `scrollbar-track`
- `scrollbar-track-piece`
- `scrollbar-corner`
- `resizer`
- `input-list-button`
- `view-transition`
- `view-transition-group`
- `view-transition-image-pair`
- `view-transition-group-children`
- `view-transition-old`
- `view-transition-new`
- `placeholder`
- `file-selector-button`
- `details-content`
- `picker`
- `permission-icon`
- `overscroll-area-parent`
 
 

 

#### `ShadowRootType`

 (string) 

Shadow root type.

###### Allowed Values

- `user-agent`
- `open`
- `closed`
 
 

 

#### `CompatibilityMode`

 (string) 

Document compatibility mode.

###### Allowed Values

- `QuirksMode`
- `LimitedQuirksMode`
- `NoQuirksMode`
 
 

 

#### `PhysicalAxes`

 (string) 

ContainerSelector physical axes

###### Allowed Values

- `Horizontal`
- `Vertical`
- `Both`
 
 

 

#### `LogicalAxes`

 (string) 

ContainerSelector logical axes

###### Allowed Values

- `Inline`
- `Block`
- `Both`
 
 

 

#### `ScrollOrientation`

 (string) 

Physical scroll orientation

###### Allowed Values

- `horizontal`
- `vertical`
 
 

 

#### `Node`

 (object) 

DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes.
DOMNode is a base node mirror type.

###### Properties

 | Name | Type | Description |
|---|---|---|
| `nodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | Node identifier that is passed into the rest of the DOM messages as the `nodeId`. Backend will only push node with given `id` once. It is aware of all requested nodes and will only fire DOM events for nodes known to the client. |
| `parentId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>` | The id of the parent node if any. |
| `backendNodeId` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-BackendNodeId">BackendNodeId</a>` | The BackendNodeId for this node. |
| `nodeType` | `integer` | `Node`'s nodeType. |
| `nodeName` | `string` | `Node`'s nodeName. |
| `localName` | `string` | `Node`'s localName. |
| `nodeValue` | `string` | `Node`'s nodeValue. |
| `childNodeCount`  (optional) | `integer` | Child count for `Container` nodes. |
| `children`  (optional) | `array<<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-Node">Node</a>>` | Child nodes of this node when requested with children. |
| `attributes`  (optional) | `array<<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-string">string</a>>` | Attributes of the `Element` node in the form of flat array `\[name1, value1, name2, value2\]`. |
| `documentURL`  (optional) | `string` | Document URL that `Document` or `FrameOwner` node points to. |
| `baseURL`  (optional) | `string` | Base URL that `Document` or `FrameOwner` node uses for URL completion. |
| `publicId`  (optional) | `string` | `DocumentType`'s publicId. |
| `systemId`  (optional) | `string` | `DocumentType`'s systemId. |
| `internalSubset`  (optional) | `string` | `DocumentType`'s internalSubset. |
| `xmlVersion`  (optional) | `string` | `Document`'s XML version in case of XML documents. |
| `name`  (optional) | `string` | `Attr`'s name. |
| `value`  (optional) | `string` | `Attr`'s value. |
| `pseudoType`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-PseudoType">PseudoType</a>` | Pseudo element type for this node. |
| `pseudoIdentifier`  (optional) | `string` | Pseudo element identifier for this node. Only present if there is a valid pseudoType. |
| `shadowRootType`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-ShadowRootType">ShadowRootType</a>` | Shadow root type. |
| `frameId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Page#type-FrameId">Page.FrameId</a>` | Frame ID for frame owner elements. |
| `contentDocument`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-Node">Node</a>` | Content document for frame owner elements. |
| `shadowRoots`  (optional) | `array<<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-Node">Node</a>>` | Shadow root list for given element host. |
| `templateContent`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-Node">Node</a>` | Content document fragment for template elements. |
| `pseudoElements`  (optional) | `array<<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-Node">Node</a>>` | Pseudo elements associated with this node. |
| `importedDocument`  (optional) Deprecated | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-Node">Node</a>` | Deprecated, as the HTML Imports API has been removed (crbug.com/937746). This property used to return the imported document for the HTMLImport links. The property is always undefined now. |
| `distributedNodes`  (optional) | `array<<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-BackendNode">BackendNode</a>>` | Distributed nodes for given insertion point. |
| `isSVG`  (optional) | `boolean` | Whether the node is SVG. |
| `compatibilityMode`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-CompatibilityMode">CompatibilityMode</a>` |  |
| `assignedSlot`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-BackendNode">BackendNode</a>` |  |
| `isScrollable`  (optional) Experimental | `boolean` |  |
| `affectedByStartingStyles`  (optional) Experimental | `boolean` |  |
| `adoptedStyleSheets`  (optional) Experimental | `array<<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-StyleSheetId">StyleSheetId</a>>` |  |
| `isAdRelated`  (optional) Experimental | `boolean` |  |

 

 

 

#### `DetachedElementInfo`

 (object) 

A structure to hold the top-level node of a detached tree and an array of its retained descendants.

###### Properties

 | Name | Type | Description |
|---|---|---|
| `treeNode` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-Node">Node</a>` |  |
| `retainedNodeIds` | `array<<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-NodeId">NodeId</a>>` |  |

 

 

 

#### `RGBA`

 (object) 

A structure holding an RGBA color.

###### Properties

 | Name | Type | Description |
|---|---|---|
| `r` | `integer` | The red component, in the \[0-255\] range. |
| `g` | `integer` | The green component, in the \[0-255\] range. |
| `b` | `integer` | The blue component, in the \[0-255\] range. |
| `a`  (optional) | `number` | The alpha component, in the \[0-1\] range (default: 1). |

 

 

 

#### `Quad`

 (array) 

An array of quad vertices, x immediately followed by y for each point, points clock-wise.

 

 

#### `BoxModel`

 (object) 

Box model.

###### Properties

 | Name | Type | Description |
|---|---|---|
| `content` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-Quad">Quad</a>` | Content box |
| `padding` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-Quad">Quad</a>` | Padding box |
| `border` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-Quad">Quad</a>` | Border box |
| `margin` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-Quad">Quad</a>` | Margin box |
| `width` | `integer` | Node width |
| `height` | `integer` | Node height |
| `shapeOutside`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-ShapeOutsideInfo">ShapeOutsideInfo</a>` | Shape outside coordinates |

 

 

 

#### `ShapeOutsideInfo`

 (object) 

CSS Shape Outside details.

###### Properties

 | Name | Type | Description |
|---|---|---|
| `bounds` | `<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-Quad">Quad</a>` | Shape bounds |
| `shape` | `array<<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-any">any</a>>` | Shape coordinate details |
| `marginShape` | `array<<a href="/docs/cloud-browser-api/cdp-reference/DOM#type-any">any</a>>` | Margin shape bounds |

 

 

 

#### `Rect`

 (object) 

Rectangle.

###### Properties

 | Name | Type | Description |
|---|---|---|
| `x` | `number` | X coordinate |
| `y` | `number` | Y coordinate |
| `width` | `number` | Rectangle width |
| `height` | `number` | Rectangle height |

 

 

 

#### `CSSComputedStyleProperty`

 (object) 

###### Properties

 | Name | Type | Description |
|---|---|---|
| `name` | `string` | Computed style property name. |
| `value` | `string` | Computed style property value. |