Available on crate features
DOM and Runtime only.Expand description
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.
Structs§
- Attribute
Modified Event - Fired when
Element’s attribute is modified. - Attribute
Removed Event - Fired when
Element’s attribute is removed. - Backend
Node - Backend node with a friendly name.
- Backend
Node Id - Unique DOM node identifier used to reference a node that may not have been pushed to the front-end.
- BoxModel
- Box model.
- BoxModel
Builder - Character
Data Modified Event - Mirrors
DOMCharacterDataModifiedevent. - Child
Node Count Updated Event - Fired when
Container’s child node count has changed. - Child
Node Inserted Event - Mirrors
DOMNodeInsertedevent. - Child
Node Removed Event - Mirrors
DOMNodeRemovedevent. - Collect
Class Names From Subtree Command experimental - Collects class names for the node with given id and all of it’s child nodes.
- Collect
Class Names From Subtree Return experimental - Collects class names for the node with given id and all of it’s child nodes.
- Copy
ToCommand experimental - Creates a deep copy of the specified node and places it into the target container before the given anchor.
- Copy
ToReturn experimental - Creates a deep copy of the specified node and places it into the target container before the given anchor.
- CssComputed
Style Property - Describe
Node Command - Describes node given its id, does not require domain to be enabled. Does not start tracking any objects, can be used for automation.
- Describe
Node Command Builder - Describe
Node Return - Describes node given its id, does not require domain to be enabled. Does not start tracking any objects, can be used for automation.
- Disable
Command - Disables DOM agent for the given page.
- Disable
Return - Disables DOM agent for the given page.
- Discard
Search Results Command experimental - Discards search results from the session with the given id.
getSearchResultsshould no longer be called for that search. - Discard
Search Results Return experimental - Discards search results from the session with the given id.
getSearchResultsshould no longer be called for that search. - Distributed
Nodes Updated Event experimental - Called when distrubution is changed.
- Document
Updated Event - Fired when
Documenthas been totally updated. Node ids are no longer valid. - Enable
Command - Enables DOM agent for the given page.
- Enable
Return - Enables DOM agent for the given page.
- Focus
Command - Focuses the given element.
- Focus
Return - Focuses the given element.
- GetAttributes
Command - Returns attributes for the specified node.
- GetAttributes
Return - Returns attributes for the specified node.
- GetBox
Model Command - Returns boxes for the given node.
- GetBox
Model Return - Returns boxes for the given node.
- GetContent
Quads Command experimental - Returns quads that describe node position on the page. This method might return multiple quads for inline nodes.
- GetContent
Quads Return experimental - Returns quads that describe node position on the page. This method might return multiple quads for inline nodes.
- GetDocument
Command - Returns the root DOM node (and optionally the subtree) to the caller.
- GetDocument
Return - Returns the root DOM node (and optionally the subtree) to the caller.
- GetFile
Info Command experimental - Returns file information for the given File wrapper.
- GetFile
Info Return experimental - Returns file information for the given File wrapper.
- GetFlattened
Document Command 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.
- GetFlattened
Document Return 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.
- GetFrame
Owner Command experimental - Returns iframe node that owns iframe with the given domain.
- GetFrame
Owner Return experimental - Returns iframe node that owns iframe with the given domain.
- GetNode
ForLocation Command - Returns node id at given location. Depending on whether DOM domain is enabled, nodeId is either returned or not.
- GetNode
ForLocation Command Builder - GetNode
ForLocation Return - Returns node id at given location. Depending on whether DOM domain is enabled, nodeId is either returned or not.
- GetNode
Stack Traces Command experimental - Gets stack traces associated with a Node. As of now, only provides stack trace for Node creation.
- GetNode
Stack Traces Return experimental - Gets stack traces associated with a Node. As of now, only provides stack trace for Node creation.
- GetNodes
ForSubtree ByStyle Command experimental - Finds nodes with a given computed style in a subtree.
- GetNodes
ForSubtree ByStyle Return experimental - Finds nodes with a given computed style in a subtree.
- GetOuter
Html Command - Returns node’s HTML markup.
- GetOuter
Html Return - Returns node’s HTML markup.
- GetRelayout
Boundary Command experimental - Returns the id of the nearest ancestor that is a relayout boundary.
- GetRelayout
Boundary Return experimental - Returns the id of the nearest ancestor that is a relayout boundary.
- GetSearch
Results Command experimental - Returns search results from given
fromIndexto giventoIndexfrom the search with the given identifier. - GetSearch
Results Return experimental - Returns search results from given
fromIndexto giventoIndexfrom the search with the given identifier. - Hide
Highlight Command - Hides any highlight.
- Hide
Highlight Return - Hides any highlight.
- Highlight
Node Command - Highlights DOM node.
- Highlight
Node Return - Highlights DOM node.
- Highlight
Rect Command - Highlights given rectangle.
- Highlight
Rect Return - Highlights given rectangle.
- Inline
Style Invalidated Event experimental - Fired when
Element’s inline style is modified via a CSS property modification. - Mark
Undoable State Command experimental - Marks last undoable state.
- Mark
Undoable State Return experimental - Marks last undoable state.
- Move
ToCommand - Moves node into the new container, places it before the given anchor.
- Move
ToReturn - Moves node into the new container, places it before the given anchor.
- Node
- DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes. DOMNode is a base node mirror type.
- Node
Builder - NodeId
- Unique DOM node identifier.
- Perform
Search Command experimental - Searches for a given string in the DOM tree. Use
getSearchResultsto access search results orcancelSearchto end this search session. - Perform
Search Return experimental - Searches for a given string in the DOM tree. Use
getSearchResultsto access search results orcancelSearchto end this search session. - Pseudo
Element Added Event experimental - Called when a pseudo element is added to an element.
- Pseudo
Element Removed Event experimental - Called when a pseudo element is removed from an element.
- Push
Node ByPath ToFrontend Command experimental - Requests that the node is sent to the caller given its path. // FIXME, use XPath
- Push
Node ByPath ToFrontend Return experimental - Requests that the node is sent to the caller given its path. // FIXME, use XPath
- Push
Nodes ByBackend IdsTo Frontend Command experimental - Requests that a batch of nodes is sent to the caller given their backend node ids.
- Push
Nodes ByBackend IdsTo Frontend Return experimental - Requests that a batch of nodes is sent to the caller given their backend node ids.
- Quad
- An array of quad vertices, x immediately followed by y for each point, points clock-wise.
- Query
Selector AllCommand - Executes
querySelectorAllon a given node. - Query
Selector AllReturn - Executes
querySelectorAllon a given node. - Query
Selector Command - Executes
querySelectoron a given node. - Query
Selector Return - Executes
querySelectoron a given node. - Rect
- Rectangle.
- Rect
Builder - Redo
Command experimental - Re-does the last undone action.
- Redo
Return experimental - Re-does the last undone action.
- Remove
Attribute Command - Removes attribute with given name from an element with given id.
- Remove
Attribute Return - Removes attribute with given name from an element with given id.
- Remove
Node Command - Removes node with given id.
- Remove
Node Return - Removes node with given id.
- Request
Child Nodes Command - Requests that children of the node with given id are returned to the caller in form of
setChildNodesevents where not only immediate children are retrieved, but all children down to the specified depth. - Request
Child Nodes Return - Requests that children of the node with given id are returned to the caller in form of
setChildNodesevents where not only immediate children are retrieved, but all children down to the specified depth. - Request
Node Command - 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
setChildNodesnotifications. - Request
Node Return - 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
setChildNodesnotifications. - Resolve
Node Command - Resolves the JavaScript node object for a given NodeId or BackendNodeId.
- Resolve
Node Command Builder - Resolve
Node Return - Resolves the JavaScript node object for a given NodeId or BackendNodeId.
- Rgba
- A structure holding an RGBA color.
- Rgba
Builder - Scroll
Into View IfNeeded Command experimental - 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.
- Scroll
Into View IfNeeded Command Builder experimental - Scroll
Into View IfNeeded Return experimental - 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.
- SetAttribute
Value Command - Sets attribute for an element with given id.
- SetAttribute
Value Return - Sets attribute for an element with given id.
- SetAttributes
AsText Command - 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.
- SetAttributes
AsText Return - 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.
- SetChild
Nodes Event - Fired when backend wants to provide client with the missing DOM structure. This happens upon most of the calls requesting node ids.
- SetFile
Input Files Command - Sets files for the given file input element.
- SetFile
Input Files Command Builder - SetFile
Input Files Return - Sets files for the given file input element.
- SetInspected
Node Command experimental - Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).
- SetInspected
Node Return experimental - Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).
- SetNode
Name Command - Sets node name for a node with given id.
- SetNode
Name Return - Sets node name for a node with given id.
- SetNode
Stack Traces Enabled Command experimental - Sets if stack traces should be captured for Nodes. See
Node.getNodeStackTraces. Default is disabled. - SetNode
Stack Traces Enabled Return experimental - Sets if stack traces should be captured for Nodes. See
Node.getNodeStackTraces. Default is disabled. - SetNode
Value Command - Sets node value for a node with given id.
- SetNode
Value Return - Sets node value for a node with given id.
- SetOuter
Html Command - Sets node HTML markup, returns new node id.
- SetOuter
Html Return - Sets node HTML markup, returns new node id.
- Shadow
Root Popped Event experimental - Called when shadow root is popped from the element.
- Shadow
Root Pushed Event experimental - Called when shadow root is pushed into the element.
- Shape
Outside Info - CSS Shape Outside details.
- Undo
Command experimental - Undoes the last performed action.
- Undo
Return experimental - Undoes the last performed action.