DOM
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.
Types
Fired when Element
's attribute is modified.
Fired when Element
's attribute is removed.
Backend node with a friendly name.
Mirrors DOMCharacterDataModified
event.
Fired when Container
's child node count has changed.
Mirrors DOMNodeInserted
event.
Mirrors DOMNodeRemoved
event.
Document compatibility mode.
A structure to hold the top-level node of a detached tree and an array of its retained descendants.
Called when distribution is changed.
Fired when Element
's inline style is modified via a CSS property modification.
ContainerSelector logical axes
DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes. DOMNode is a base node mirror type.
ContainerSelector physical axes
Called when a pseudo element is added to an element.
Called when a pseudo element is removed from an element.
Pseudo element type.
Fired when a node's scrollability state changes.
Physical scroll orientation
Fired when backend wants to provide client with the missing DOM structure. This happens upon most of the calls requesting node ids.
Called when shadow root is popped from the element.
Called when shadow root is pushed into the element.
Shadow root type.
CSS Shape Outside details.
Properties
Fired when Element
's attribute is modified.
Fired when Element
's attribute is removed.
Mirrors DOMCharacterDataModified
event.
Fired when Container
's child node count has changed.
Mirrors DOMNodeInserted
event.
Mirrors DOMNodeRemoved
event.
Called when distribution is changed.
Fired when Document
has been totally updated. Node ids are no longer valid.
Fired when Element
's inline style is modified via a CSS property modification.
Called when a pseudo element is added to an element.
Called when a pseudo element is removed from an element.
Fired when a node's scrollability state changes.
Fired when backend wants to provide client with the missing DOM structure. This happens upon most of the calls requesting node ids.
Called when shadow root is popped from the element.
Called when shadow root is pushed into the element.
Called when top layer elements are changed.
Functions
Collects class names for the node with given id and all of it's child nodes.
Creates a deep copy of the specified node and places it into the target container before the given anchor.
Describes node given its id, does not require domain to be enabled. Does not start tracking any objects, can be used for automation.
Disables DOM agent for the given page.
Discards search results from the session with the given id. getSearchResults
should no longer be called for that search.
Enables DOM agent for the given page.
Focuses the given element.
Returns the target anchor element of the given anchor query according to https://www.w3.org/TR/css-anchor-position-1/#target.
Returns attributes for the specified node.
Returns boxes for the given 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. 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.
Returns quads that describe node position on the page. This method might return multiple quads for inline nodes.
Returns list of detached nodes
Returns the root DOM node (and optionally the subtree) to the caller. Implicitly enables the DOM domain events for the current target.
Returns the NodeId of the matched element according to certain relations.
Returns file information for the given File wrapper.
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.
Returns iframe node that owns iframe with the given domain.
Returns node id at given location. Depending on whether DOM domain is enabled, nodeId is either returned or not.
Finds nodes with a given computed style in a subtree.
Gets stack traces associated with a Node. As of now, only provides stack trace for Node creation.
Returns node's HTML markup.
Returns the descendants of a container query container that have container queries against this container.
Returns the id of the nearest ancestor that is a relayout boundary.
Returns search results from given fromIndex
to given toIndex
from the search with the given identifier.
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.
Hides any highlight.
Highlights DOM node.
Highlights given rectangle.
Marks last undoable state.
Moves node into the new container, places it before the given anchor.
Searches for a given string in the DOM tree. Use getSearchResults
to access search results or cancelSearch
to end this search session.
Requests that the node is sent to the caller given its path. // FIXME, use XPath
Requests that a batch of nodes is sent to the caller given their backend node ids.
Executes querySelector
on a given node.
Executes querySelectorAll
on a given node.
Re-does the last undone action.
Removes attribute with given name from an element with given id.
Removes node with given id.
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.
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.
Resolves the JavaScript node object for a given NodeId or BackendNodeId.
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.
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.
Sets attribute for an element with given id.
Sets files for the given file input element.
Enables console to refer to the node with given id via
$x (see Command Line API for more details $
x functions).Sets node name for a node with given id.
Sets if stack traces should be captured for Nodes. See Node.getNodeStackTraces
. Default is disabled.
Sets node value for a node with given id.
Sets node HTML markup, returns new node id.
Undoes the last performed action.