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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// @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 `Extension` (puppeteer-core 25.12.0), a remote object
/// served by `browser-commander serve --stdio`.
Extension
);
impl Extension {
/// `Extension.enabled`
///
/// ```text
/// get enabled(): boolean
/// ```
pub async fn enabled(&self) -> Result<bool, BridgeError> {
self.remote.get("enabled").await
}
/// `Extension.path`
///
/// ```text
/// get path(): string
/// ```
pub async fn path(&self) -> Result<String, BridgeError> {
self.remote.get("path").await
}
/// `Extension.version`
///
/// ```text
/// get version(): string
/// ```
pub async fn version(&self) -> Result<String, BridgeError> {
self.remote.get("version").await
}
/// `Extension.name`
///
/// ```text
/// get name(): string
/// ```
pub async fn name(&self) -> Result<String, BridgeError> {
self.remote.get("name").await
}
/// `Extension.id`
///
/// ```text
/// get id(): string
/// ```
pub async fn id(&self) -> Result<String, BridgeError> {
self.remote.get("id").await
}
/// `Extension.workers`
///
/// ```text
/// workers(): Promise<WebWorker[]>
/// ```
pub async fn workers(&self) -> Result<Vec<WebWorker>, BridgeError> {
self.remote.call("workers", vec![]).await
}
/// `Extension.pages`
///
/// ```text
/// pages(): Promise<Page[]>
/// ```
pub async fn pages(&self) -> Result<Vec<Page>, BridgeError> {
self.remote.call("pages", vec![]).await
}
/// `Extension.triggerAction`
///
/// ```text
/// triggerAction(page: Page): Promise<void>
/// ```
pub async fn trigger_action(&self, page: &Page) -> Result<(), BridgeError> {
self.remote.call("triggerAction", vec![Some(page.remote().to_wire())]).await
}
}