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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
// @generated by `just generate-methods` from protocol/*.json.
// Do not edit by hand; edit xtask/ and regenerate.
//! This domain exposes DOM read/write operations. Each DOM Node is
//! represented with its mirror object that has an `id`. This `id` can be used
//! to get additional information on the Node, resolve it into the JavaScript
//! object wrapper, etc. It is important that client receives DOM events only
//! for the nodes that are known to the client. Backend keeps track of the
//! nodes that were sent to the client and never sends the same node twice. It
//! is client's responsibility to collect information about the nodes that
//! were sent to the client. Note that `iframe` owner elements will return
//! corresponding document elements as their child nodes.
//!
//! Method names for the `DOM` domain, for use with
//! [`CdpClient::call`](crate::CdpClient::call).
/// Collects class names for the node with given id and all of it's child
/// nodes.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `nodeId`: NodeId
///
/// Returns: `classNames`
pub const COLLECT_CLASS_NAMES_FROM_SUBTREE: &str = "DOM.collectClassNamesFromSubtree";
/// Creates a deep copy of the specified node and places it into the target
/// container before the given anchor.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `nodeId`: NodeId
/// - `targetNodeId`: NodeId
/// - `insertBeforeNodeId`: NodeId (optional)
///
/// Returns: `nodeId`
pub const COPY_TO: &str = "DOM.copyTo";
/// Describes node given its id, does not require domain to be enabled. Does
/// not start tracking any objects, can be used for automation.
///
/// Parameters:
/// - `nodeId`: NodeId (optional)
/// - `backendNodeId`: BackendNodeId (optional)
/// - `objectId`: Runtime.RemoteObjectId (optional)
/// - `depth`: integer (optional)
/// - `pierce`: boolean (optional)
///
/// Returns: `node`
pub const DESCRIBE_NODE: &str = "DOM.describeNode";
/// Scrolls the specified rect of the given node into view if not already
/// visible. Note: exactly one between nodeId, backendNodeId and objectId
/// should be passed to identify the node.
///
/// Parameters:
/// - `nodeId`: NodeId (optional)
/// - `backendNodeId`: BackendNodeId (optional)
/// - `objectId`: Runtime.RemoteObjectId (optional)
/// - `rect`: Rect (optional)
pub const SCROLL_INTO_VIEW_IF_NEEDED: &str = "DOM.scrollIntoViewIfNeeded";
/// Disables DOM agent for the given page.
pub const DISABLE: &str = "DOM.disable";
/// Discards search results from the session with the given id.
/// `getSearchResults` should no longer be called for that search.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `searchId`: string
pub const DISCARD_SEARCH_RESULTS: &str = "DOM.discardSearchResults";
/// Enables DOM agent for the given page.
///
/// Parameters:
/// - `includeWhitespace`: string (optional)
pub const ENABLE: &str = "DOM.enable";
/// Focuses the given element.
///
/// Parameters:
/// - `nodeId`: NodeId (optional)
/// - `backendNodeId`: BackendNodeId (optional)
/// - `objectId`: Runtime.RemoteObjectId (optional)
pub const FOCUS: &str = "DOM.focus";
/// Returns attributes for the specified node.
///
/// Parameters:
/// - `nodeId`: NodeId
///
/// Returns: `attributes`
pub const GET_ATTRIBUTES: &str = "DOM.getAttributes";
/// Returns boxes for the given node.
///
/// Parameters:
/// - `nodeId`: NodeId (optional)
/// - `backendNodeId`: BackendNodeId (optional)
/// - `objectId`: Runtime.RemoteObjectId (optional)
///
/// Returns: `model`
pub const GET_BOX_MODEL: &str = "DOM.getBoxModel";
/// Returns quads that describe node position on the page. This method might
/// return multiple quads for inline nodes.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `nodeId`: NodeId (optional)
/// - `backendNodeId`: BackendNodeId (optional)
/// - `objectId`: Runtime.RemoteObjectId (optional)
///
/// Returns: `quads`
pub const GET_CONTENT_QUADS: &str = "DOM.getContentQuads";
/// Returns the root DOM node (and optionally the subtree) to the caller.
/// Implicitly enables the DOM domain events for the current target.
///
/// Parameters:
/// - `depth`: integer (optional)
/// - `pierce`: boolean (optional)
///
/// Returns: `root`
pub const GET_DOCUMENT: &str = "DOM.getDocument";
/// Returns the root DOM node (and optionally the subtree) to the caller.
/// Deprecated, as it is not designed to work well with the rest of the DOM
/// agent. Use DOMSnapshot.captureSnapshot instead.
///
/// Deprecated in the protocol.
///
/// Parameters:
/// - `depth`: integer (optional)
/// - `pierce`: boolean (optional)
///
/// Returns: `nodes`
pub const GET_FLATTENED_DOCUMENT: &str = "DOM.getFlattenedDocument";
/// Finds nodes with a given computed style in a subtree.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `nodeId`: NodeId
/// - `computedStyles`: array
/// - `pierce`: boolean (optional)
///
/// Returns: `nodeIds`
pub const GET_NODES_FOR_SUBTREE_BY_STYLE: &str = "DOM.getNodesForSubtreeByStyle";
/// Returns node id at given location. Depending on whether DOM domain is
/// enabled, nodeId is either returned or not.
///
/// Parameters:
/// - `x`: integer
/// - `y`: integer
/// - `includeUserAgentShadowDOM`: boolean (optional)
/// - `ignorePointerEventsNone`: boolean (optional)
///
/// Returns: `backendNodeId`, `frameId`, `nodeId`
pub const GET_NODE_FOR_LOCATION: &str = "DOM.getNodeForLocation";
/// Returns node's HTML markup.
///
/// Parameters:
/// - `nodeId`: NodeId (optional)
/// - `backendNodeId`: BackendNodeId (optional)
/// - `objectId`: Runtime.RemoteObjectId (optional)
/// - `includeShadowDOM`: boolean (optional)
///
/// Returns: `outerHTML`
pub const GET_OUTER_HTML: &str = "DOM.getOuterHTML";
/// Returns the id of the nearest ancestor that is a relayout boundary.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `nodeId`: NodeId
///
/// Returns: `nodeId`
pub const GET_RELAYOUT_BOUNDARY: &str = "DOM.getRelayoutBoundary";
/// Returns search results from given `fromIndex` to given `toIndex` from the
/// search with the given identifier.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `searchId`: string
/// - `fromIndex`: integer
/// - `toIndex`: integer
///
/// Returns: `nodeIds`
pub const GET_SEARCH_RESULTS: &str = "DOM.getSearchResults";
/// Hides any highlight.
pub const HIDE_HIGHLIGHT: &str = "DOM.hideHighlight";
/// Highlights DOM node.
pub const HIGHLIGHT_NODE: &str = "DOM.highlightNode";
/// Highlights given rectangle.
pub const HIGHLIGHT_RECT: &str = "DOM.highlightRect";
/// Marks last undoable state.
///
/// Experimental: may change without notice.
pub const MARK_UNDOABLE_STATE: &str = "DOM.markUndoableState";
/// Moves node into the new container, places it before the given anchor.
///
/// Parameters:
/// - `nodeId`: NodeId
/// - `targetNodeId`: NodeId
/// - `insertBeforeNodeId`: NodeId (optional)
///
/// Returns: `nodeId`
pub const MOVE_TO: &str = "DOM.moveTo";
/// Searches for a given string in the DOM tree. Use `getSearchResults` to
/// access search results or `cancelSearch` to end this search session.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `query`: string
/// - `includeUserAgentShadowDOM`: boolean (optional)
///
/// Returns: `searchId`, `resultCount`
pub const PERFORM_SEARCH: &str = "DOM.performSearch";
/// Requests that the node is sent to the caller given its path. // FIXME, use
/// XPath
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `path`: string
///
/// Returns: `nodeId`
pub const PUSH_NODE_BY_PATH_TO_FRONTEND: &str = "DOM.pushNodeByPathToFrontend";
/// Requests that a batch of nodes is sent to the caller given their backend
/// node ids.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `backendNodeIds`: array
///
/// Returns: `nodeIds`
pub const PUSH_NODES_BY_BACKEND_IDS_TO_FRONTEND: &str = "DOM.pushNodesByBackendIdsToFrontend";
/// Executes `querySelector` on a given node.
///
/// Parameters:
/// - `nodeId`: NodeId
/// - `selector`: string
///
/// Returns: `nodeId`
pub const QUERY_SELECTOR: &str = "DOM.querySelector";
/// Executes `querySelectorAll` on a given node.
///
/// Parameters:
/// - `nodeId`: NodeId
/// - `selector`: string
///
/// Returns: `nodeIds`
pub const QUERY_SELECTOR_ALL: &str = "DOM.querySelectorAll";
/// Returns NodeIds of current top layer elements. Top layer is rendered
/// closest to the user within a viewport, therefore its elements always
/// appear on top of all other content.
///
/// Experimental: may change without notice.
///
/// Returns: `nodeIds`
pub const GET_TOP_LAYER_ELEMENTS: &str = "DOM.getTopLayerElements";
/// Returns the NodeId of the matched element according to certain relations.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `nodeId`: NodeId
/// - `relation`: string
///
/// Returns: `nodeId`
pub const GET_ELEMENT_BY_RELATION: &str = "DOM.getElementByRelation";
/// Re-does the last undone action.
///
/// Experimental: may change without notice.
pub const REDO: &str = "DOM.redo";
/// Removes attribute with given name from an element with given id.
///
/// Parameters:
/// - `nodeId`: NodeId
/// - `name`: string
pub const REMOVE_ATTRIBUTE: &str = "DOM.removeAttribute";
/// Removes node with given id.
///
/// Parameters:
/// - `nodeId`: NodeId
pub const REMOVE_NODE: &str = "DOM.removeNode";
/// Requests that children of the node with given id are returned to the
/// caller in form of `setChildNodes` events where not only immediate children
/// are retrieved, but all children down to the specified depth.
///
/// Parameters:
/// - `nodeId`: NodeId
/// - `depth`: integer (optional)
/// - `pierce`: boolean (optional)
pub const REQUEST_CHILD_NODES: &str = "DOM.requestChildNodes";
/// Requests that the node is sent to the caller given the JavaScript node
/// object reference. All nodes that form the path from the node to the root
/// are also sent to the client as a series of `setChildNodes` notifications.
///
/// Parameters:
/// - `objectId`: Runtime.RemoteObjectId
///
/// Returns: `nodeId`
pub const REQUEST_NODE: &str = "DOM.requestNode";
/// Resolves the JavaScript node object for a given NodeId or BackendNodeId.
///
/// Parameters:
/// - `nodeId`: NodeId (optional)
/// - `backendNodeId`: DOM.BackendNodeId (optional)
/// - `objectGroup`: string (optional)
/// - `executionContextId`: Runtime.ExecutionContextId (optional)
///
/// Returns: `object`
pub const RESOLVE_NODE: &str = "DOM.resolveNode";
/// Sets attribute for an element with given id.
///
/// Parameters:
/// - `nodeId`: NodeId
/// - `name`: string
/// - `value`: string
pub const SET_ATTRIBUTE_VALUE: &str = "DOM.setAttributeValue";
/// Sets attributes on element with given id. This method is useful when user
/// edits some existing attribute value and types in several attribute
/// name/value pairs.
///
/// Parameters:
/// - `nodeId`: NodeId
/// - `text`: string
/// - `name`: string (optional)
pub const SET_ATTRIBUTES_AS_TEXT: &str = "DOM.setAttributesAsText";
/// Sets files for the given file input element.
///
/// Parameters:
/// - `files`: array
/// - `nodeId`: NodeId (optional)
/// - `backendNodeId`: BackendNodeId (optional)
/// - `objectId`: Runtime.RemoteObjectId (optional)
pub const SET_FILE_INPUT_FILES: &str = "DOM.setFileInputFiles";
/// Sets if stack traces should be captured for Nodes. See
/// `Node.getNodeStackTraces`. Default is disabled.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `enable`: boolean
pub const SET_NODE_STACK_TRACES_ENABLED: &str = "DOM.setNodeStackTracesEnabled";
/// Gets stack traces associated with a Node. As of now, only provides stack
/// trace for Node creation.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `nodeId`: NodeId
///
/// Returns: `creation`
pub const GET_NODE_STACK_TRACES: &str = "DOM.getNodeStackTraces";
/// Returns file information for the given File wrapper.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `objectId`: Runtime.RemoteObjectId
///
/// Returns: `path`
pub const GET_FILE_INFO: &str = "DOM.getFileInfo";
/// Returns list of detached nodes
///
/// Experimental: may change without notice.
///
/// Returns: `detachedNodes`
pub const GET_DETACHED_DOM_NODES: &str = "DOM.getDetachedDomNodes";
/// Enables console to refer to the node with given id via $x (see Command
/// Line API for more details $x functions).
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `nodeId`: NodeId
pub const SET_INSPECTED_NODE: &str = "DOM.setInspectedNode";
/// Sets node name for a node with given id.
///
/// Parameters:
/// - `nodeId`: NodeId
/// - `name`: string
///
/// Returns: `nodeId`
pub const SET_NODE_NAME: &str = "DOM.setNodeName";
/// Sets node value for a node with given id.
///
/// Parameters:
/// - `nodeId`: NodeId
/// - `value`: string
pub const SET_NODE_VALUE: &str = "DOM.setNodeValue";
/// Sets node HTML markup, returns new node id.
///
/// Parameters:
/// - `nodeId`: NodeId
/// - `outerHTML`: string
pub const SET_OUTER_HTML: &str = "DOM.setOuterHTML";
/// Undoes the last performed action.
///
/// Experimental: may change without notice.
pub const UNDO: &str = "DOM.undo";
/// Returns iframe node that owns iframe with the given domain.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `frameId`: Page.FrameId
///
/// Returns: `backendNodeId`, `nodeId`
pub const GET_FRAME_OWNER: &str = "DOM.getFrameOwner";
/// Returns the query container of the given node based on container query
/// conditions: containerName, physical and logical axes, and whether it
/// queries scroll-state or anchored elements. If no axes are provided and
/// queriesScrollState is false, the style container is returned, which is the
/// direct parent or the closest element with a matching container-name.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `nodeId`: NodeId
/// - `containerName`: string (optional)
/// - `physicalAxes`: PhysicalAxes (optional)
/// - `logicalAxes`: LogicalAxes (optional)
/// - `queriesScrollState`: boolean (optional)
/// - `queriesAnchored`: boolean (optional)
///
/// Returns: `nodeId`
pub const GET_CONTAINER_FOR_NODE: &str = "DOM.getContainerForNode";
/// Returns the descendants of a container query container that have container
/// queries against this container.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `nodeId`: NodeId
///
/// Returns: `nodeIds`
pub const GET_QUERYING_DESCENDANTS_FOR_CONTAINER: &str = "DOM.getQueryingDescendantsForContainer";
/// Returns the target anchor element of the given anchor query according to
/// <https://www.w3.org/TR/css-anchor-position-1/#target>.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `nodeId`: NodeId
/// - `anchorSpecifier`: string (optional)
///
/// Returns: `nodeId`
pub const GET_ANCHOR_ELEMENT: &str = "DOM.getAnchorElement";
/// When enabling, this API force-opens the popover identified by nodeId and
/// keeps it open until disabled.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `nodeId`: NodeId
/// - `enable`: boolean
/// - `invokerNodeId`: BackendNodeId (optional)
///
/// Returns: `nodeIds`
pub const FORCE_SHOW_POPOVER: &str = "DOM.forceShowPopover";
/// When enabling, this API forces an element to gain interest in its target,
/// keeping interest active until disabled.
///
/// Experimental: may change without notice.
///
/// Parameters:
/// - `nodeId`: NodeId
/// - `enable`: boolean
pub const FORCE_SHOW_INTEREST: &str = "DOM.forceShowInterest";