cdp_driver/methods/browser.rs
1// @generated by `just generate-methods` from protocol/*.json.
2// Do not edit by hand; edit xtask/ and regenerate.
3
4//! The Browser domain defines methods and events for browser managing.
5//!
6//! Method names for the `Browser` domain, for use with
7//! [`CdpClient::call`](crate::CdpClient::call).
8
9/// Set permission settings for given embedding and embedded origins.
10///
11/// Experimental: may change without notice.
12///
13/// Parameters:
14/// - `permission`: PermissionDescriptor
15/// - `setting`: PermissionSetting
16/// - `origin`: string (optional)
17/// - `embeddedOrigin`: string (optional)
18/// - `browserContextId`: BrowserContextID (optional)
19pub const SET_PERMISSION: &str = "Browser.setPermission";
20
21/// Grant specific permissions to the given origin and reject all others.
22/// Deprecated. Use setPermission instead.
23///
24/// Deprecated in the protocol.
25/// Experimental: may change without notice.
26///
27/// Parameters:
28/// - `permissions`: array
29/// - `origin`: string (optional)
30/// - `browserContextId`: BrowserContextID (optional)
31pub const GRANT_PERMISSIONS: &str = "Browser.grantPermissions";
32
33/// Reset all permission management for all origins.
34///
35/// Parameters:
36/// - `browserContextId`: BrowserContextID (optional)
37pub const RESET_PERMISSIONS: &str = "Browser.resetPermissions";
38
39/// Set the behavior when downloading a file.
40///
41/// Experimental: may change without notice.
42///
43/// Parameters:
44/// - `behavior`: string
45/// - `browserContextId`: BrowserContextID (optional)
46/// - `downloadPath`: string (optional)
47/// - `eventsEnabled`: boolean (optional)
48pub const SET_DOWNLOAD_BEHAVIOR: &str = "Browser.setDownloadBehavior";
49
50/// Cancel a download if in progress
51///
52/// Experimental: may change without notice.
53///
54/// Parameters:
55/// - `guid`: string
56/// - `browserContextId`: BrowserContextID (optional)
57pub const CANCEL_DOWNLOAD: &str = "Browser.cancelDownload";
58
59/// Close browser gracefully.
60pub const CLOSE: &str = "Browser.close";
61
62/// Crashes browser on the main thread.
63///
64/// Experimental: may change without notice.
65pub const CRASH: &str = "Browser.crash";
66
67/// Crashes GPU process.
68///
69/// Experimental: may change without notice.
70pub const CRASH_GPU_PROCESS: &str = "Browser.crashGpuProcess";
71
72/// Returns version information.
73///
74/// Returns: `protocolVersion`, `product`, `revision`, `userAgent`, `jsVersion`
75pub const GET_VERSION: &str = "Browser.getVersion";
76
77/// Returns the command line switches for the browser process if, and only if
78/// --enable-automation is on the commandline.
79///
80/// Experimental: may change without notice.
81///
82/// Returns: `arguments`
83pub const GET_BROWSER_COMMAND_LINE: &str = "Browser.getBrowserCommandLine";
84
85/// Get Chrome histograms.
86///
87/// Experimental: may change without notice.
88///
89/// Parameters:
90/// - `query`: string (optional)
91/// - `delta`: boolean (optional)
92///
93/// Returns: `histograms`
94pub const GET_HISTOGRAMS: &str = "Browser.getHistograms";
95
96/// Get a Chrome histogram by name.
97///
98/// Experimental: may change without notice.
99///
100/// Parameters:
101/// - `name`: string
102/// - `delta`: boolean (optional)
103///
104/// Returns: `histogram`
105pub const GET_HISTOGRAM: &str = "Browser.getHistogram";
106
107/// Get position and size of the browser window.
108///
109/// Experimental: may change without notice.
110///
111/// Parameters:
112/// - `windowId`: WindowID
113///
114/// Returns: `bounds`
115pub const GET_WINDOW_BOUNDS: &str = "Browser.getWindowBounds";
116
117/// Get the browser window that contains the devtools target.
118///
119/// Experimental: may change without notice.
120///
121/// Parameters:
122/// - `targetId`: Target.TargetID (optional)
123///
124/// Returns: `windowId`, `bounds`
125pub const GET_WINDOW_FOR_TARGET: &str = "Browser.getWindowForTarget";
126
127/// Set position and/or size of the browser window.
128///
129/// Experimental: may change without notice.
130///
131/// Parameters:
132/// - `windowId`: WindowID
133/// - `bounds`: Bounds
134pub const SET_WINDOW_BOUNDS: &str = "Browser.setWindowBounds";
135
136/// Set size of the browser contents resizing browser window as necessary.
137///
138/// Experimental: may change without notice.
139///
140/// Parameters:
141/// - `windowId`: WindowID
142/// - `width`: integer (optional)
143/// - `height`: integer (optional)
144pub const SET_CONTENTS_SIZE: &str = "Browser.setContentsSize";
145
146/// Set dock tile details, platform-specific.
147///
148/// Experimental: may change without notice.
149///
150/// Parameters:
151/// - `badgeLabel`: string (optional)
152/// - `image`: string (optional)
153pub const SET_DOCK_TILE: &str = "Browser.setDockTile";
154
155/// Invoke custom browser commands used by telemetry.
156///
157/// Experimental: may change without notice.
158///
159/// Parameters:
160/// - `commandId`: BrowserCommandId
161pub const EXECUTE_BROWSER_COMMAND: &str = "Browser.executeBrowserCommand";
162
163/// Allows a site to use privacy sandbox features that require enrollment
164/// without the site actually being enrolled. Only supported on page targets.
165///
166/// Parameters:
167/// - `url`: string
168pub const ADD_PRIVACY_SANDBOX_ENROLLMENT_OVERRIDE: &str =
169 "Browser.addPrivacySandboxEnrollmentOverride";