DOM

class DOM(cdp: CDP) : Domain

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.

Constructors

Link copied to clipboard
constructor(cdp: CDP)

Types

Link copied to clipboard
@Serializable
data class AttributeModifiedParameter(val nodeId: Int, val name: String, val value: String)

Fired when Element's attribute is modified.

Link copied to clipboard
@Serializable
data class AttributeRemovedParameter(val nodeId: Int, val name: String)

Fired when Element's attribute is removed.

Link copied to clipboard
@Serializable
data class BackendNode(val nodeType: Int, val nodeName: String, val backendNodeId: Int)

Backend node with a friendly name.

Link copied to clipboard
@Serializable
data class BoxModel(val content: List<Double>, val padding: List<Double>, val border: List<Double>, val margin: List<Double>, val width: Int, val height: Int, val shapeOutside: DOM.ShapeOutsideInfo? = null)

Box model.

Link copied to clipboard
@Serializable
data class CharacterDataModifiedParameter(val nodeId: Int, val characterData: String)

Mirrors DOMCharacterDataModified event.

Link copied to clipboard
@Serializable
data class ChildNodeCountUpdatedParameter(val nodeId: Int, val childNodeCount: Int)

Fired when Container's child node count has changed.

Link copied to clipboard
@Serializable
data class ChildNodeInsertedParameter(val parentNodeId: Int, val previousNodeId: Int, val node: DOM.Node)

Mirrors DOMNodeInserted event.

Link copied to clipboard
@Serializable
data class ChildNodeRemovedParameter(val parentNodeId: Int, val nodeId: Int)

Mirrors DOMNodeRemoved event.

Link copied to clipboard
@Serializable
data class CollectClassNamesFromSubtreeParameter(val nodeId: Int)
Link copied to clipboard
@Serializable
data class CollectClassNamesFromSubtreeReturn(val classNames: List<String>)
Link copied to clipboard

Document compatibility mode.

Link copied to clipboard
@Serializable
data class CopyToParameter(val nodeId: Int, val targetNodeId: Int, val insertBeforeNodeId: Int? = null)
Link copied to clipboard
@Serializable
data class CopyToReturn(val nodeId: Int)
Link copied to clipboard
@Serializable
data class CSSComputedStyleProperty(val name: String, val value: String)
Link copied to clipboard
@Serializable
data class DescribeNodeParameter(val nodeId: Int? = null, val backendNodeId: Int? = null, val objectId: String? = null, val depth: Int? = null, val pierce: Boolean? = null)
Link copied to clipboard
@Serializable
data class DescribeNodeReturn(val node: DOM.Node)
Link copied to clipboard
@Serializable
data class DetachedElementInfo(val treeNode: DOM.Node, val retainedNodeIds: List<Int>)

A structure to hold the top-level node of a detached tree and an array of its retained descendants.

Link copied to clipboard
@Serializable
data class DiscardSearchResultsParameter(val searchId: String)
Link copied to clipboard
@Serializable
data class DistributedNodesUpdatedParameter(val insertionPointId: Int, val distributedNodes: List<DOM.BackendNode>)

Called when distribution is changed.

