INNER CODE UNIT · Rust

Some

keon/browser-control · src/actions.rs:190

        if let Some(cmd) = editing_command(modifiers, &key) {
            down["commands"] = json!([cmd]);
        }
    } else if let Some(t) = &text {
        down["text"] = json!(t);
    }
    c.call("Input.dispatchKeyEvent", down, true).await?;
    let mut up = base;
    up["type"] = json!("keyUp");
    c.call("Input.dispatchKeyEvent", up, true).await?;
    Ok(())
}

pub async fn upload(c: &mut Cdp, selector: &str, paths: &[String]) -> Result<()> {
    let doc = c.call("DOM.getDocument", json!({}), true).await?["root"]["nodeId"]
        .as_i64()
        .context("nodeId")?;
    let node = c

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…