Skip to content

armgit / moli

Public Imported from GitHub
0

Best headless browser for AI agents. Lite, Fast, High-Compatibility. Built in Rust

474 B
Raw Blame
use crate::conn::{CdpConnection, TargetEmulationStateUpdate};

pub(super) fn update_page_emulation_state(
    conn: &mut CdpConnection,
    session_id: Option<&str>,
    f: impl FnOnce(TargetEmulationStateUpdate<'_>),
) -> Result<(), String> {
    if conn.update_emulation_state_for_session_owner(session_id, |state| {
        if let Some(state) = state {
            f(state);
        }
    }) {
        return Ok(());
    }
    Err("BrowserContextNotLoaded".to_owned())
}