Skip to main content

browser_commander/puppeteer/api/
page_2.rs

1// @generated by scripts/generate-puppeteer-bindings.mjs from
2// rust/protocol/puppeteer/api.json. Do not edit by hand.
3
4#![allow(clippy::all, missing_docs, unused_imports, non_snake_case)]
5
6use serde_json::Value;
7
8use super::*;
9use crate::puppeteer::bridge::{binary, remote_type, BridgeError, JsFunction, Remote};
10
11impl Page {
12    /// `Page.resize`
13    ///
14    /// ```text
15    /// resize(params: { contentWidth: number; contentHeight: number; }): Promise<void>
16    /// ```
17    pub async fn resize(&self, params: Value) -> Result<(), BridgeError> {
18        self.remote.call("resize", vec![Some(params)]).await
19    }
20
21    /// `Page.windowId`
22    ///
23    /// ```text
24    /// windowId(): Promise<WindowId>
25    /// ```
26    pub async fn window_id(&self) -> Result<String, BridgeError> {
27        self.remote.call("windowId", vec![]).await
28    }
29
30    /// `Page.openDevTools`
31    ///
32    /// ```text
33    /// openDevTools(): Promise<Page>
34    /// ```
35    pub async fn open_dev_tools(&self) -> Result<Page, BridgeError> {
36        self.remote.call("openDevTools", vec![]).await
37    }
38
39    /// `Page.hasDevTools`
40    ///
41    /// ```text
42    /// hasDevTools(): Promise<boolean>
43    /// ```
44    pub async fn has_dev_tools(&self) -> Result<bool, BridgeError> {
45        self.remote.call("hasDevTools", vec![]).await
46    }
47
48    /// `Page.bluetooth`
49    ///
50    /// ```text
51    /// get bluetooth(): BluetoothEmulation
52    /// ```
53    pub async fn bluetooth(&self) -> Result<BluetoothEmulation, BridgeError> {
54        self.remote.get("bluetooth").await
55    }
56
57    /// `Page.triggerExtensionAction`
58    ///
59    /// ```text
60    /// triggerExtensionAction(extension: Extension): Promise<void>
61    /// ```
62    pub async fn trigger_extension_action(&self, extension: &Extension) -> Result<(), BridgeError> {
63        self.remote.call("triggerExtensionAction", vec![Some(extension.remote().to_wire())]).await
64    }
65
66    /// `Page.extensionRealms`
67    ///
68    /// ```text
69    /// extensionRealms(): Realm[]
70    /// ```
71    pub async fn extension_realms(&self) -> Result<Vec<Realm>, BridgeError> {
72        self.remote.call("extensionRealms", vec![]).await
73    }
74}