pub struct DOMClient { /* private fields */ }Expand description
Client for DOM domain commands.
Implementations§
Source§impl DOMClient
impl DOMClient
Sourcepub async fn collect_class_names_from_subtree(
&self,
params: CollectClassNamesFromSubtreeParams,
session_id: Option<&str>,
) -> Result<CollectClassNamesFromSubtreeReturns, CdpError>
pub async fn collect_class_names_from_subtree( &self, params: CollectClassNamesFromSubtreeParams, session_id: Option<&str>, ) -> Result<CollectClassNamesFromSubtreeReturns, CdpError>
Collects class names for the node with given id and all of it’s child nodes.
Sourcepub async fn copy_to(
&self,
params: CopyToParams,
session_id: Option<&str>,
) -> Result<CopyToReturns, CdpError>
pub async fn copy_to( &self, params: CopyToParams, session_id: Option<&str>, ) -> Result<CopyToReturns, CdpError>
Creates a deep copy of the specified node and places it into the target container before the given anchor.
Sourcepub async fn describe_node(
&self,
params: DescribeNodeParams,
session_id: Option<&str>,
) -> Result<DescribeNodeReturns, CdpError>
pub async fn describe_node( &self, params: DescribeNodeParams, session_id: Option<&str>, ) -> Result<DescribeNodeReturns, CdpError>
Describes node given its id, does not require domain to be enabled. Does not start tracking any objects, can be used for automation.
Sourcepub async fn scroll_into_view_if_needed(
&self,
params: ScrollIntoViewIfNeededParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn scroll_into_view_if_needed( &self, params: ScrollIntoViewIfNeededParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
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.
Sourcepub async fn disable(&self, session_id: Option<&str>) -> Result<Value, CdpError>
pub async fn disable(&self, session_id: Option<&str>) -> Result<Value, CdpError>
Disables DOM agent for the given page.
Sourcepub async fn discard_search_results(
&self,
params: DiscardSearchResultsParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn discard_search_results( &self, params: DiscardSearchResultsParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
Discards search results from the session with the given id. getSearchResults should no longer
be called for that search.
Sourcepub async fn enable(
&self,
params: EnableParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn enable( &self, params: EnableParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
Enables DOM agent for the given page.
Sourcepub async fn focus(
&self,
params: FocusParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn focus( &self, params: FocusParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
Focuses the given element.
Sourcepub async fn get_attributes(
&self,
params: GetAttributesParams,
session_id: Option<&str>,
) -> Result<GetAttributesReturns, CdpError>
pub async fn get_attributes( &self, params: GetAttributesParams, session_id: Option<&str>, ) -> Result<GetAttributesReturns, CdpError>
Returns attributes for the specified node.
Sourcepub async fn get_box_model(
&self,
params: GetBoxModelParams,
session_id: Option<&str>,
) -> Result<GetBoxModelReturns, CdpError>
pub async fn get_box_model( &self, params: GetBoxModelParams, session_id: Option<&str>, ) -> Result<GetBoxModelReturns, CdpError>
Returns boxes for the given node.
Sourcepub async fn get_content_quads(
&self,
params: GetContentQuadsParams,
session_id: Option<&str>,
) -> Result<GetContentQuadsReturns, CdpError>
pub async fn get_content_quads( &self, params: GetContentQuadsParams, session_id: Option<&str>, ) -> Result<GetContentQuadsReturns, CdpError>
Returns quads that describe node position on the page. This method might return multiple quads for inline nodes.
Sourcepub async fn get_document(
&self,
params: GetDocumentParams,
session_id: Option<&str>,
) -> Result<GetDocumentReturns, CdpError>
pub async fn get_document( &self, params: GetDocumentParams, session_id: Option<&str>, ) -> Result<GetDocumentReturns, CdpError>
Returns the root DOM node (and optionally the subtree) to the caller. Implicitly enables the DOM domain events for the current target.
Sourcepub async fn get_flattened_document(
&self,
params: GetFlattenedDocumentParams,
session_id: Option<&str>,
) -> Result<GetFlattenedDocumentReturns, CdpError>
pub async fn get_flattened_document( &self, params: GetFlattenedDocumentParams, session_id: Option<&str>, ) -> Result<GetFlattenedDocumentReturns, CdpError>
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.
Sourcepub async fn get_nodes_for_subtree_by_style(
&self,
params: GetNodesForSubtreeByStyleParams,
session_id: Option<&str>,
) -> Result<GetNodesForSubtreeByStyleReturns, CdpError>
pub async fn get_nodes_for_subtree_by_style( &self, params: GetNodesForSubtreeByStyleParams, session_id: Option<&str>, ) -> Result<GetNodesForSubtreeByStyleReturns, CdpError>
Finds nodes with a given computed style in a subtree.
Sourcepub async fn get_node_for_location(
&self,
params: GetNodeForLocationParams,
session_id: Option<&str>,
) -> Result<GetNodeForLocationReturns, CdpError>
pub async fn get_node_for_location( &self, params: GetNodeForLocationParams, session_id: Option<&str>, ) -> Result<GetNodeForLocationReturns, CdpError>
Returns node id at given location. Depending on whether DOM domain is enabled, nodeId is either returned or not.
Sourcepub async fn get_outer_html(
&self,
params: GetOuterHtmlParams,
session_id: Option<&str>,
) -> Result<GetOuterHtmlReturns, CdpError>
pub async fn get_outer_html( &self, params: GetOuterHtmlParams, session_id: Option<&str>, ) -> Result<GetOuterHtmlReturns, CdpError>
Returns node’s HTML markup.
Sourcepub async fn get_relayout_boundary(
&self,
params: GetRelayoutBoundaryParams,
session_id: Option<&str>,
) -> Result<GetRelayoutBoundaryReturns, CdpError>
pub async fn get_relayout_boundary( &self, params: GetRelayoutBoundaryParams, session_id: Option<&str>, ) -> Result<GetRelayoutBoundaryReturns, CdpError>
Returns the id of the nearest ancestor that is a relayout boundary.
Sourcepub async fn get_search_results(
&self,
params: GetSearchResultsParams,
session_id: Option<&str>,
) -> Result<GetSearchResultsReturns, CdpError>
pub async fn get_search_results( &self, params: GetSearchResultsParams, session_id: Option<&str>, ) -> Result<GetSearchResultsReturns, CdpError>
Returns search results from given fromIndex to given toIndex from the search with the given
identifier.
Sourcepub async fn hide_highlight(
&self,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn hide_highlight( &self, session_id: Option<&str>, ) -> Result<Value, CdpError>
Hides any highlight.
Sourcepub async fn highlight_node(
&self,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn highlight_node( &self, session_id: Option<&str>, ) -> Result<Value, CdpError>
Highlights DOM node.
Sourcepub async fn highlight_rect(
&self,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn highlight_rect( &self, session_id: Option<&str>, ) -> Result<Value, CdpError>
Highlights given rectangle.
Sourcepub async fn mark_undoable_state(
&self,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn mark_undoable_state( &self, session_id: Option<&str>, ) -> Result<Value, CdpError>
Marks last undoable state.
Sourcepub async fn move_to(
&self,
params: MoveToParams,
session_id: Option<&str>,
) -> Result<MoveToReturns, CdpError>
pub async fn move_to( &self, params: MoveToParams, session_id: Option<&str>, ) -> Result<MoveToReturns, CdpError>
Moves node into the new container, places it before the given anchor.
Sourcepub async fn perform_search(
&self,
params: PerformSearchParams,
session_id: Option<&str>,
) -> Result<PerformSearchReturns, CdpError>
pub async fn perform_search( &self, params: PerformSearchParams, session_id: Option<&str>, ) -> Result<PerformSearchReturns, CdpError>
Searches for a given string in the DOM tree. Use getSearchResults to access search results or
cancelSearch to end this search session.
Sourcepub async fn push_node_by_path_to_frontend(
&self,
params: PushNodeByPathToFrontendParams,
session_id: Option<&str>,
) -> Result<PushNodeByPathToFrontendReturns, CdpError>
pub async fn push_node_by_path_to_frontend( &self, params: PushNodeByPathToFrontendParams, session_id: Option<&str>, ) -> Result<PushNodeByPathToFrontendReturns, CdpError>
Requests that the node is sent to the caller given its path. // FIXME, use XPath
Sourcepub async fn push_nodes_by_backend_ids_to_frontend(
&self,
params: PushNodesByBackendIdsToFrontendParams,
session_id: Option<&str>,
) -> Result<PushNodesByBackendIdsToFrontendReturns, CdpError>
pub async fn push_nodes_by_backend_ids_to_frontend( &self, params: PushNodesByBackendIdsToFrontendParams, session_id: Option<&str>, ) -> Result<PushNodesByBackendIdsToFrontendReturns, CdpError>
Requests that a batch of nodes is sent to the caller given their backend node ids.
Sourcepub async fn query_selector(
&self,
params: QuerySelectorParams,
session_id: Option<&str>,
) -> Result<QuerySelectorReturns, CdpError>
pub async fn query_selector( &self, params: QuerySelectorParams, session_id: Option<&str>, ) -> Result<QuerySelectorReturns, CdpError>
Executes querySelector on a given node.
Sourcepub async fn query_selector_all(
&self,
params: QuerySelectorAllParams,
session_id: Option<&str>,
) -> Result<QuerySelectorAllReturns, CdpError>
pub async fn query_selector_all( &self, params: QuerySelectorAllParams, session_id: Option<&str>, ) -> Result<QuerySelectorAllReturns, CdpError>
Executes querySelectorAll on a given node.
Sourcepub async fn get_top_layer_elements(
&self,
session_id: Option<&str>,
) -> Result<GetTopLayerElementsReturns, CdpError>
pub async fn get_top_layer_elements( &self, session_id: Option<&str>, ) -> Result<GetTopLayerElementsReturns, CdpError>
Returns NodeIds of current top layer elements. Top layer is rendered closest to the user within a viewport, therefore its elements always appear on top of all other content.
Sourcepub async fn get_element_by_relation(
&self,
params: GetElementByRelationParams,
session_id: Option<&str>,
) -> Result<GetElementByRelationReturns, CdpError>
pub async fn get_element_by_relation( &self, params: GetElementByRelationParams, session_id: Option<&str>, ) -> Result<GetElementByRelationReturns, CdpError>
Returns the NodeId of the matched element according to certain relations.
Sourcepub async fn redo(&self, session_id: Option<&str>) -> Result<Value, CdpError>
pub async fn redo(&self, session_id: Option<&str>) -> Result<Value, CdpError>
Re-does the last undone action.
Sourcepub async fn remove_attribute(
&self,
params: RemoveAttributeParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn remove_attribute( &self, params: RemoveAttributeParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
Removes attribute with given name from an element with given id.
Sourcepub async fn remove_node(
&self,
params: RemoveNodeParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn remove_node( &self, params: RemoveNodeParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
Removes node with given id.
Sourcepub async fn request_child_nodes(
&self,
params: RequestChildNodesParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn request_child_nodes( &self, params: RequestChildNodesParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
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.
Sourcepub async fn request_node(
&self,
params: RequestNodeParams,
session_id: Option<&str>,
) -> Result<RequestNodeReturns, CdpError>
pub async fn request_node( &self, params: RequestNodeParams, session_id: Option<&str>, ) -> Result<RequestNodeReturns, CdpError>
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.
Sourcepub async fn resolve_node(
&self,
params: ResolveNodeParams,
session_id: Option<&str>,
) -> Result<ResolveNodeReturns, CdpError>
pub async fn resolve_node( &self, params: ResolveNodeParams, session_id: Option<&str>, ) -> Result<ResolveNodeReturns, CdpError>
Resolves the JavaScript node object for a given NodeId or BackendNodeId.
Sourcepub async fn set_attribute_value(
&self,
params: SetAttributeValueParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn set_attribute_value( &self, params: SetAttributeValueParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
Sets attribute for an element with given id.
Sourcepub async fn set_attributes_as_text(
&self,
params: SetAttributesAsTextParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn set_attributes_as_text( &self, params: SetAttributesAsTextParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
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.
Sourcepub async fn set_file_input_files(
&self,
params: SetFileInputFilesParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn set_file_input_files( &self, params: SetFileInputFilesParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
Sets files for the given file input element.
Sourcepub async fn set_node_stack_traces_enabled(
&self,
params: SetNodeStackTracesEnabledParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn set_node_stack_traces_enabled( &self, params: SetNodeStackTracesEnabledParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
Sets if stack traces should be captured for Nodes. See Node.getNodeStackTraces. Default is disabled.
Sourcepub async fn get_node_stack_traces(
&self,
params: GetNodeStackTracesParams,
session_id: Option<&str>,
) -> Result<GetNodeStackTracesReturns, CdpError>
pub async fn get_node_stack_traces( &self, params: GetNodeStackTracesParams, session_id: Option<&str>, ) -> Result<GetNodeStackTracesReturns, CdpError>
Gets stack traces associated with a Node. As of now, only provides stack trace for Node creation.
Sourcepub async fn get_file_info(
&self,
params: GetFileInfoParams,
session_id: Option<&str>,
) -> Result<GetFileInfoReturns, CdpError>
pub async fn get_file_info( &self, params: GetFileInfoParams, session_id: Option<&str>, ) -> Result<GetFileInfoReturns, CdpError>
Returns file information for the given File wrapper.
Sourcepub async fn get_detached_dom_nodes(
&self,
session_id: Option<&str>,
) -> Result<GetDetachedDomNodesReturns, CdpError>
pub async fn get_detached_dom_nodes( &self, session_id: Option<&str>, ) -> Result<GetDetachedDomNodesReturns, CdpError>
Returns list of detached nodes
Sourcepub async fn set_inspected_node(
&self,
params: SetInspectedNodeParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn set_inspected_node( &self, params: SetInspectedNodeParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).
Sourcepub async fn set_node_name(
&self,
params: SetNodeNameParams,
session_id: Option<&str>,
) -> Result<SetNodeNameReturns, CdpError>
pub async fn set_node_name( &self, params: SetNodeNameParams, session_id: Option<&str>, ) -> Result<SetNodeNameReturns, CdpError>
Sets node name for a node with given id.
Sourcepub async fn set_node_value(
&self,
params: SetNodeValueParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn set_node_value( &self, params: SetNodeValueParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
Sets node value for a node with given id.
Sourcepub async fn set_outer_html(
&self,
params: SetOuterHtmlParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn set_outer_html( &self, params: SetOuterHtmlParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
Sets node HTML markup, returns new node id.
Sourcepub async fn undo(&self, session_id: Option<&str>) -> Result<Value, CdpError>
pub async fn undo(&self, session_id: Option<&str>) -> Result<Value, CdpError>
Undoes the last performed action.
Sourcepub async fn get_frame_owner(
&self,
params: GetFrameOwnerParams,
session_id: Option<&str>,
) -> Result<GetFrameOwnerReturns, CdpError>
pub async fn get_frame_owner( &self, params: GetFrameOwnerParams, session_id: Option<&str>, ) -> Result<GetFrameOwnerReturns, CdpError>
Returns iframe node that owns iframe with the given domain.
Sourcepub async fn get_container_for_node(
&self,
params: GetContainerForNodeParams,
session_id: Option<&str>,
) -> Result<GetContainerForNodeReturns, CdpError>
pub async fn get_container_for_node( &self, params: GetContainerForNodeParams, session_id: Option<&str>, ) -> Result<GetContainerForNodeReturns, CdpError>
Returns the query container of the given node based on container query conditions: containerName, physical and logical axes, and whether it queries scroll-state or anchored elements. If no axes are provided and queriesScrollState is false, the style container is returned, which is the direct parent or the closest element with a matching container-name.
Sourcepub async fn get_querying_descendants_for_container(
&self,
params: GetQueryingDescendantsForContainerParams,
session_id: Option<&str>,
) -> Result<GetQueryingDescendantsForContainerReturns, CdpError>
pub async fn get_querying_descendants_for_container( &self, params: GetQueryingDescendantsForContainerParams, session_id: Option<&str>, ) -> Result<GetQueryingDescendantsForContainerReturns, CdpError>
Returns the descendants of a container query container that have container queries against this container.
Sourcepub async fn get_anchor_element(
&self,
params: GetAnchorElementParams,
session_id: Option<&str>,
) -> Result<GetAnchorElementReturns, CdpError>
pub async fn get_anchor_element( &self, params: GetAnchorElementParams, session_id: Option<&str>, ) -> Result<GetAnchorElementReturns, CdpError>
Returns the target anchor element of the given anchor query according to https://www.w3.org/TR/css-anchor-position-1/#target.
Sourcepub async fn force_show_popover(
&self,
params: ForceShowPopoverParams,
session_id: Option<&str>,
) -> Result<ForceShowPopoverReturns, CdpError>
pub async fn force_show_popover( &self, params: ForceShowPopoverParams, session_id: Option<&str>, ) -> Result<ForceShowPopoverReturns, CdpError>
When enabling, this API force-opens the popover identified by nodeId and keeps it open until disabled.