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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
// @generated by `just generate-methods` from protocol/*.json.
// Do not edit by hand; edit xtask/ and regenerate.
//! Supports additional targets discovery and allows to attach to them.
//!
//! Method names for the `Target` domain, for use with
//! [`CdpClient::call`](crate::CdpClient::call).
/// Activates (focuses) the target.
///
/// Parameters:
/// - `targetId`: TargetID
pub const ACTIVATE_TARGET: &str = "Target.activateTarget";
/// Attaches to the target with given id.
///
/// Parameters:
/// - `targetId`: TargetID
/// - `flatten`: boolean (optional)
///
/// Returns: `sessionId`
pub const ATTACH_TO_TARGET: &str = "Target.attachToTarget";
/// Attaches to the browser target, only uses flat sessionId mode.
///
/// Experimental: may change without notice.
///
/// Returns: `sessionId`
pub const ATTACH_TO_BROWSER_TARGET: &str = "Target.attachToBrowserTarget";
/// Closes the target. If the target is a page that gets closed too.
///
/// Parameters:
/// - `targetId`: TargetID
///
/// Returns: `success`
pub const CLOSE_TARGET: &str = "Target.closeTarget";
/// Inject object to the target's main frame that provides a communication
/// channel with browser target. Injected object will be available as
/// `window\[bindingName\]`. The object has the following API: -
/// `binding.send(json)` - a method to send messages over the remote debugging
/// protocol - `binding.onmessage = json =\> handleMessage(json)` - a callback
/// that will be called for the protocol notifications and command responses.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `targetId`: TargetID
/// - `bindingName`: string (optional)
/// - `inheritPermissions`: boolean (optional)
pub const EXPOSE_DEV_TOOLS_PROTOCOL: &str = "Target.exposeDevToolsProtocol";
/// Creates a new empty BrowserContext. Similar to an incognito profile but
/// you can have more than one.
///
/// Parameters:
/// - `disposeOnDetach`: boolean (optional)
/// - `proxyServer`: string (optional)
/// - `proxyBypassList`: string (optional)
/// - `originsWithUniversalNetworkAccess`: array (optional)
///
/// Returns: `browserContextId`
pub const CREATE_BROWSER_CONTEXT: &str = "Target.createBrowserContext";
/// Returns all browser contexts created with `Target.createBrowserContext`
/// method.
///
/// Returns: `browserContextIds`, `defaultBrowserContextId`
pub const GET_BROWSER_CONTEXTS: &str = "Target.getBrowserContexts";
/// Creates a new page.
///
/// Parameters:
/// - `url`: string
/// - `left`: integer (optional)
/// - `top`: integer (optional)
/// - `width`: integer (optional)
/// - `height`: integer (optional)
/// - `windowState`: WindowState (optional)
/// - `browserContextId`: Browser.BrowserContextID (optional)
/// - `enableBeginFrameControl`: boolean (optional)
/// - `newWindow`: boolean (optional)
/// - `background`: boolean (optional)
/// - `forTab`: boolean (optional)
/// - `hidden`: boolean (optional)
/// - `focus`: boolean (optional)
///
/// Returns: `targetId`
pub const CREATE_TARGET: &str = "Target.createTarget";
/// Detaches session with given id.
///
/// Parameters:
/// - `sessionId`: SessionID (optional)
/// - `targetId`: TargetID (optional)
pub const DETACH_FROM_TARGET: &str = "Target.detachFromTarget";
/// Deletes a BrowserContext. All the belonging pages will be closed without
/// calling their beforeunload hooks.
///
/// Parameters:
/// - `browserContextId`: Browser.BrowserContextID
pub const DISPOSE_BROWSER_CONTEXT: &str = "Target.disposeBrowserContext";
/// Returns information about a target.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `targetId`: TargetID (optional)
///
/// Returns: `targetInfo`
pub const GET_TARGET_INFO: &str = "Target.getTargetInfo";
/// Retrieves a list of available targets.
///
/// Parameters:
/// - `filter`: TargetFilter (optional)
///
/// Returns: `targetInfos`
pub const GET_TARGETS: &str = "Target.getTargets";
/// Sends protocol message over session with given id. Consider using flat
/// mode instead; see commands attachToTarget, setAutoAttach, and
/// crbug.com/991325.
///
/// Deprecated in the protocol.
///
/// Parameters:
/// - `message`: string
/// - `sessionId`: SessionID (optional)
/// - `targetId`: TargetID (optional)
pub const SEND_MESSAGE_TO_TARGET: &str = "Target.sendMessageToTarget";
/// Controls whether to automatically attach to new targets which are
/// considered to be directly related to this one (for example, iframes or
/// workers). When turned on, attaches to all existing related targets as
/// well. When turned off, automatically detaches from all currently attached
/// targets. This also clears all targets added by `autoAttachRelated` from
/// the list of targets to watch for creation of related targets. You might
/// want to call this recursively for auto-attached targets to attach to all
/// available targets.
///
/// Parameters:
/// - `autoAttach`: boolean
/// - `waitForDebuggerOnStart`: boolean
/// - `flatten`: boolean (optional)
/// - `filter`: TargetFilter (optional)
pub const SET_AUTO_ATTACH: &str = "Target.setAutoAttach";
/// Adds the specified target to the list of targets that will be monitored
/// for any related target creation (such as child frames, child workers and
/// new versions of service worker) and reported through `attachedToTarget`.
/// The specified target is also auto-attached. This cancels the effect of any
/// previous `setAutoAttach` and is also cancelled by subsequent
/// `setAutoAttach`. Only available at the Browser target.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `targetId`: TargetID
/// - `waitForDebuggerOnStart`: boolean
/// - `filter`: TargetFilter (optional)
pub const AUTO_ATTACH_RELATED: &str = "Target.autoAttachRelated";
/// Controls whether to discover available targets and notify via
/// `targetCreated/targetInfoChanged/targetDestroyed` events.
///
/// Parameters:
/// - `discover`: boolean
/// - `filter`: TargetFilter (optional)
pub const SET_DISCOVER_TARGETS: &str = "Target.setDiscoverTargets";
/// Enables target discovery for the specified locations, when
/// `setDiscoverTargets` was set to `true`.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `locations`: array
pub const SET_REMOTE_LOCATIONS: &str = "Target.setRemoteLocations";
/// Gets the targetId of the DevTools page target opened for the given target
/// (if any).
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `targetId`: TargetID
///
/// Returns: `targetId`
pub const GET_DEV_TOOLS_TARGET: &str = "Target.getDevToolsTarget";
/// Opens a DevTools window for the target.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `targetId`: TargetID
/// - `panelId`: string (optional)
///
/// Returns: `targetId`
pub const OPEN_DEV_TOOLS: &str = "Target.openDevTools";