← Back to DOM domain
DOM.getFlattenedDocument
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.
Domain: DOM
deprecated
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). |
Returns
| Name | Type | Description |
nodes | array | Resulting node. |
Example Request
{
"id": 1,
"method": "DOM.getFlattenedDocument"
}
Example Response
{
"id": 1,
"result": {
"nodes": []
}
}
Usage in Node.js
const result = await send('DOM.getFlattenedDocument');
console.log(result);
// {"nodes": []}