Link copied to clipboard
@Serializable
data class EnableParameter(val includeWhitespace: String? = null)
Link copied to clipboard
@Serializable
data class FocusParameter(val nodeId: Int? = null, val backendNodeId: Int? = null, val objectId: String? = null)
Link copied to clipboard
@Serializable
data class GetAnchorElementParameter(val nodeId: Int, val anchorSpecifier: String? = null)
Link copied to clipboard
@Serializable
data class GetAnchorElementReturn(val nodeId: Int)
Link copied to clipboard
@Serializable
data class GetAttributesParameter(val nodeId: Int)
Link copied to clipboard
@Serializable
data class GetAttributesReturn(val attributes: List<String>)
Link copied to clipboard
@Serializable
data class GetBoxModelParameter(val nodeId: Int? = null, val backendNodeId: Int? = null, val objectId: String? = null)
Link copied to clipboard
@Serializable
data class GetBoxModelReturn(val model: DOM.BoxModel)
Link copied to clipboard
@Serializable
data class GetContainerForNodeParameter(val nodeId: Int, val containerName: String? = null, val physicalAxes: DOM.PhysicalAxes? = null, val logicalAxes: DOM.LogicalAxes? = null, val queriesScrollState: Boolean? = null)
Link copied to clipboard
@Serializable
data class GetContainerForNodeReturn(val nodeId: Int?)
Link copied to clipboard
@Serializable
data class GetContentQuadsParameter(val nodeId: Int? = null, val backendNodeId: Int? = null, val objectId: String? = null)
Link copied to clipboard
@Serializable
data class GetContentQuadsReturn(val quads: List<List<Double>>)
Link copied to clipboard
@Serializable
data class GetDetachedDomNodesReturn(val detachedNodes: List<DOM.DetachedElementInfo>)
Link copied to clipboard
@Serializable
data class GetDocumentParameter(val depth: Int? = null, val pierce: Boolean? = null)
Link copied to clipboard
@Serializable
data class GetDocumentReturn(val root: DOM.Node)
Link copied to clipboard
@Serializable
data class GetElementByRelationParameter(val nodeId: Int, val relation: String)
Link copied to clipboard
@Serializable
data class GetElementByRelationReturn(val nodeId: Int)
Link copied to clipboard
@Serializable
data class GetFileInfoParameter(val objectId: String)
Link copied to clipboard
@Serializable
data class GetFileInfoReturn(val path: String)
Link copied to clipboard
@Serializable
data class GetFlattenedDocumentParameter(val depth: Int? = null, val pierce: Boolean? = null)
Link copied to clipboard
@Serializable
data class GetFlattenedDocumentReturn(val nodes: List<DOM.Node>)
Link copied to clipboard
@Serializable
data class GetFrameOwnerParameter(val frameId: String)
Link copied to clipboard
@Serializable
data class GetFrameOwnerReturn(val backendNodeId: Int, val nodeId: Int?)
Link copied to clipboard
@Serializable
data class GetNodeForLocationParameter(val x: Int, val y: Int, val includeUserAgentShadowDOM: Boolean? = null, val ignorePointerEventsNone: Boolean? = null)
Link copied to clipboard
@Serializable
data class GetNodeForLocationReturn(val backendNodeId: Int, val frameId: String, val nodeId: Int?)
Link copied to clipboard
@Serializable
data class GetNodesForSubtreeByStyleParameter(val nodeId: Int, val computedStyles: List<DOM.CSSComputedStyleProperty>, val pierce: Boolean? = null)
Link copied to clipboard
@Serializable
data class GetNodesForSubtreeByStyleReturn(val nodeIds: List<Int>)
Link copied to clipboard
@Serializable
data class GetNodeStackTracesParameter(val nodeId: Int)
Link copied to clipboard
@Serializable
data class GetNodeStackTracesReturn(val creation: Runtime.StackTrace?)
Link copied to clipboard
@Serializable
data class GetOuterHTMLParameter(val nodeId: Int? = null, val backendNodeId: Int? = null, val objectId: String? = null)
Link copied to clipboard
@Serializable
data class GetOuterHTMLReturn(val outerHTML: String)
@Serializable
data class GetQueryingDescendantsForContainerParameter(val nodeId: Int)
Link copied to clipboard
@Serializable
data class GetQueryingDescendantsForContainerReturn(val nodeIds: List<Int>)
Link copied to clipboard
@Serializable
data class GetRelayoutBoundaryParameter(val nodeId: Int)
Link copied to clipboard
@Serializable
data class GetRelayoutBoundaryReturn(val nodeId: Int)
Link copied to clipboard
@Serializable
data class GetSearchResultsParameter(val searchId: String, val fromIndex: Int, val toIndex: Int)
Link copied to clipboard
@Serializable
data class GetSearchResultsReturn(val nodeIds: List<Int>)
Link copied to clipboard
@Serializable
data class GetTopLayerElementsReturn(val nodeIds: List<Int>)
Link copied to clipboard
@Serializable
data class InlineStyleInvalidatedParameter(val nodeIds: List<Int>)

