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
-
Enables DOM agent for the given page.
-
Disables DOM agent for the given page.
-
Returns the root DOM node (and optionally the subtree) to the caller.
-
Returns the root DOM node (and optionally the subtree) to the caller.
DOM.collectClassNamesFromSubtree
ExperimentalCollects class names for the node with given id and all of it's child nodes.
-
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. -
Executes
querySelector
on a given node. -
Executes
querySelectorAll
on a given node. -
Sets node name for a node with given id.
-
Sets node value for a node with given id.
-
Removes node with given id.
-
Sets attribute for an element with given id.
-
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.
-
Removes attribute with given name from an element with given id.
-
Returns node's HTML markup.
-
Sets node HTML markup, returns new node id.
DOM.performSearch
ExperimentalSearches for a given string in the DOM tree. Use
getSearchResults
to access search results orcancelSearch
to end this search session.DOM.getSearchResults
ExperimentalReturns search results from given
fromIndex
to giventoIndex
from the sarch with the given identifier.DOM.discardSearchResults
ExperimentalDiscards search results from the session with the given id.
getSearchResults
should no longer be called for that search.-
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. -
Highlights given rectangle.
-
Highlights DOM node.
-
Hides any highlight.
DOM.pushNodeByPathToFrontend
ExperimentalRequests that the node is sent to the caller given its path. // FIXME, use XPath
DOM.pushNodesByBackendIdsToFrontend
ExperimentalRequests that a batch of nodes is sent to the caller given their backend node ids.
DOM.setInspectedNode
ExperimentalEnables console to refer to the node with given id via $x (see Command Line API for more details $x functions).
-
Resolves the JavaScript node object for a given NodeId or BackendNodeId.
-
Returns attributes for the specified node.
DOM.copyTo
ExperimentalCreates a deep copy of the specified node and places it into the target container before the given anchor.
-
Moves node into the new container, places it before the given anchor.
DOM.undo
ExperimentalUndoes the last performed action.
DOM.redo
ExperimentalRe-does the last undone action.
DOM.markUndoableState
ExperimentalMarks last undoable state.
DOM.focus
ExperimentalFocuses the given element.
DOM.setFileInputFiles
ExperimentalSets files for the given file input element.
DOM.getBoxModel
ExperimentalReturns boxes for the currently selected nodes.
DOM.getNodeForLocation
ExperimentalReturns node id at given location.
DOM.getRelayoutBoundary
ExperimentalReturns the id of the nearest ancestor that is a relayout boundary.
-
Describes node given its id, does not require domain to be enabled. Does not start tracking any objects, can be used for automation.
Events
-
Fired when
Document
has been totally updated. Node ids are no longer valid. -
Fired when backend wants to provide client with the missing DOM structure. This happens upon most of the calls requesting node ids.
-
Fired when
Element
's attribute is modified. -
Fired when
Element
's attribute is removed. DOM.inlineStyleInvalidated
ExperimentalFired when
Element
's inline style is modified via a CSS property modification.-
Mirrors
DOMCharacterDataModified
event. -
Fired when
Container
's child node count has changed. -
Mirrors
DOMNodeInserted
event. -
Mirrors
DOMNodeRemoved
event. DOM.shadowRootPushed
ExperimentalCalled when shadow root is pushed into the element.
DOM.shadowRootPopped
ExperimentalCalled when shadow root is popped from the element.
DOM.pseudoElementAdded
ExperimentalCalled when a pseudo element is added to an element.
DOM.pseudoElementRemoved
ExperimentalCalled when a pseudo element is removed from an element.
DOM.distributedNodesUpdated
ExperimentalCalled when distrubution is changed.
Types
-
Unique DOM node identifier.
BackendNodeId
ExperimentalUnique DOM node identifier used to reference a node that may not have been pushed to the front-end.
BackendNode
ExperimentalBackend node with a friendly name.
-
Pseudo element type.
-
Shadow root type.
-
DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes. DOMNode is a base node mirror type.
-
A structure holding an RGBA color.
Quad
ExperimentalAn array of quad vertices, x immediately followed by y for each point, points clock-wise.
BoxModel
ExperimentalBox model.
ShapeOutsideInfo
ExperimentalCSS Shape Outside details.
Rect
ExperimentalRectangle.
Structs
AttributeModifiedEvent |
Fired when |
AttributeRemovedEvent |
Fired when |
BackendNode |
[Experimental] Backend node with a friendly name. |
BoxModel |
[Experimental] Box model. |
CharacterDataModifiedEvent |
Mirrors |
ChildNodeCountUpdatedEvent |
Fired when |
ChildNodeInsertedEvent |
Mirrors |
ChildNodeRemovedEvent |
Mirrors |
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. |
DiscardSearchResultsResponse |
[Experimental] Discards search results from the session with the given id. |
DistributedNodesUpdatedEvent |
[Experimental] Called when distrubution is changed. |
DocumentUpdatedEvent |
Fired when |
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 |
GetSearchResultsResponse |
[Experimental] Returns search results from given |
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 |
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 |
PerformSearchResponse |
[Experimental] Searches for a given string in the DOM tree. Use |
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 |
QuerySelectorAllResponse |
Executes |
QuerySelectorCommand |
Executes |
QuerySelectorResponse |
Executes |
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 |
RequestChildNodesResponse |
Requests that children of the node with given id are returned to the caller in form of |
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 |
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 |
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. |