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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
// @generated by `just generate-methods` from protocol/*.json.
// Do not edit by hand; edit xtask/ and regenerate.
//! The Browser domain defines methods and events for browser managing.
//!
//! Method names for the `Browser` domain, for use with
//! [`CdpClient::call`](crate::CdpClient::call).
/// Set permission settings for given embedding and embedded origins.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `permission`: PermissionDescriptor
/// - `setting`: PermissionSetting
/// - `origin`: string (optional)
/// - `embeddedOrigin`: string (optional)
/// - `browserContextId`: BrowserContextID (optional)
pub const SET_PERMISSION: &str = "Browser.setPermission";
/// Grant specific permissions to the given origin and reject all others.
/// Deprecated. Use setPermission instead.
///
/// Deprecated in the protocol.
/// Experimental: may change without notice.
///
/// Parameters:
/// - `permissions`: array
/// - `origin`: string (optional)
/// - `browserContextId`: BrowserContextID (optional)
pub const GRANT_PERMISSIONS: &str = "Browser.grantPermissions";
/// Reset all permission management for all origins.
///
/// Parameters:
/// - `browserContextId`: BrowserContextID (optional)
pub const RESET_PERMISSIONS: &str = "Browser.resetPermissions";
/// Set the behavior when downloading a file.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `behavior`: string
/// - `browserContextId`: BrowserContextID (optional)
/// - `downloadPath`: string (optional)
/// - `eventsEnabled`: boolean (optional)
pub const SET_DOWNLOAD_BEHAVIOR: &str = "Browser.setDownloadBehavior";
/// Cancel a download if in progress
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `guid`: string
/// - `browserContextId`: BrowserContextID (optional)
pub const CANCEL_DOWNLOAD: &str = "Browser.cancelDownload";
/// Close browser gracefully.
pub const CLOSE: &str = "Browser.close";
/// Crashes browser on the main thread.
///
/// Experimental: may change without notice.
pub const CRASH: &str = "Browser.crash";
/// Crashes GPU process.
///
/// Experimental: may change without notice.
pub const CRASH_GPU_PROCESS: &str = "Browser.crashGpuProcess";
/// Returns version information.
///
/// Returns: `protocolVersion`, `product`, `revision`, `userAgent`, `jsVersion`
pub const GET_VERSION: &str = "Browser.getVersion";
/// Returns the command line switches for the browser process if, and only if
/// --enable-automation is on the commandline.
///
/// Experimental: may change without notice.
///
/// Returns: `arguments`
pub const GET_BROWSER_COMMAND_LINE: &str = "Browser.getBrowserCommandLine";
/// Get Chrome histograms.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `query`: string (optional)
/// - `delta`: boolean (optional)
///
/// Returns: `histograms`
pub const GET_HISTOGRAMS: &str = "Browser.getHistograms";
/// Get a Chrome histogram by name.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `name`: string
/// - `delta`: boolean (optional)
///
/// Returns: `histogram`
pub const GET_HISTOGRAM: &str = "Browser.getHistogram";
/// Get position and size of the browser window.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `windowId`: WindowID
///
/// Returns: `bounds`
pub const GET_WINDOW_BOUNDS: &str = "Browser.getWindowBounds";
/// Get the browser window that contains the devtools target.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `targetId`: Target.TargetID (optional)
///
/// Returns: `windowId`, `bounds`
pub const GET_WINDOW_FOR_TARGET: &str = "Browser.getWindowForTarget";
/// Set position and/or size of the browser window.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `windowId`: WindowID
/// - `bounds`: Bounds
pub const SET_WINDOW_BOUNDS: &str = "Browser.setWindowBounds";
/// Set size of the browser contents resizing browser window as necessary.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `windowId`: WindowID
/// - `width`: integer (optional)
/// - `height`: integer (optional)
pub const SET_CONTENTS_SIZE: &str = "Browser.setContentsSize";
/// Set dock tile details, platform-specific.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `badgeLabel`: string (optional)
/// - `image`: string (optional)
pub const SET_DOCK_TILE: &str = "Browser.setDockTile";
/// Invoke custom browser commands used by telemetry.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `commandId`: BrowserCommandId
pub const EXECUTE_BROWSER_COMMAND: &str = "Browser.executeBrowserCommand";
/// Allows a site to use privacy sandbox features that require enrollment
/// without the site actually being enrolled. Only supported on page targets.
///
/// Parameters:
/// - `url`: string
pub const ADD_PRIVACY_SANDBOX_ENROLLMENT_OVERRIDE: &str =
"Browser.addPrivacySandboxEnrollmentOverride";