Fired when Element's inline style is modified via a CSS property modification.

Link copied to clipboard
@Serializable
enum LogicalAxes : Enum<DOM.LogicalAxes>

ContainerSelector logical axes

Link copied to clipboard
@Serializable
data class MoveToParameter(val nodeId: Int, val targetNodeId: Int, val insertBeforeNodeId: Int? = null)
Link copied to clipboard
@Serializable
data class MoveToReturn(val nodeId: Int)
Link copied to clipboard
@Serializable
data class Node(val nodeId: Int, val parentId: Int? = null, val backendNodeId: Int, val nodeType: Int, val nodeName: String, val localName: String, val nodeValue: String, val childNodeCount: Int? = null, val children: List<DOM.Node>? = null, val attributes: List<String>? = null, val documentURL: String? = null, val baseURL: String? = null, val publicId: String? = null, val systemId: String? = null, val internalSubset: String? = null, val xmlVersion: String? = null, val name: String? = null, val value: String? = null, val pseudoType: DOM.PseudoType? = null, val pseudoIdentifier: String? = null, val shadowRootType: DOM.ShadowRootType? = null, val frameId: String? = null, val contentDocument: DOM.Node? = null, val shadowRoots: List<DOM.Node>? = null, val templateContent: DOM.Node? = null, val pseudoElements: List<DOM.Node>? = null, val importedDocument: DOM.Node? = null, val distributedNodes: List<DOM.BackendNode>? = null, val isSVG: Boolean? = null, val compatibilityMode: DOM.CompatibilityMode? = null, val assignedSlot: DOM.BackendNode? = null, val isScrollable: Boolean? = null)

DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes. DOMNode is a base node mirror type.

Link copied to clipboard
@Serializable
data class PerformSearchParameter(val query: String, val includeUserAgentShadowDOM: Boolean? = null)
Link copied to clipboard
@Serializable
data class PerformSearchReturn(val searchId: String, val resultCount: Int)
Link copied to clipboard
@Serializable
enum PhysicalAxes : Enum<DOM.PhysicalAxes>

ContainerSelector physical axes

Link copied to clipboard
@Serializable
data class PseudoElementAddedParameter(val parentId: Int, val pseudoElement: DOM.Node)

Called when a pseudo element is added to an element.

Link copied to clipboard
@Serializable
data class PseudoElementRemovedParameter(val parentId: Int, val pseudoElementId: Int)

Called when a pseudo element is removed from an element.

Link copied to clipboard
@Serializable
enum PseudoType : Enum<DOM.PseudoType>

Pseudo element type.

Link copied to clipboard
@Serializable
data class PushNodeByPathToFrontendParameter(val path: String)
Link copied to clipboard
@Serializable
data class PushNodeByPathToFrontendReturn(val nodeId: Int)
Link copied to clipboard
@Serializable
data class PushNodesByBackendIdsToFrontendParameter(val backendNodeIds: List<Int>)
Link copied to clipboard
@Serializable
data class PushNodesByBackendIdsToFrontendReturn(val nodeIds: List<Int>)
Link copied to clipboard
@Serializable
data class QuerySelectorAllParameter(val nodeId: Int, val selector: String)
Link copied to clipboard
@Serializable
data class QuerySelectorAllReturn(val nodeIds: List<Int>)
Link copied to clipboard
@Serializable
data class QuerySelectorParameter(val nodeId: Int, val selector: String)
Link copied to clipboard
@Serializable
data class QuerySelectorReturn(val nodeId: Int)
Link copied to clipboard
@Serializable
data class Rect(val x: Double, val y: Double, val width: Double, val height: Double)

Rectangle.

