Module cdp::dom [] [src]

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.

DOM

Commands

Events

Types

Structs

AttributeModifiedEvent

Fired when Element's attribute is modified.

AttributeRemovedEvent

Fired when Element's attribute is removed.

BackendNode

[Experimental] Backend node with a friendly name.

BoxModel

[Experimental] Box model.

CharacterDataModifiedEvent

Mirrors DOMCharacterDataModified event.

ChildNodeCountUpdatedEvent

Fired when Container's child node count has changed.

ChildNodeInsertedEvent

Mirrors DOMNodeInserted event.

ChildNodeRemovedEvent

Mirrors DOMNodeRemoved event.

CollectClassNamesFromSubtreeCommand

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

CollectClassNamesFromSubtreeResponse

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

CopyToCommand

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

CopyToResponse

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

DescribeNodeCommand

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

DescribeNodeResponse

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

DisableCommand

Disables DOM agent for the given page.

DisableResponse

Disables DOM agent for the given page.

DiscardSearchResultsCommand

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

DiscardSearchResultsResponse

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

DistributedNodesUpdatedEvent

[Experimental] Called when distrubution is changed.

DocumentUpdatedEvent

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

EnableCommand

Enables DOM agent for the given page.

EnableResponse

Enables DOM agent for the given page.

FocusCommand

[Experimental] Focuses the given element.

FocusResponse

[Experimental] Focuses the given element.

GetAttributesCommand

Returns attributes for the specified node.

GetAttributesResponse

Returns attributes for the specified node.

GetBoxModelCommand

[Experimental] Returns boxes for the currently selected nodes.

GetBoxModelResponse

[Experimental] Returns boxes for the currently selected nodes.

GetDocumentCommand

Returns the root DOM node (and optionally the subtree) to the caller.

GetDocumentResponse

Returns the root DOM node (and optionally the subtree) to the caller.

GetFlattenedDocumentCommand

Returns the root DOM node (and optionally the subtree) to the caller.

GetFlattenedDocumentResponse

Returns the root DOM node (and optionally the subtree) to the caller.

GetNodeForLocationCommand

[Experimental] Returns node id at given location.

GetNodeForLocationResponse

[Experimental] Returns node id at given location.

GetOuterHtmlCommand

Returns node's HTML markup.

GetOuterHtmlResponse

Returns node's HTML markup.

GetRelayoutBoundaryCommand

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

GetRelayoutBoundaryResponse

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

GetSearchResultsCommand

[Experimental] Returns search results from given fromIndex to given toIndex from the sarch with the given identifier.

GetSearchResultsResponse

[Experimental] Returns search results from given fromIndex to given toIndex from the sarch with the given identifier.

HideHighlightCommand

Hides any highlight.

HideHighlightResponse

Hides any highlight.

HighlightNodeCommand

Highlights DOM node.

HighlightNodeResponse

Highlights DOM node.

HighlightRectCommand

Highlights given rectangle.

HighlightRectResponse

Highlights given rectangle.

InlineStyleInvalidatedEvent

[Experimental] Fired when Element's inline style is modified via a CSS property modification.

MarkUndoableStateCommand

[Experimental] Marks last undoable state.

MarkUndoableStateResponse

[Experimental] Marks last undoable state.

MoveToCommand

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

MoveToResponse

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.

PerformSearchCommand

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

PerformSearchResponse

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

PseudoElementAddedEvent

[Experimental] Called when a pseudo element is added to an element.

PseudoElementRemovedEvent

[Experimental] Called when a pseudo element is removed from an element.

PushNodeByPathToFrontendCommand

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

PushNodeByPathToFrontendResponse

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

PushNodesByBackendIdsToFrontendCommand

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

PushNodesByBackendIdsToFrontendResponse

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

QuerySelectorAllCommand

Executes querySelectorAll on a given node.

QuerySelectorAllResponse

Executes querySelectorAll on a given node.

QuerySelectorCommand

Executes querySelector on a given node.

QuerySelectorResponse

Executes querySelector on a given node.

Rect

[Experimental] Rectangle.

RedoCommand

[Experimental] Re-does the last undone action.

RedoResponse

[Experimental] Re-does the last undone action.

RemoveAttributeCommand

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

RemoveAttributeResponse

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

RemoveNodeCommand

Removes node with given id.

RemoveNodeResponse

Removes node with given id.

RequestChildNodesCommand

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.

RequestChildNodesResponse

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.

RequestNodeCommand

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.

RequestNodeResponse

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.

ResolveNodeCommand

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

ResolveNodeResponse

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

Rgba

A structure holding an RGBA color.

SetAttributeValueCommand

Sets attribute for an element with given id.

SetAttributeValueResponse

Sets attribute for an element with given id.

SetAttributesAsTextCommand

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.

SetAttributesAsTextResponse

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.

SetChildNodesEvent

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

SetFileInputFilesCommand

[Experimental] Sets files for the given file input element.

SetFileInputFilesResponse

[Experimental] Sets files for the given file input element.

SetInspectedNodeCommand

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

SetInspectedNodeResponse

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

SetNodeNameCommand

Sets node name for a node with given id.

SetNodeNameResponse

Sets node name for a node with given id.

SetNodeValueCommand

Sets node value for a node with given id.

SetNodeValueResponse

Sets node value for a node with given id.

SetOuterHtmlCommand

Sets node HTML markup, returns new node id.

SetOuterHtmlResponse

Sets node HTML markup, returns new node id.

ShadowRootPoppedEvent

[Experimental] Called when shadow root is popped from the element.

ShadowRootPushedEvent

[Experimental] Called when shadow root is pushed into the element.

ShapeOutsideInfo

[Experimental] CSS Shape Outside details.

UndoCommand

[Experimental] Undoes the last performed action.

UndoResponse

[Experimental] Undoes the last performed action.

Enums

PseudoType

Pseudo element type.

ShadowRootType

Shadow root type.

Type Definitions

BackendNodeId

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

NodeId

Unique DOM node identifier.

Quad

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