1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// @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 `BrowserLauncher` (puppeteer-core 25.12.0), a remote object
/// served by `browser-commander serve --stdio`.
BrowserLauncher
);
impl BrowserLauncher {
/// `BrowserLauncher.browser`
///
/// ```text
/// get browser(): SupportedBrowser
/// ```
pub async fn browser(&self) -> Result<String, BridgeError> {
self.remote.get("browser").await
}
/// `BrowserLauncher.launch`
///
/// ```text
/// launch(options?: LaunchOptions): Promise<Browser>
/// ```
pub async fn launch(&self, options: Option<Value>) -> Result<Browser, BridgeError> {
self.remote.call("launch", vec![options]).await
}
/// `BrowserLauncher.executablePath`
///
/// ```text
/// executablePath(channel?: ChromeReleaseChannel, validatePath?: boolean): Promise<string>
/// ```
pub async fn executable_path(&self, channel: Option<&str>, validate_path: Option<bool>) -> Result<String, BridgeError> {
self.remote.call("executablePath", vec![channel.map(|x| Value::from(x)), validate_path.map(|x| Value::from(x))]).await
}
/// `BrowserLauncher.defaultArgs`
///
/// ```text
/// defaultArgs(object: LaunchOptions): string[]
/// ```
pub async fn default_args(&self, object: Value) -> Result<Vec<String>, BridgeError> {
self.remote.call("defaultArgs", vec![Some(object)]).await
}
}