Link copied to clipboard
@Serializable
data class RemoveAttributeParameter(val nodeId: Int, val name: String)
Link copied to clipboard
@Serializable
data class RemoveNodeParameter(val nodeId: Int)
Link copied to clipboard
@Serializable
data class RequestChildNodesParameter(val nodeId: Int, val depth: Int? = null, val pierce: Boolean? = null)
Link copied to clipboard
@Serializable
data class RequestNodeParameter(val objectId: String)
Link copied to clipboard
@Serializable
data class RequestNodeReturn(val nodeId: Int)
Link copied to clipboard
@Serializable
data class ResolveNodeParameter(val nodeId: Int? = null, val backendNodeId: Int? = null, val objectGroup: String? = null, val executionContextId: Int? = null)
Link copied to clipboard
@Serializable
data class ResolveNodeReturn(val object: Runtime.RemoteObject)
Link copied to clipboard
@Serializable
data class RGBA(val r: Int, val g: Int, val b: Int, val a: Double? = null)

A structure holding an RGBA color.

Link copied to clipboard
@Serializable
data class ScrollableFlagUpdatedParameter(val nodeId: Int, val isScrollable: Boolean)

Fired when a node's scrollability state changes.

Link copied to clipboard
@Serializable
data class ScrollIntoViewIfNeededParameter(val nodeId: Int? = null, val backendNodeId: Int? = null, val objectId: String? = null, val rect: DOM.Rect? = null)
Link copied to clipboard

Physical scroll orientation

Link copied to clipboard
@Serializable
data class SetAttributesAsTextParameter(val nodeId: Int, val text: String, val name: String? = null)
Link copied to clipboard
@Serializable
data class SetAttributeValueParameter(val nodeId: Int, val name: String, val value: String)
Link copied to clipboard
@Serializable
data class SetChildNodesParameter(val parentId: Int, val nodes: List<DOM.Node>)

Fired when backend wants to provide client with the missing DOM structure. This happens upon most of the calls requesting node ids.

Link copied to clipboard
@Serializable
data class SetFileInputFilesParameter(val files: List<String>, val nodeId: Int? = null, val backendNodeId: Int? = null, val objectId: String? = null)
Link copied to clipboard
@Serializable
data class SetInspectedNodeParameter(val nodeId: Int)
Link copied to clipboard
@Serializable
data class SetNodeNameParameter(val nodeId: Int, val name: String)
Link copied to clipboard
@Serializable
data class SetNodeNameReturn(val nodeId: Int)
Link copied to clipboard
@Serializable
data class SetNodeStackTracesEnabledParameter(val enable: Boolean)
Link copied to clipboard
@Serializable
data class SetNodeValueParameter(val nodeId: Int, val value: String)
Link copied to clipboard
@Serializable
data class SetOuterHTMLParameter(val nodeId: Int, val outerHTML: String)
Link copied to clipboard
@Serializable
data class ShadowRootPoppedParameter(val hostId: Int, val rootId: Int)

Called when shadow root is popped from the element.

Link copied to clipboard
@Serializable
data class ShadowRootPushedParameter(val hostId: Int, val root: DOM.Node)

Called when shadow root is pushed into the element.

Link copied to clipboard
@Serializable
enum ShadowRootType : Enum<DOM.ShadowRootType>

Shadow root type.

Link copied to clipboard
@Serializable
data class ShapeOutsideInfo(val bounds: List<Double>, val shape: List<JsonElement>, val marginShape: List<JsonElement>)

CSS Shape Outside details.

Properties

Link copied to clipboard

Fired when Element's attribute is modified.

Link copied to clipboard

Fired when Element's attribute is removed.

Link copied to clipboard

Mirrors DOMCharacterDataModified event.

Link copied to clipboard

Fired when Container's child node count has changed.

Link copied to clipboard

Mirrors DOMNodeInserted event.

Link copied to clipboard

Mirrors DOMNodeRemoved event.

Link copied to clipboard

Called when distribution is changed.

Link copied to clipboard

Fired when Document has been totally updated. Node ids are no longer valid.

Link copied to clipboard

Fired when Element's inline style is modified via a CSS property modification.

Link copied to clipboard

Called when a pseudo element is added to an element.

Link copied to clipboard

Called when a pseudo element is removed from an element.

Link copied to clipboard

Fired when a node's scrollability state changes.

Link copied to clipboard

Fired when backend wants to provide client with the missing DOM structure. This happens upon most of the calls requesting node ids.

