Skip to main content

cdp_driver/methods/
target.rs

1// @generated by `just generate-methods` from protocol/*.json.
2// Do not edit by hand; edit xtask/ and regenerate.
3
4//! Supports additional targets discovery and allows to attach to them.
5//!
6//! Method names for the `Target` domain, for use with
7//! [`CdpClient::call`](crate::CdpClient::call).
8
9/// Activates (focuses) the target.
10///
11/// Parameters:
12/// - `targetId`: TargetID
13pub const ACTIVATE_TARGET: &str = "Target.activateTarget";
14
15/// Attaches to the target with given id.
16///
17/// Parameters:
18/// - `targetId`: TargetID
19/// - `flatten`: boolean (optional)
20///
21/// Returns: `sessionId`
22pub const ATTACH_TO_TARGET: &str = "Target.attachToTarget";
23
24/// Attaches to the browser target, only uses flat sessionId mode.
25///
26/// Experimental: may change without notice.
27///
28/// Returns: `sessionId`
29pub const ATTACH_TO_BROWSER_TARGET: &str = "Target.attachToBrowserTarget";
30
31/// Closes the target. If the target is a page that gets closed too.
32///
33/// Parameters:
34/// - `targetId`: TargetID
35///
36/// Returns: `success`
37pub const CLOSE_TARGET: &str = "Target.closeTarget";
38
39/// Inject object to the target's main frame that provides a communication
40/// channel with browser target. Injected object will be available as
41/// `window\[bindingName\]`. The object has the following API: -
42/// `binding.send(json)` - a method to send messages over the remote debugging
43/// protocol - `binding.onmessage = json =\> handleMessage(json)` - a callback
44/// that will be called for the protocol notifications and command responses.
45///
46/// Experimental: may change without notice.
47///
48/// Parameters:
49/// - `targetId`: TargetID
50/// - `bindingName`: string (optional)
51/// - `inheritPermissions`: boolean (optional)
52pub const EXPOSE_DEV_TOOLS_PROTOCOL: &str = "Target.exposeDevToolsProtocol";
53
54/// Creates a new empty BrowserContext. Similar to an incognito profile but
55/// you can have more than one.
56///
57/// Parameters:
58/// - `disposeOnDetach`: boolean (optional)
59/// - `proxyServer`: string (optional)
60/// - `proxyBypassList`: string (optional)
61/// - `originsWithUniversalNetworkAccess`: array (optional)
62///
63/// Returns: `browserContextId`
64pub const CREATE_BROWSER_CONTEXT: &str = "Target.createBrowserContext";
65
66/// Returns all browser contexts created with `Target.createBrowserContext`
67/// method.
68///
69/// Returns: `browserContextIds`, `defaultBrowserContextId`
70pub const GET_BROWSER_CONTEXTS: &str = "Target.getBrowserContexts";
71
72/// Creates a new page.
73///
74/// Parameters:
75/// - `url`: string
76/// - `left`: integer (optional)
77/// - `top`: integer (optional)
78/// - `width`: integer (optional)
79/// - `height`: integer (optional)
80/// - `windowState`: WindowState (optional)
81/// - `browserContextId`: Browser.BrowserContextID (optional)
82/// - `enableBeginFrameControl`: boolean (optional)
83/// - `newWindow`: boolean (optional)
84/// - `background`: boolean (optional)
85/// - `forTab`: boolean (optional)
86/// - `hidden`: boolean (optional)
87/// - `focus`: boolean (optional)
88///
89/// Returns: `targetId`
90pub const CREATE_TARGET: &str = "Target.createTarget";
91
92/// Detaches session with given id.
93///
94/// Parameters:
95/// - `sessionId`: SessionID (optional)
96/// - `targetId`: TargetID (optional)
97pub const DETACH_FROM_TARGET: &str = "Target.detachFromTarget";
98
99/// Deletes a BrowserContext. All the belonging pages will be closed without
100/// calling their beforeunload hooks.
101///
102/// Parameters:
103/// - `browserContextId`: Browser.BrowserContextID
104pub const DISPOSE_BROWSER_CONTEXT: &str = "Target.disposeBrowserContext";
105
106/// Returns information about a target.
107///
108/// Experimental: may change without notice.
109///
110/// Parameters:
111/// - `targetId`: TargetID (optional)
112///
113/// Returns: `targetInfo`
114pub const GET_TARGET_INFO: &str = "Target.getTargetInfo";
115
116/// Retrieves a list of available targets.
117///
118/// Parameters:
119/// - `filter`: TargetFilter (optional)
120///
121/// Returns: `targetInfos`
122pub const GET_TARGETS: &str = "Target.getTargets";
123
124/// Sends protocol message over session with given id. Consider using flat
125/// mode instead; see commands attachToTarget, setAutoAttach, and
126/// crbug.com/991325.
127///
128/// Deprecated in the protocol.
129///
130/// Parameters:
131/// - `message`: string
132/// - `sessionId`: SessionID (optional)
133/// - `targetId`: TargetID (optional)
134pub const SEND_MESSAGE_TO_TARGET: &str = "Target.sendMessageToTarget";
135
136/// Controls whether to automatically attach to new targets which are
137/// considered to be directly related to this one (for example, iframes or
138/// workers). When turned on, attaches to all existing related targets as
139/// well. When turned off, automatically detaches from all currently attached
140/// targets. This also clears all targets added by `autoAttachRelated` from
141/// the list of targets to watch for creation of related targets. You might
142/// want to call this recursively for auto-attached targets to attach to all
143/// available targets.
144///
145/// Parameters:
146/// - `autoAttach`: boolean
147/// - `waitForDebuggerOnStart`: boolean
148/// - `flatten`: boolean (optional)
149/// - `filter`: TargetFilter (optional)
150pub const SET_AUTO_ATTACH: &str = "Target.setAutoAttach";
151
152/// Adds the specified target to the list of targets that will be monitored
153/// for any related target creation (such as child frames, child workers and
154/// new versions of service worker) and reported through `attachedToTarget`.
155/// The specified target is also auto-attached. This cancels the effect of any
156/// previous `setAutoAttach` and is also cancelled by subsequent
157/// `setAutoAttach`. Only available at the Browser target.
158///
159/// Experimental: may change without notice.
160///
161/// Parameters:
162/// - `targetId`: TargetID
163/// - `waitForDebuggerOnStart`: boolean
164/// - `filter`: TargetFilter (optional)
165pub const AUTO_ATTACH_RELATED: &str = "Target.autoAttachRelated";
166
167/// Controls whether to discover available targets and notify via
168/// `targetCreated/targetInfoChanged/targetDestroyed` events.
169///
170/// Parameters:
171/// - `discover`: boolean
172/// - `filter`: TargetFilter (optional)
173pub const SET_DISCOVER_TARGETS: &str = "Target.setDiscoverTargets";
174
175/// Enables target discovery for the specified locations, when
176/// `setDiscoverTargets` was set to `true`.
177///
178/// Experimental: may change without notice.
179///
180/// Parameters:
181/// - `locations`: array
182pub const SET_REMOTE_LOCATIONS: &str = "Target.setRemoteLocations";
183
184/// Gets the targetId of the DevTools page target opened for the given target
185/// (if any).
186///
187/// Experimental: may change without notice.
188///
189/// Parameters:
190/// - `targetId`: TargetID
191///
192/// Returns: `targetId`
193pub const GET_DEV_TOOLS_TARGET: &str = "Target.getDevToolsTarget";
194
195/// Opens a DevTools window for the target.
196///
197/// Experimental: may change without notice.
198///
199/// Parameters:
200/// - `targetId`: TargetID
201/// - `panelId`: string (optional)
202///
203/// Returns: `targetId`
204pub const OPEN_DEV_TOOLS: &str = "Target.openDevTools";