Skip to main content

type_focused

Function type_focused 

Source
pub async fn type_focused(
    c: &CdpClient,
    sid: &str,
    text: &str,
    press_sequentially: bool,
    submit: bool,
) -> Result<()>
Expand description

Type into whatever currently has focus, with no node id.

This is the sink for piped input (browser-control type --stdin): the caller focuses the field by other means — a ref-based click, or Tab — and the value arrives over a pipe without ever passing through the caller’s own memory.

Existing content is selected first so the insert replaces rather than appends, matching type_text. If nothing has focus, the selection step is skipped and the text still goes to the page’s default target.