Link copied to clipboard

Called when shadow root is popped from the element.

Link copied to clipboard

Called when shadow root is pushed into the element.

Link copied to clipboard

Called when top layer elements are changed.

Functions

Link copied to clipboard

Collects class names for the node with given id and all of it's child nodes.

Link copied to clipboard
suspend fun copyTo(args: DOM.CopyToParameter, mode: CommandMode = CommandMode.DEFAULT): DOM.CopyToReturn
suspend fun copyTo(nodeId: Int, targetNodeId: Int, insertBeforeNodeId: Int? = null): DOM.CopyToReturn

Creates a deep copy of the specified node and places it into the target container before the given anchor.

Link copied to clipboard
suspend fun describeNode(args: DOM.DescribeNodeParameter, mode: CommandMode = CommandMode.DEFAULT): DOM.DescribeNodeReturn
suspend fun describeNode(nodeId: Int? = null, backendNodeId: Int? = null, objectId: String? = null, depth: Int? = null, pierce: Boolean? = null): DOM.DescribeNodeReturn

Describes node given its id, does not require domain to be enabled. Does not start tracking any objects, can be used for automation.

Link copied to clipboard
suspend fun disable(mode: CommandMode = CommandMode.DEFAULT)

Disables DOM agent for the given page.

Link copied to clipboard
suspend fun discardSearchResults(searchId: String)
suspend fun discardSearchResults(args: DOM.DiscardSearchResultsParameter, mode: CommandMode = CommandMode.DEFAULT)

Discards search results from the session with the given id. getSearchResults should no longer be called for that search.

Link copied to clipboard
suspend fun enable(includeWhitespace: String? = null)
suspend fun enable(args: DOM.EnableParameter, mode: CommandMode = CommandMode.DEFAULT)

Enables DOM agent for the given page.

