Expand description
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.
Constants§
- CLEAR_
TEXT_ MARKERS - Clears the spelling and grammar error text markers overlapping the ranges set by setTextMarker in this session. These markers are also removed when the DOM domain is disabled or the session ends.
- COLLECT_
CLASS_ NAMES_ FROM_ SUBTREE - Collects class names for the node with given id and all of it’s child nodes.
- COPY_TO
- Creates a deep copy of the specified node and places it into the target container before the given anchor.
- DESCRIBE_
NODE - Describes node given its id, does not require domain to be enabled. Does not start tracking any objects, can be used for automation.
- DISABLE
- Disables DOM agent for the given page.
- DISCARD_
SEARCH_ RESULTS - Discards search results from the session with the given id.
getSearchResultsshould no longer be called for that search. - ENABLE
- Enables DOM agent for the given page.
- FOCUS
- Focuses the given element.
- FORCE_
SHOW_ INTEREST - When enabling, this API forces an element to gain interest in its target, keeping interest active until disabled.
- FORCE_
SHOW_ POPOVER - When enabling, this API force-opens the popover identified by nodeId and keeps it open until disabled.
- GET_
ANCHOR_ ELEMENT - Returns the target anchor element of the given anchor query according to https://www.w3.org/TR/css-anchor-position-1/#target.
- GET_
ATTRIBUTES - Returns attributes for the specified node.
- GET_
BOX_ MODEL - Returns boxes for the given node.
- GET_
CONTAINER_ FOR_ NODE - 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.
- GET_
CONTENT_ QUADS - Returns quads that describe node position on the page. This method might return multiple quads for inline nodes.
- GET_
DETACHED_ DOM_ NODES - Returns list of detached nodes
- GET_
DOCUMENT - Returns the root DOM node (and optionally the subtree) to the caller. Implicitly enables the DOM domain events for the current target.
- GET_
ELEMENT_ BY_ RELATION - Returns the NodeId of the matched element according to certain relations.
- GET_
FILE_ INFO - Returns file information for the given File wrapper.
- GET_
FLATTENED_ DOCUMENT - 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.
- GET_
FRAME_ OWNER - Returns iframe node that owns iframe with the given domain.
- GET_
IMPLICIT_ ANCHOR_ CANDIDATES - Returns candidate nodes that are configured as triggers for the given popover.
- GET_
NODES_ FOR_ SUBTREE_ BY_ STYLE - Finds nodes with a given computed style in a subtree.
- GET_
NODE_ FOR_ LOCATION - Returns node id at given location. Depending on whether DOM domain is enabled, nodeId is either returned or not.
- GET_
NODE_ STACK_ TRACES - Gets stack traces associated with a Node. As of now, only provides stack trace for Node creation.
- GET_
OUTER_ HTML - Returns node’s HTML markup.
- GET_
QUERYING_ DESCENDANTS_ FOR_ CONTAINER - Returns the descendants of a container query container that have container queries against this container.
- GET_
RELAYOUT_ BOUNDARY - Returns the id of the nearest ancestor that is a relayout boundary.
- GET_
SEARCH_ RESULTS - Returns search results from given
fromIndexto giventoIndexfrom the search with the given identifier. - GET_
TOP_ LAYER_ ELEMENTS - 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.
- HIDE_
HIGHLIGHT - Hides any highlight.
- HIGHLIGHT_
NODE - Highlights DOM node.
- HIGHLIGHT_
RECT - Highlights given rectangle.
- MARK_
UNDOABLE_ STATE - Marks last undoable state.
- MOVE_TO
- Moves node into the new container, places it before the given anchor.
- PERFORM_
SEARCH - Searches for a given string in the DOM tree. Use
getSearchResultsto access search results orcancelSearchto end this search session. - PUSH_
NODES_ BY_ BACKEND_ IDS_ TO_ FRONTEND - Requests that a batch of nodes is sent to the caller given their backend node ids.
- PUSH_
NODE_ BY_ PATH_ TO_ FRONTEND - Requests that the node is sent to the caller given its path. // FIXME, use XPath
- QUERY_
SELECTOR - Executes
querySelectoron a given node. - QUERY_
SELECTOR_ ALL - Executes
querySelectorAllon a given node. - REDO
- Re-does the last undone action.
- REMOVE_
ATTRIBUTE - Removes attribute with given name from an element with given id.
- REMOVE_
NODE - Removes node with given id.
- REQUEST_
CHILD_ NODES - Requests that children of the node with given id are returned to the
caller in form of
setChildNodesevents where not only immediate children are retrieved, but all children down to the specified depth. - REQUEST_
NODE - 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
setChildNodesnotifications. - RESOLVE_
NODE - Resolves the JavaScript node object for a given NodeId or BackendNodeId.
- SCROLL_
INTO_ VIEW_ IF_ NEEDED - 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.
- SET_
ATTRIBUTES_ AS_ TEXT - 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.
- SET_
ATTRIBUTE_ VALUE - Sets attribute for an element with given id.
- SET_
FILE_ INPUT_ FILES - Sets files for the given file input element.
- SET_
INSPECTED_ NODE - Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).
- SET_
NODE_ NAME - Sets node name for a node with given id.
- SET_
NODE_ STACK_ TRACES_ ENABLED - Sets if stack traces should be captured for Nodes. See
Node.getNodeStackTraces. Default is disabled. - SET_
NODE_ VALUE - Sets node value for a node with given id.
- SET_
OUTER_ HTML - Sets node HTML markup, returns new node id.
- SET_
TEXT_ MARKER - Sets a spelling or grammar error marker on the given range of text. See https://github.com/Igalia/explainers/blob/main/force-spelling-grammar-markers/README.md Note: exactly one between nodeId, backendNodeId and objectId should be passed to identify the node.
- UNDO
- Undoes the last performed action.