-
public final class DOMDomainThis domain exposes DOM read/write operations. Each DOM Node is represented with its mirror object that has an
id. Thisidcan 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.<p>Note thatiframeowner elements will return corresponding document elements as their child nodes.</p>
-
-
Method Summary
Modifier and Type Method Description final Flow<DOMEvent>events()Subscribes to all events related to this domain. final Flow<DOMEvent.AttributeModifiedEvent>attributeModified()Fired when Element's attribute is modified.final Flow<DOMEvent.AttributeRemovedEvent>attributeRemoved()Fired when Element's attribute is removed.final Flow<DOMEvent.CharacterDataModifiedEvent>characterDataModified()Mirrors DOMCharacterDataModifiedevent.final Flow<DOMEvent.ChildNodeCountUpdatedEvent>childNodeCountUpdated()Fired when Container's child node count has changed.final Flow<DOMEvent.ChildNodeInsertedEvent>childNodeInserted()Mirrors DOMNodeInsertedevent.final Flow<DOMEvent.ChildNodeRemovedEvent>childNodeRemoved()Mirrors DOMNodeRemovedevent.final Flow<DOMEvent.DistributedNodesUpdatedEvent>distributedNodesUpdated()Called when distrubution is changed. final Flow<DOMEvent.DocumentUpdatedEvent>documentUpdated()Fired when Documenthas been totally updated.final Flow<DOMEvent.InlineStyleInvalidatedEvent>inlineStyleInvalidated()Fired when Element's inline style is modified via a CSS property modification.final Flow<DOMEvent.PseudoElementAddedEvent>pseudoElementAdded()Called when a pseudo element is added to an element. final Flow<DOMEvent.PseudoElementRemovedEvent>pseudoElementRemoved()Called when a pseudo element is removed from an element. final Flow<DOMEvent.SetChildNodesEvent>setChildNodes()Fired when backend wants to provide client with the missing DOM structure. final Flow<DOMEvent.ShadowRootPoppedEvent>shadowRootPopped()Called when shadow root is popped from the element. final Flow<DOMEvent.ShadowRootPushedEvent>shadowRootPushed()Called when shadow root is pushed into the element. final CollectClassNamesFromSubtreeResponsecollectClassNamesFromSubtree(CollectClassNamesFromSubtreeRequest input)Collects class names for the node with given id and all of it's child nodes. final CopyToResponsecopyTo(CopyToRequest input)Creates a deep copy of the specified node and places it into the target container before the given anchor. final DescribeNodeResponsedescribeNode(DescribeNodeRequest input)Describes node given its id, does not require domain to be enabled. final UnitscrollIntoViewIfNeeded(ScrollIntoViewIfNeededRequest input)Scrolls the specified rect of the given node into view if not already visible. final Unitdisable()Disables DOM agent for the given page. final UnitdiscardSearchResults(DiscardSearchResultsRequest input)Discards search results from the session with the given id. final Unitenable()Enables DOM agent for the given page. final Unitfocus(FocusRequest input)Focuses the given element. final GetAttributesResponsegetAttributes(GetAttributesRequest input)Returns attributes for the specified node. final GetBoxModelResponsegetBoxModel(GetBoxModelRequest input)Returns boxes for the given node. final GetContentQuadsResponsegetContentQuads(GetContentQuadsRequest input)Returns quads that describe node position on the page. final GetDocumentResponsegetDocument(GetDocumentRequest input)Returns the root DOM node (and optionally the subtree) to the caller. final GetFlattenedDocumentResponsegetFlattenedDocument(GetFlattenedDocumentRequest input)Returns the root DOM node (and optionally the subtree) to the caller. final GetNodesForSubtreeByStyleResponsegetNodesForSubtreeByStyle(GetNodesForSubtreeByStyleRequest input)Finds nodes with a given computed style in a subtree. final GetNodeForLocationResponsegetNodeForLocation(GetNodeForLocationRequest input)Returns node id at given location. final GetOuterHTMLResponsegetOuterHTML(GetOuterHTMLRequest input)Returns node's HTML markup. final GetRelayoutBoundaryResponsegetRelayoutBoundary(GetRelayoutBoundaryRequest input)Returns the id of the nearest ancestor that is a relayout boundary. final GetSearchResultsResponsegetSearchResults(GetSearchResultsRequest input)Returns search results from given fromIndexto giventoIndexfrom the search with the given identifier.final UnithideHighlight()Hides any highlight. final UnithighlightNode()Highlights DOM node. final UnithighlightRect()Highlights given rectangle. final UnitmarkUndoableState()Marks last undoable state. final MoveToResponsemoveTo(MoveToRequest input)Moves node into the new container, places it before the given anchor. final PerformSearchResponseperformSearch(PerformSearchRequest input)Searches for a given string in the DOM tree. final PushNodeByPathToFrontendResponsepushNodeByPathToFrontend(PushNodeByPathToFrontendRequest input)Requests that the node is sent to the caller given its path. final PushNodesByBackendIdsToFrontendResponsepushNodesByBackendIdsToFrontend(PushNodesByBackendIdsToFrontendRequest input)Requests that a batch of nodes is sent to the caller given their backend node ids. final QuerySelectorResponsequerySelector(QuerySelectorRequest input)Executes querySelectoron a given node.final QuerySelectorAllResponsequerySelectorAll(QuerySelectorAllRequest input)Executes querySelectorAllon a given node.final Unitredo()Re-does the last undone action. final UnitremoveAttribute(RemoveAttributeRequest input)Removes attribute with given name from an element with given id. final UnitremoveNode(RemoveNodeRequest input)Removes node with given id. final UnitrequestChildNodes(RequestChildNodesRequest input)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.final RequestNodeResponserequestNode(RequestNodeRequest input)Requests that the node is sent to the caller given the JavaScript node object reference. final ResolveNodeResponseresolveNode(ResolveNodeRequest input)Resolves the JavaScript node object for a given NodeId or BackendNodeId. final UnitsetAttributeValue(SetAttributeValueRequest input)Sets attribute for an element with given id. final UnitsetAttributesAsText(SetAttributesAsTextRequest input)Sets attributes on element with given id. final UnitsetFileInputFiles(SetFileInputFilesRequest input)Sets files for the given file input element. final UnitsetNodeStackTracesEnabled(SetNodeStackTracesEnabledRequest input)Sets if stack traces should be captured for Nodes. final GetNodeStackTracesResponsegetNodeStackTraces(GetNodeStackTracesRequest input)Gets stack traces associated with a Node. final GetFileInfoResponsegetFileInfo(GetFileInfoRequest input)Returns file information for the given File wrapper. final UnitsetInspectedNode(SetInspectedNodeRequest input)Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). final SetNodeNameResponsesetNodeName(SetNodeNameRequest input)Sets node name for a node with given id. final UnitsetNodeValue(SetNodeValueRequest input)Sets node value for a node with given id. final UnitsetOuterHTML(SetOuterHTMLRequest input)Sets node HTML markup, returns new node id. final Unitundo()Undoes the last performed action. final GetFrameOwnerResponsegetFrameOwner(GetFrameOwnerRequest input)Returns iframe node that owns iframe with the given domain. -
-
Method Detail
-
attributeModified
final Flow<DOMEvent.AttributeModifiedEvent> attributeModified()
Fired when
Element's attribute is modified.
-
attributeRemoved
final Flow<DOMEvent.AttributeRemovedEvent> attributeRemoved()
Fired when
Element's attribute is removed.
-
characterDataModified
final Flow<DOMEvent.CharacterDataModifiedEvent> characterDataModified()
Mirrors
DOMCharacterDataModifiedevent.
-
childNodeCountUpdated
final Flow<DOMEvent.ChildNodeCountUpdatedEvent> childNodeCountUpdated()
Fired when
Container's child node count has changed.
-
childNodeInserted
final Flow<DOMEvent.ChildNodeInsertedEvent> childNodeInserted()
Mirrors
DOMNodeInsertedevent.
-
childNodeRemoved
final Flow<DOMEvent.ChildNodeRemovedEvent> childNodeRemoved()
Mirrors
DOMNodeRemovedevent.
-
distributedNodesUpdated
final Flow<DOMEvent.DistributedNodesUpdatedEvent> distributedNodesUpdated()
Called when distrubution is changed.
-
documentUpdated
final Flow<DOMEvent.DocumentUpdatedEvent> documentUpdated()
Fired when
Documenthas been totally updated. Node ids are no longer valid.
-
inlineStyleInvalidated
final Flow<DOMEvent.InlineStyleInvalidatedEvent> inlineStyleInvalidated()
Fired when
Element's inline style is modified via a CSS property modification.
-
pseudoElementAdded
final Flow<DOMEvent.PseudoElementAddedEvent> pseudoElementAdded()
Called when a pseudo element is added to an element.
-
pseudoElementRemoved
final Flow<DOMEvent.PseudoElementRemovedEvent> pseudoElementRemoved()
Called when a pseudo element is removed from an element.
-
setChildNodes
final Flow<DOMEvent.SetChildNodesEvent> setChildNodes()
Fired when backend wants to provide client with the missing DOM structure. This happens upon most of the calls requesting node ids.
-
shadowRootPopped
final Flow<DOMEvent.ShadowRootPoppedEvent> shadowRootPopped()
Called when shadow root is popped from the element.
-
shadowRootPushed
final Flow<DOMEvent.ShadowRootPushedEvent> shadowRootPushed()
Called when shadow root is pushed into the element.
-
collectClassNamesFromSubtree
final CollectClassNamesFromSubtreeResponse collectClassNamesFromSubtree(CollectClassNamesFromSubtreeRequest input)
Collects class names for the node with given id and all of it's child nodes.
-
copyTo
final CopyToResponse copyTo(CopyToRequest input)
Creates a deep copy of the specified node and places it into the target container before the given anchor.
-
describeNode
final DescribeNodeResponse describeNode(DescribeNodeRequest input)
Describes node given its id, does not require domain to be enabled. Does not start tracking any objects, can be used for automation.
-
scrollIntoViewIfNeeded
final Unit scrollIntoViewIfNeeded(ScrollIntoViewIfNeededRequest input)
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.
-
discardSearchResults
final Unit discardSearchResults(DiscardSearchResultsRequest input)
Discards search results from the session with the given id.
getSearchResultsshould no longer be called for that search.
-
focus
final Unit focus(FocusRequest input)
Focuses the given element.
-
getAttributes
final GetAttributesResponse getAttributes(GetAttributesRequest input)
Returns attributes for the specified node.
-
getBoxModel
final GetBoxModelResponse getBoxModel(GetBoxModelRequest input)
Returns boxes for the given node.
-
getContentQuads
final GetContentQuadsResponse getContentQuads(GetContentQuadsRequest input)
Returns quads that describe node position on the page. This method might return multiple quads for inline nodes.
-
getDocument
final GetDocumentResponse getDocument(GetDocumentRequest input)
Returns the root DOM node (and optionally the subtree) to the caller.
-
getFlattenedDocument
@Deprecated(message = "Deprecated in the Chrome DevTools protocol") final GetFlattenedDocumentResponse getFlattenedDocument(GetFlattenedDocumentRequest input)
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.
-
getNodesForSubtreeByStyle
final GetNodesForSubtreeByStyleResponse getNodesForSubtreeByStyle(GetNodesForSubtreeByStyleRequest input)
Finds nodes with a given computed style in a subtree.
-
getNodeForLocation
final GetNodeForLocationResponse getNodeForLocation(GetNodeForLocationRequest input)
Returns node id at given location. Depending on whether DOM domain is enabled, nodeId is either returned or not.
-
getOuterHTML
final GetOuterHTMLResponse getOuterHTML(GetOuterHTMLRequest input)
Returns node's HTML markup.
-
getRelayoutBoundary
final GetRelayoutBoundaryResponse getRelayoutBoundary(GetRelayoutBoundaryRequest input)
Returns the id of the nearest ancestor that is a relayout boundary.
-
getSearchResults
final GetSearchResultsResponse getSearchResults(GetSearchResultsRequest input)
Returns search results from given
fromIndexto giventoIndexfrom the search with the given identifier.
-
hideHighlight
final Unit hideHighlight()
Hides any highlight.
-
highlightNode
final Unit highlightNode()
Highlights DOM node.
-
highlightRect
final Unit highlightRect()
Highlights given rectangle.
-
markUndoableState
final Unit markUndoableState()
Marks last undoable state.
-
moveTo
final MoveToResponse moveTo(MoveToRequest input)
Moves node into the new container, places it before the given anchor.
-
performSearch
final PerformSearchResponse performSearch(PerformSearchRequest input)
Searches for a given string in the DOM tree. Use
getSearchResultsto access search results orcancelSearchto end this search session.
-
pushNodeByPathToFrontend
final PushNodeByPathToFrontendResponse pushNodeByPathToFrontend(PushNodeByPathToFrontendRequest input)
Requests that the node is sent to the caller given its path. // FIXME, use XPath
-
pushNodesByBackendIdsToFrontend
final PushNodesByBackendIdsToFrontendResponse pushNodesByBackendIdsToFrontend(PushNodesByBackendIdsToFrontendRequest input)
Requests that a batch of nodes is sent to the caller given their backend node ids.
-
querySelector
final QuerySelectorResponse querySelector(QuerySelectorRequest input)
Executes
querySelectoron a given node.
-
querySelectorAll
final QuerySelectorAllResponse querySelectorAll(QuerySelectorAllRequest input)
Executes
querySelectorAllon a given node.
-
removeAttribute
final Unit removeAttribute(RemoveAttributeRequest input)
Removes attribute with given name from an element with given id.
-
removeNode
final Unit removeNode(RemoveNodeRequest input)
Removes node with given id.
-
requestChildNodes
final Unit requestChildNodes(RequestChildNodesRequest input)
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.
-
requestNode
final RequestNodeResponse requestNode(RequestNodeRequest input)
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.
-
resolveNode
final ResolveNodeResponse resolveNode(ResolveNodeRequest input)
Resolves the JavaScript node object for a given NodeId or BackendNodeId.
-
setAttributeValue
final Unit setAttributeValue(SetAttributeValueRequest input)
Sets attribute for an element with given id.
-
setAttributesAsText
final Unit setAttributesAsText(SetAttributesAsTextRequest input)
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.
-
setFileInputFiles
final Unit setFileInputFiles(SetFileInputFilesRequest input)
Sets files for the given file input element.
-
setNodeStackTracesEnabled
final Unit setNodeStackTracesEnabled(SetNodeStackTracesEnabledRequest input)
Sets if stack traces should be captured for Nodes. See
Node.getNodeStackTraces. Default is disabled.
-
getNodeStackTraces
final GetNodeStackTracesResponse getNodeStackTraces(GetNodeStackTracesRequest input)
Gets stack traces associated with a Node. As of now, only provides stack trace for Node creation.
-
getFileInfo
final GetFileInfoResponse getFileInfo(GetFileInfoRequest input)
Returns file information for the given File wrapper.
-
setInspectedNode
final Unit setInspectedNode(SetInspectedNodeRequest input)
Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).
-
setNodeName
final SetNodeNameResponse setNodeName(SetNodeNameRequest input)
Sets node name for a node with given id.
-
setNodeValue
final Unit setNodeValue(SetNodeValueRequest input)
Sets node value for a node with given id.
-
setOuterHTML
final Unit setOuterHTML(SetOuterHTMLRequest input)
Sets node HTML markup, returns new node id.
-
getFrameOwner
final GetFrameOwnerResponse getFrameOwner(GetFrameOwnerRequest input)
Returns iframe node that owns iframe with the given domain.
-
-
-
-