browser-commander 0.17.0

Universal browser automation library that supports multiple browser engines with a unified API
Documentation
// @generated by scripts/generate-puppeteer-bindings.mjs from
// rust/protocol/puppeteer/api.json. Do not edit by hand.

#![allow(clippy::all, missing_docs, unused_imports, non_snake_case)]

use serde_json::Value;

use super::*;
use crate::puppeteer::bridge::{binary, remote_type, BridgeError, JsFunction, Remote};

remote_type!(
    /// Puppeteer's `ConsoleMessage` (puppeteer-core 25.10.0), a remote object
    /// served by `browser-commander serve --stdio`.
    ConsoleMessage
);

impl ConsoleMessage {
    /// `ConsoleMessage.type`
    ///
    /// ```text
    /// type(): ConsoleMessageType
    /// ```
    pub async fn r#type(&self) -> Result<String, BridgeError> {
        self.remote.call("type", vec![]).await
    }

    /// `ConsoleMessage.text`
    ///
    /// ```text
    /// text(): string
    /// ```
    pub async fn text(&self) -> Result<String, BridgeError> {
        self.remote.call("text", vec![]).await
    }

    /// `ConsoleMessage.args`
    ///
    /// ```text
    /// args(): JSHandle[]
    /// ```
    pub async fn args(&self) -> Result<Vec<JSHandle>, BridgeError> {
        self.remote.call("args", vec![]).await
    }

    /// `ConsoleMessage.location`
    ///
    /// ```text
    /// location(): ConsoleMessageLocation
    /// ```
    pub async fn location(&self) -> Result<Value, BridgeError> {
        self.remote.call("location", vec![]).await
    }

    /// `ConsoleMessage.stackTrace`
    ///
    /// ```text
    /// stackTrace(): ConsoleMessageLocation[]
    /// ```
    pub async fn stack_trace(&self) -> Result<Vec<Value>, BridgeError> {
        self.remote.call("stackTrace", vec![]).await
    }
}