Link copied to clipboard
suspend fun focus(args: DOM.FocusParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun focus(nodeId: Int? = null, backendNodeId: Int? = null, objectId: String? = null)

Focuses the given element.

Link copied to clipboard
suspend fun getAnchorElement(nodeId: Int, anchorSpecifier: String? = null): DOM.GetAnchorElementReturn

Returns the target anchor element of the given anchor query according to https://www.w3.org/TR/css-anchor-position-1/#target.

Link copied to clipboard
suspend fun getAttributes(args: DOM.GetAttributesParameter, mode: CommandMode = CommandMode.DEFAULT): DOM.GetAttributesReturn

Returns attributes for the specified node.

Link copied to clipboard
suspend fun getBoxModel(args: DOM.GetBoxModelParameter, mode: CommandMode = CommandMode.DEFAULT): DOM.GetBoxModelReturn
suspend fun getBoxModel(nodeId: Int? = null, backendNodeId: Int? = null, objectId: String? = null): DOM.GetBoxModelReturn

Returns boxes for the given node.

Link copied to clipboard
suspend fun getContainerForNode(nodeId: Int, containerName: String? = null, physicalAxes: DOM.PhysicalAxes? = null, logicalAxes: DOM.LogicalAxes? = null, queriesScrollState: Boolean? = null): DOM.GetContainerForNodeReturn

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.

Link copied to clipboard
suspend fun getContentQuads(nodeId: Int? = null, backendNodeId: Int? = null, objectId: String? = null): DOM.GetContentQuadsReturn

Returns quads that describe node position on the page. This method might return multiple quads for inline nodes.

Link copied to clipboard
suspend fun getDetachedDomNodes(mode: CommandMode = CommandMode.DEFAULT): DOM.GetDetachedDomNodesReturn

Returns list of detached nodes

Link copied to clipboard
suspend fun getDocument(args: DOM.GetDocumentParameter, mode: CommandMode = CommandMode.DEFAULT): DOM.GetDocumentReturn
suspend fun getDocument(depth: Int? = null, pierce: Boolean? = null): DOM.GetDocumentReturn

Returns the root DOM node (and optionally the subtree) to the caller. Implicitly enables the DOM domain events for the current target.

Link copied to clipboard

Returns the NodeId of the matched element according to certain relations.

Link copied to clipboard
suspend fun getFileInfo(objectId: String): DOM.GetFileInfoReturn
suspend fun getFileInfo(args: DOM.GetFileInfoParameter, mode: CommandMode = CommandMode.DEFAULT): DOM.GetFileInfoReturn

Returns file information for the given File wrapper.

Link copied to clipboard
suspend fun getFlattenedDocument(depth: Int? = null, pierce: Boolean? = null): DOM.GetFlattenedDocumentReturn

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.

Link copied to clipboard
suspend fun getFrameOwner(args: DOM.GetFrameOwnerParameter, mode: CommandMode = CommandMode.DEFAULT): DOM.GetFrameOwnerReturn

Returns iframe node that owns iframe with the given domain.

Link copied to clipboard
suspend fun getNodeForLocation(x: Int, y: Int, includeUserAgentShadowDOM: Boolean? = null, ignorePointerEventsNone: Boolean? = null): DOM.GetNodeForLocationReturn

Returns node id at given location. Depending on whether DOM domain is enabled, nodeId is either returned or not.

Link copied to clipboard

Finds nodes with a given computed style in a subtree.

Link copied to clipboard

Gets stack traces associated with a Node. As of now, only provides stack trace for Node creation.

Link copied to clipboard
suspend fun getOuterHTML(args: DOM.GetOuterHTMLParameter, mode: CommandMode = CommandMode.DEFAULT): DOM.GetOuterHTMLReturn
suspend fun getOuterHTML(nodeId: Int? = null, backendNodeId: Int? = null, objectId: String? = null): DOM.GetOuterHTMLReturn

Returns node's HTML markup.

Link copied to clipboard

Returns the descendants of a container query container that have container queries against this container.

Link copied to clipboard

Returns the id of the nearest ancestor that is a relayout boundary.

Link copied to clipboard
suspend fun getSearchResults(searchId: String, fromIndex: Int, toIndex: Int): DOM.GetSearchResultsReturn

Returns search results from given fromIndex to given toIndex from the search with the given identifier.

Link copied to clipboard
suspend fun getTopLayerElements(mode: CommandMode = CommandMode.DEFAULT): DOM.GetTopLayerElementsReturn

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.

Link copied to clipboard
suspend fun hideHighlight(mode: CommandMode = CommandMode.DEFAULT)

Hides any highlight.

Link copied to clipboard
suspend fun highlightNode(mode: CommandMode = CommandMode.DEFAULT)

Highlights DOM node.

Link copied to clipboard
suspend fun highlightRect(mode: CommandMode = CommandMode.DEFAULT)

Highlights given rectangle.

Link copied to clipboard
suspend fun markUndoableState(mode: CommandMode = CommandMode.DEFAULT)

Marks last undoable state.

Link copied to clipboard
suspend fun moveTo(args: DOM.MoveToParameter, mode: CommandMode = CommandMode.DEFAULT): DOM.MoveToReturn
suspend fun moveTo(nodeId: Int, targetNodeId: Int, insertBeforeNodeId: Int? = null): DOM.MoveToReturn

Moves node into the new container, places it before the given anchor.

Link copied to clipboard
suspend fun performSearch(args: DOM.PerformSearchParameter, mode: CommandMode = CommandMode.DEFAULT): DOM.PerformSearchReturn
suspend fun performSearch(query: String, includeUserAgentShadowDOM: Boolean? = null): DOM.PerformSearchReturn

Searches for a given string in the DOM tree. Use getSearchResults to access search results or cancelSearch to end this search session.

Link copied to clipboard

Requests that the node is sent to the caller given its path. // FIXME, use XPath

Link copied to clipboard

Requests that a batch of nodes is sent to the caller given their backend node ids.

Link copied to clipboard
suspend fun querySelector(args: DOM.QuerySelectorParameter, mode: CommandMode = CommandMode.DEFAULT): DOM.QuerySelectorReturn
suspend fun querySelector(nodeId: Int, selector: String): DOM.QuerySelectorReturn

Executes querySelector on a given node.

Link copied to clipboard
suspend fun querySelectorAll(nodeId: Int, selector: String): DOM.QuerySelectorAllReturn

Executes querySelectorAll on a given node.

Link copied to clipboard
suspend fun redo(mode: CommandMode = CommandMode.DEFAULT)

Re-does the last undone action.

Link copied to clipboard
suspend fun removeAttribute(args: DOM.RemoveAttributeParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun removeAttribute(nodeId: Int, name: String)

Removes attribute with given name from an element with given id.

Link copied to clipboard
suspend fun removeNode(nodeId: Int)
suspend fun removeNode(args: DOM.RemoveNodeParameter, mode: CommandMode = CommandMode.DEFAULT)

Removes node with given id.

Link copied to clipboard
suspend fun requestChildNodes(args: DOM.RequestChildNodesParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun requestChildNodes(nodeId: Int, depth: Int? = null, pierce: Boolean? = null)

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.

Link copied to clipboard
suspend fun requestNode(objectId: String): DOM.RequestNodeReturn
suspend fun requestNode(args: DOM.RequestNodeParameter, mode: CommandMode = CommandMode.DEFAULT): DOM.RequestNodeReturn

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.

Link copied to clipboard
suspend fun resolveNode(args: DOM.ResolveNodeParameter, mode: CommandMode = CommandMode.DEFAULT): DOM.ResolveNodeReturn
suspend fun resolveNode(nodeId: Int? = null, backendNodeId: Int? = null, objectGroup: String? = null, executionContextId: Int? = null): DOM.ResolveNodeReturn

Resolves the JavaScript node object for a given NodeId or BackendNodeId.

Link copied to clipboard
suspend fun scrollIntoViewIfNeeded(args: DOM.ScrollIntoViewIfNeededParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun scrollIntoViewIfNeeded(nodeId: Int? = null, backendNodeId: Int? = null, objectId: String? = null, rect: DOM.Rect? = null)

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.

Link copied to clipboard
suspend fun setAttributesAsText(args: DOM.SetAttributesAsTextParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun setAttributesAsText(nodeId: Int, text: String, name: String? = null)

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.

Link copied to clipboard
suspend fun setAttributeValue(args: DOM.SetAttributeValueParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun setAttributeValue(nodeId: Int, name: String, value: String)

Sets attribute for an element with given id.

Link copied to clipboard
suspend fun setFileInputFiles(args: DOM.SetFileInputFilesParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun setFileInputFiles(files: List<String>, nodeId: Int? = null, backendNodeId: Int? = null, objectId: String? = null)

Sets files for the given file input element.

Link copied to clipboard
suspend fun setInspectedNode(nodeId: Int)
suspend fun setInspectedNode(args: DOM.SetInspectedNodeParameter, mode: CommandMode = CommandMode.DEFAULT)

Enables console to refer to the node with given id via

$x (see Command Line API for more details $

x functions).

Link copied to clipboard
suspend fun setNodeName(args: DOM.SetNodeNameParameter, mode: CommandMode = CommandMode.DEFAULT): DOM.SetNodeNameReturn
suspend fun setNodeName(nodeId: Int, name: String): DOM.SetNodeNameReturn

Sets node name for a node with given id.

Link copied to clipboard
suspend fun setNodeStackTracesEnabled(enable: Boolean)
suspend fun setNodeStackTracesEnabled(args: DOM.SetNodeStackTracesEnabledParameter, mode: CommandMode = CommandMode.DEFAULT)

Sets if stack traces should be captured for Nodes. See Node.getNodeStackTraces. Default is disabled.

Link copied to clipboard
suspend fun setNodeValue(args: DOM.SetNodeValueParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun setNodeValue(nodeId: Int, value: String)

Sets node value for a node with given id.

Link copied to clipboard
suspend fun setOuterHTML(args: DOM.SetOuterHTMLParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun setOuterHTML(nodeId: Int, outerHTML: String)

Sets node HTML markup, returns new node id.

Link copied to clipboard
suspend fun undo(mode: CommandMode = CommandMode.DEFAULT)

Undoes the last performed action.