MCPcopy Create free account
hub / github.com/aeroxy/chrome-devtools-cli / hover

Function hover

src/commands/input.rs:222–233  ·  view source on GitHub ↗

Hover over an element identified by CSS selector.

(
    client: &mut CdpClient,
    session_id: &str,
    selector: &str,
)

Source from the content-addressed store, hash-verified

220
221/// Hover over an element identified by CSS selector.
222pub async fn hover(
223 client: &mut CdpClient,
224 session_id: &str,
225 selector: &str,
226) -> Result<CommandResult> {
227 let initial_url = client.current_url(session_id).await?;
228 let (x, y) = get_element_center(client, session_id, selector).await?;
229 dispatch_mouse(client, session_id, "mouseMoved", x, y, "none", 0).await?;
230 let new_url = client.current_url(session_id).await?;
231 Ok(CommandResult::output(format!("Hovered: {selector}"))
232 .with_navigated_to_if_changed(new_url, initial_url))
233}
234
235/// Fill an input field identified by CSS selector with the given value.
236pub async fn fill(

Callers 2

run_directFunction · 0.85
inner_executeFunction · 0.85

Calls 4

get_element_centerFunction · 0.85
dispatch_mouseFunction · 0.85
current_urlMethod · 0.80

Tested by

no test coverage detected