cdp_driver/methods/dom.rs
1// @generated by `just generate-methods` from protocol/*.json.
2// Do not edit by hand; edit xtask/ and regenerate.
3
4//! This domain exposes DOM read/write operations. Each DOM Node is
5//! represented with its mirror object that has an `id`. This `id` can be used
6//! to get additional information on the Node, resolve it into the JavaScript
7//! object wrapper, etc. It is important that client receives DOM events only
8//! for the nodes that are known to the client. Backend keeps track of the
9//! nodes that were sent to the client and never sends the same node twice. It
10//! is client's responsibility to collect information about the nodes that
11//! were sent to the client. Note that `iframe` owner elements will return
12//! corresponding document elements as their child nodes.
13//!
14//! Method names for the `DOM` domain, for use with
15//! [`CdpClient::call`](crate::CdpClient::call).
16
17/// Collects class names for the node with given id and all of it's child
18/// nodes.
19///
20/// Experimental: may change without notice.
21///
22/// Parameters:
23/// - `nodeId`: NodeId
24///
25/// Returns: `classNames`
26pub const COLLECT_CLASS_NAMES_FROM_SUBTREE: &str = "DOM.collectClassNamesFromSubtree";
27
28/// Creates a deep copy of the specified node and places it into the target
29/// container before the given anchor.
30///
31/// Experimental: may change without notice.
32///
33/// Parameters:
34/// - `nodeId`: NodeId
35/// - `targetNodeId`: NodeId
36/// - `insertBeforeNodeId`: NodeId (optional)
37///
38/// Returns: `nodeId`
39pub const COPY_TO: &str = "DOM.copyTo";
40
41/// Describes node given its id, does not require domain to be enabled. Does
42/// not start tracking any objects, can be used for automation.
43///
44/// Parameters:
45/// - `nodeId`: NodeId (optional)
46/// - `backendNodeId`: BackendNodeId (optional)
47/// - `objectId`: Runtime.RemoteObjectId (optional)
48/// - `depth`: integer (optional)
49/// - `pierce`: boolean (optional)
50///
51/// Returns: `node`
52pub const DESCRIBE_NODE: &str = "DOM.describeNode";
53
54/// Scrolls the specified rect of the given node into view if not already
55/// visible. Note: exactly one between nodeId, backendNodeId and objectId
56/// should be passed to identify the node.
57///
58/// Parameters:
59/// - `nodeId`: NodeId (optional)
60/// - `backendNodeId`: BackendNodeId (optional)
61/// - `objectId`: Runtime.RemoteObjectId (optional)
62/// - `rect`: Rect (optional)
63pub const SCROLL_INTO_VIEW_IF_NEEDED: &str = "DOM.scrollIntoViewIfNeeded";
64
65/// Disables DOM agent for the given page.
66pub const DISABLE: &str = "DOM.disable";
67
68/// Discards search results from the session with the given id.
69/// `getSearchResults` should no longer be called for that search.
70///
71/// Experimental: may change without notice.
72///
73/// Parameters:
74/// - `searchId`: string
75pub const DISCARD_SEARCH_RESULTS: &str = "DOM.discardSearchResults";
76
77/// Enables DOM agent for the given page.
78///
79/// Parameters:
80/// - `includeWhitespace`: string (optional)
81pub const ENABLE: &str = "DOM.enable";
82
83/// Focuses the given element.
84///
85/// Parameters:
86/// - `nodeId`: NodeId (optional)
87/// - `backendNodeId`: BackendNodeId (optional)
88/// - `objectId`: Runtime.RemoteObjectId (optional)
89pub const FOCUS: &str = "DOM.focus";
90
91/// Returns attributes for the specified node.
92///
93/// Parameters:
94/// - `nodeId`: NodeId
95///
96/// Returns: `attributes`
97pub const GET_ATTRIBUTES: &str = "DOM.getAttributes";
98
99/// Returns boxes for the given node.
100///
101/// Parameters:
102/// - `nodeId`: NodeId (optional)
103/// - `backendNodeId`: BackendNodeId (optional)
104/// - `objectId`: Runtime.RemoteObjectId (optional)
105///
106/// Returns: `model`
107pub const GET_BOX_MODEL: &str = "DOM.getBoxModel";
108
109/// Returns quads that describe node position on the page. This method might
110/// return multiple quads for inline nodes.
111///
112/// Experimental: may change without notice.
113///
114/// Parameters:
115/// - `nodeId`: NodeId (optional)
116/// - `backendNodeId`: BackendNodeId (optional)
117/// - `objectId`: Runtime.RemoteObjectId (optional)
118///
119/// Returns: `quads`
120pub const GET_CONTENT_QUADS: &str = "DOM.getContentQuads";
121
122/// Returns the root DOM node (and optionally the subtree) to the caller.
123/// Implicitly enables the DOM domain events for the current target.
124///
125/// Parameters:
126/// - `depth`: integer (optional)
127/// - `pierce`: boolean (optional)
128///
129/// Returns: `root`
130pub const GET_DOCUMENT: &str = "DOM.getDocument";
131
132/// Returns the root DOM node (and optionally the subtree) to the caller.
133/// Deprecated, as it is not designed to work well with the rest of the DOM
134/// agent. Use DOMSnapshot.captureSnapshot instead.
135///
136/// Deprecated in the protocol.
137///
138/// Parameters:
139/// - `depth`: integer (optional)
140/// - `pierce`: boolean (optional)
141///
142/// Returns: `nodes`
143pub const GET_FLATTENED_DOCUMENT: &str = "DOM.getFlattenedDocument";
144
145/// Finds nodes with a given computed style in a subtree.
146///
147/// Experimental: may change without notice.
148///
149/// Parameters:
150/// - `nodeId`: NodeId
151/// - `computedStyles`: array
152/// - `pierce`: boolean (optional)
153///
154/// Returns: `nodeIds`
155pub const GET_NODES_FOR_SUBTREE_BY_STYLE: &str = "DOM.getNodesForSubtreeByStyle";
156
157/// Returns node id at given location. Depending on whether DOM domain is
158/// enabled, nodeId is either returned or not.
159///
160/// Parameters:
161/// - `x`: integer
162/// - `y`: integer
163/// - `includeUserAgentShadowDOM`: boolean (optional)
164/// - `ignorePointerEventsNone`: boolean (optional)
165///
166/// Returns: `backendNodeId`, `frameId`, `nodeId`
167pub const GET_NODE_FOR_LOCATION: &str = "DOM.getNodeForLocation";
168
169/// Returns node's HTML markup.
170///
171/// Parameters:
172/// - `nodeId`: NodeId (optional)
173/// - `backendNodeId`: BackendNodeId (optional)
174/// - `objectId`: Runtime.RemoteObjectId (optional)
175/// - `includeShadowDOM`: boolean (optional)
176///
177/// Returns: `outerHTML`
178pub const GET_OUTER_HTML: &str = "DOM.getOuterHTML";
179
180/// Returns the id of the nearest ancestor that is a relayout boundary.
181///
182/// Experimental: may change without notice.
183///
184/// Parameters:
185/// - `nodeId`: NodeId
186///
187/// Returns: `nodeId`
188pub const GET_RELAYOUT_BOUNDARY: &str = "DOM.getRelayoutBoundary";
189
190/// Returns search results from given `fromIndex` to given `toIndex` from the
191/// search with the given identifier.
192///
193/// Experimental: may change without notice.
194///
195/// Parameters:
196/// - `searchId`: string
197/// - `fromIndex`: integer
198/// - `toIndex`: integer
199///
200/// Returns: `nodeIds`
201pub const GET_SEARCH_RESULTS: &str = "DOM.getSearchResults";
202
203/// Hides any highlight.
204pub const HIDE_HIGHLIGHT: &str = "DOM.hideHighlight";
205
206/// Highlights DOM node.
207pub const HIGHLIGHT_NODE: &str = "DOM.highlightNode";
208
209/// Highlights given rectangle.
210pub const HIGHLIGHT_RECT: &str = "DOM.highlightRect";
211
212/// Marks last undoable state.
213///
214/// Experimental: may change without notice.
215pub const MARK_UNDOABLE_STATE: &str = "DOM.markUndoableState";
216
217/// Moves node into the new container, places it before the given anchor.
218///
219/// Parameters:
220/// - `nodeId`: NodeId
221/// - `targetNodeId`: NodeId
222/// - `insertBeforeNodeId`: NodeId (optional)
223///
224/// Returns: `nodeId`
225pub const MOVE_TO: &str = "DOM.moveTo";
226
227/// Searches for a given string in the DOM tree. Use `getSearchResults` to
228/// access search results or `cancelSearch` to end this search session.
229///
230/// Experimental: may change without notice.
231///
232/// Parameters:
233/// - `query`: string
234/// - `includeUserAgentShadowDOM`: boolean (optional)
235///
236/// Returns: `searchId`, `resultCount`
237pub const PERFORM_SEARCH: &str = "DOM.performSearch";
238
239/// Requests that the node is sent to the caller given its path. // FIXME, use
240/// XPath
241///
242/// Experimental: may change without notice.
243///
244/// Parameters:
245/// - `path`: string
246///
247/// Returns: `nodeId`
248pub const PUSH_NODE_BY_PATH_TO_FRONTEND: &str = "DOM.pushNodeByPathToFrontend";
249
250/// Requests that a batch of nodes is sent to the caller given their backend
251/// node ids.
252///
253/// Experimental: may change without notice.
254///
255/// Parameters:
256/// - `backendNodeIds`: array
257///
258/// Returns: `nodeIds`
259pub const PUSH_NODES_BY_BACKEND_IDS_TO_FRONTEND: &str = "DOM.pushNodesByBackendIdsToFrontend";
260
261/// Executes `querySelector` on a given node.
262///
263/// Parameters:
264/// - `nodeId`: NodeId
265/// - `selector`: string
266///
267/// Returns: `nodeId`
268pub const QUERY_SELECTOR: &str = "DOM.querySelector";
269
270/// Executes `querySelectorAll` on a given node.
271///
272/// Parameters:
273/// - `nodeId`: NodeId
274/// - `selector`: string
275///
276/// Returns: `nodeIds`
277pub const QUERY_SELECTOR_ALL: &str = "DOM.querySelectorAll";
278
279/// Returns NodeIds of current top layer elements. Top layer is rendered
280/// closest to the user within a viewport, therefore its elements always
281/// appear on top of all other content.
282///
283/// Experimental: may change without notice.
284///
285/// Returns: `nodeIds`
286pub const GET_TOP_LAYER_ELEMENTS: &str = "DOM.getTopLayerElements";
287
288/// Returns the NodeId of the matched element according to certain relations.
289///
290/// Experimental: may change without notice.
291///
292/// Parameters:
293/// - `nodeId`: NodeId
294/// - `relation`: string
295///
296/// Returns: `nodeId`
297pub const GET_ELEMENT_BY_RELATION: &str = "DOM.getElementByRelation";
298
299/// Re-does the last undone action.
300///
301/// Experimental: may change without notice.
302pub const REDO: &str = "DOM.redo";
303
304/// Removes attribute with given name from an element with given id.
305///
306/// Parameters:
307/// - `nodeId`: NodeId
308/// - `name`: string
309pub const REMOVE_ATTRIBUTE: &str = "DOM.removeAttribute";
310
311/// Removes node with given id.
312///
313/// Parameters:
314/// - `nodeId`: NodeId
315pub const REMOVE_NODE: &str = "DOM.removeNode";
316
317/// Requests that children of the node with given id are returned to the
318/// caller in form of `setChildNodes` events where not only immediate children
319/// are retrieved, but all children down to the specified depth.
320///
321/// Parameters:
322/// - `nodeId`: NodeId
323/// - `depth`: integer (optional)
324/// - `pierce`: boolean (optional)
325pub const REQUEST_CHILD_NODES: &str = "DOM.requestChildNodes";
326
327/// Requests that the node is sent to the caller given the JavaScript node
328/// object reference. All nodes that form the path from the node to the root
329/// are also sent to the client as a series of `setChildNodes` notifications.
330///
331/// Parameters:
332/// - `objectId`: Runtime.RemoteObjectId
333///
334/// Returns: `nodeId`
335pub const REQUEST_NODE: &str = "DOM.requestNode";
336
337/// Resolves the JavaScript node object for a given NodeId or BackendNodeId.
338///
339/// Parameters:
340/// - `nodeId`: NodeId (optional)
341/// - `backendNodeId`: DOM.BackendNodeId (optional)
342/// - `objectGroup`: string (optional)
343/// - `executionContextId`: Runtime.ExecutionContextId (optional)
344///
345/// Returns: `object`
346pub const RESOLVE_NODE: &str = "DOM.resolveNode";
347
348/// Sets attribute for an element with given id.
349///
350/// Parameters:
351/// - `nodeId`: NodeId
352/// - `name`: string
353/// - `value`: string
354pub const SET_ATTRIBUTE_VALUE: &str = "DOM.setAttributeValue";
355
356/// Sets attributes on element with given id. This method is useful when user
357/// edits some existing attribute value and types in several attribute
358/// name/value pairs.
359///
360/// Parameters:
361/// - `nodeId`: NodeId
362/// - `text`: string
363/// - `name`: string (optional)
364pub const SET_ATTRIBUTES_AS_TEXT: &str = "DOM.setAttributesAsText";
365
366/// Sets files for the given file input element.
367///
368/// Parameters:
369/// - `files`: array
370/// - `nodeId`: NodeId (optional)
371/// - `backendNodeId`: BackendNodeId (optional)
372/// - `objectId`: Runtime.RemoteObjectId (optional)
373pub const SET_FILE_INPUT_FILES: &str = "DOM.setFileInputFiles";
374
375/// Sets if stack traces should be captured for Nodes. See
376/// `Node.getNodeStackTraces`. Default is disabled.
377///
378/// Experimental: may change without notice.
379///
380/// Parameters:
381/// - `enable`: boolean
382pub const SET_NODE_STACK_TRACES_ENABLED: &str = "DOM.setNodeStackTracesEnabled";
383
384/// Gets stack traces associated with a Node. As of now, only provides stack
385/// trace for Node creation.
386///
387/// Experimental: may change without notice.
388///
389/// Parameters:
390/// - `nodeId`: NodeId
391///
392/// Returns: `creation`
393pub const GET_NODE_STACK_TRACES: &str = "DOM.getNodeStackTraces";
394
395/// Returns file information for the given File wrapper.
396///
397/// Experimental: may change without notice.
398///
399/// Parameters:
400/// - `objectId`: Runtime.RemoteObjectId
401///
402/// Returns: `path`
403pub const GET_FILE_INFO: &str = "DOM.getFileInfo";
404
405/// Returns list of detached nodes
406///
407/// Experimental: may change without notice.
408///
409/// Returns: `detachedNodes`
410pub const GET_DETACHED_DOM_NODES: &str = "DOM.getDetachedDomNodes";
411
412/// Enables console to refer to the node with given id via $x (see Command
413/// Line API for more details $x functions).
414///
415/// Experimental: may change without notice.
416///
417/// Parameters:
418/// - `nodeId`: NodeId
419pub const SET_INSPECTED_NODE: &str = "DOM.setInspectedNode";
420
421/// Sets node name for a node with given id.
422///
423/// Parameters:
424/// - `nodeId`: NodeId
425/// - `name`: string
426///
427/// Returns: `nodeId`
428pub const SET_NODE_NAME: &str = "DOM.setNodeName";
429
430/// Sets node value for a node with given id.
431///
432/// Parameters:
433/// - `nodeId`: NodeId
434/// - `value`: string
435pub const SET_NODE_VALUE: &str = "DOM.setNodeValue";
436
437/// Sets node HTML markup, returns new node id.
438///
439/// Parameters:
440/// - `nodeId`: NodeId
441/// - `outerHTML`: string
442pub const SET_OUTER_HTML: &str = "DOM.setOuterHTML";
443
444/// Undoes the last performed action.
445///
446/// Experimental: may change without notice.
447pub const UNDO: &str = "DOM.undo";
448
449/// Returns iframe node that owns iframe with the given domain.
450///
451/// Experimental: may change without notice.
452///
453/// Parameters:
454/// - `frameId`: Page.FrameId
455///
456/// Returns: `backendNodeId`, `nodeId`
457pub const GET_FRAME_OWNER: &str = "DOM.getFrameOwner";
458
459/// Returns the query container of the given node based on container query
460/// conditions: containerName, physical and logical axes, and whether it
461/// queries scroll-state or anchored elements. If no axes are provided and
462/// queriesScrollState is false, the style container is returned, which is the
463/// direct parent or the closest element with a matching container-name.
464///
465/// Experimental: may change without notice.
466///
467/// Parameters:
468/// - `nodeId`: NodeId
469/// - `containerName`: string (optional)
470/// - `physicalAxes`: PhysicalAxes (optional)
471/// - `logicalAxes`: LogicalAxes (optional)
472/// - `queriesScrollState`: boolean (optional)
473/// - `queriesAnchored`: boolean (optional)
474///
475/// Returns: `nodeId`
476pub const GET_CONTAINER_FOR_NODE: &str = "DOM.getContainerForNode";
477
478/// Returns the descendants of a container query container that have container
479/// queries against this container.
480///
481/// Experimental: may change without notice.
482///
483/// Parameters:
484/// - `nodeId`: NodeId
485///
486/// Returns: `nodeIds`
487pub const GET_QUERYING_DESCENDANTS_FOR_CONTAINER: &str = "DOM.getQueryingDescendantsForContainer";
488
489/// Returns the target anchor element of the given anchor query according to
490/// <https://www.w3.org/TR/css-anchor-position-1/#target>.
491///
492/// Experimental: may change without notice.
493///
494/// Parameters:
495/// - `nodeId`: NodeId
496/// - `anchorSpecifier`: string (optional)
497///
498/// Returns: `nodeId`
499pub const GET_ANCHOR_ELEMENT: &str = "DOM.getAnchorElement";
500
501/// When enabling, this API force-opens the popover identified by nodeId and
502/// keeps it open until disabled.
503///
504/// Experimental: may change without notice.
505///
506/// Parameters:
507/// - `nodeId`: NodeId
508/// - `enable`: boolean
509/// - `invokerNodeId`: BackendNodeId (optional)
510///
511/// Returns: `nodeIds`
512pub const FORCE_SHOW_POPOVER: &str = "DOM.forceShowPopover";
513
514/// Returns candidate nodes that are configured as triggers for the given
515/// popover.
516///
517/// Experimental: may change without notice.
518///
519/// Parameters:
520/// - `nodeId`: NodeId
521///
522/// Returns: `backendNodeIds`
523pub const GET_IMPLICIT_ANCHOR_CANDIDATES: &str = "DOM.getImplicitAnchorCandidates";
524
525/// When enabling, this API forces an element to gain interest in its target,
526/// keeping interest active until disabled.
527///
528/// Experimental: may change without notice.
529///
530/// Parameters:
531/// - `nodeId`: NodeId
532/// - `enable`: boolean
533pub const FORCE_SHOW_INTEREST: &str = "DOM.forceShowInterest";
534
535/// Sets a spelling or grammar error marker on the given range of text. See
536/// <https://github.com/Igalia/explainers/blob/main/force-spelling-grammar-markers/README.md>
537/// Note: exactly one between nodeId, backendNodeId and objectId should be
538/// passed to identify the node.
539///
540/// Experimental: may change without notice.
541///
542/// Parameters:
543/// - `nodeId`: NodeId (optional)
544/// - `backendNodeId`: BackendNodeId (optional)
545/// - `objectId`: Runtime.RemoteObjectId (optional)
546/// - `type`: string
547/// - `start`: integer
548/// - `end`: integer
549pub const SET_TEXT_MARKER: &str = "DOM.setTextMarker";
550
551/// Clears the spelling and grammar error text markers overlapping the ranges
552/// set by setTextMarker in this session. These markers are also removed when
553/// the DOM domain is disabled or the session ends.
554///
555/// Experimental: may change without notice.
556pub const CLEAR_TEXT_MARKERS: &str = "DOM.clearTextMarkers";