pl.wendigo.chrome.api.dom / DOMOperations

DOMOperations

class DOMOperations (source)

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.

Link
Protocol DOM domain documentation.

Functions

attributeModified

fun attributeModified(): Flowable<AttributeModifiedEvent>

Fired when Element's attribute is modified.

attributeModifiedTimed

fun attributeModifiedTimed(): Flowable<Timed<AttributeModifiedEvent>>

Fired when Element's attribute is modified.

attributeRemoved

fun attributeRemoved(): Flowable<AttributeRemovedEvent>

Fired when Element's attribute is removed.

attributeRemovedTimed

fun attributeRemovedTimed(): Flowable<Timed<AttributeRemovedEvent>>

Fired when Element's attribute is removed.

characterDataModified

fun characterDataModified(): Flowable<CharacterDataModifiedEvent>

Mirrors DOMCharacterDataModified event.

characterDataModifiedTimed

fun characterDataModifiedTimed(): Flowable<Timed<CharacterDataModifiedEvent>>

Mirrors DOMCharacterDataModified event.

childNodeCountUpdated

fun childNodeCountUpdated(): Flowable<ChildNodeCountUpdatedEvent>

Fired when Container's child node count has changed.

childNodeCountUpdatedTimed

fun childNodeCountUpdatedTimed(): Flowable<Timed<ChildNodeCountUpdatedEvent>>

Fired when Container's child node count has changed.

childNodeInserted

fun childNodeInserted(): Flowable<ChildNodeInsertedEvent>

Mirrors DOMNodeInserted event.

childNodeInsertedTimed

fun childNodeInsertedTimed(): Flowable<Timed<ChildNodeInsertedEvent>>

Mirrors DOMNodeInserted event.

childNodeRemoved

fun childNodeRemoved(): Flowable<ChildNodeRemovedEvent>

Mirrors DOMNodeRemoved event.

childNodeRemovedTimed

fun childNodeRemovedTimed(): Flowable<Timed<ChildNodeRemovedEvent>>

Mirrors DOMNodeRemoved event.

collectClassNamesFromSubtree

fun collectClassNamesFromSubtree(input: CollectClassNamesFromSubtreeRequest): Single<CollectClassNamesFromSubtreeResponse>

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

copyTo

fun copyTo(input: CopyToRequest): Single<CopyToResponse>

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

describeNode

fun describeNode(input: DescribeNodeRequest): Single<DescribeNodeResponse>

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

disable

fun disable(): Single<ResponseFrame>

Disables DOM agent for the given page.

discardSearchResults

fun discardSearchResults(input: DiscardSearchResultsRequest): Single<ResponseFrame>

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

distributedNodesUpdated

fun distributedNodesUpdated(): Flowable<DistributedNodesUpdatedEvent>

Called when distrubution is changed.

distributedNodesUpdatedTimed

fun distributedNodesUpdatedTimed(): Flowable<Timed<DistributedNodesUpdatedEvent>>

Called when distrubution is changed.

documentUpdated

fun documentUpdated(): Flowable<Event>

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

documentUpdatedTimed

fun documentUpdatedTimed(): Flowable<Timed<Event>>

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

enable

fun enable(): Single<ResponseFrame>

Enables DOM agent for the given page.

events

fun events(): Flowable<Event>

Returns flowable capturing all DOM domains events.

focus

fun focus(input: FocusRequest): Single<ResponseFrame>

Focuses the given element.

getAttributes

fun getAttributes(input: GetAttributesRequest): Single<GetAttributesResponse>

Returns attributes for the specified node.

getBoxModel

fun getBoxModel(input: GetBoxModelRequest): Single<GetBoxModelResponse>

Returns boxes for the given node.

getContentQuads

fun getContentQuads(input: GetContentQuadsRequest): Single<GetContentQuadsResponse>

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

getDocument

fun getDocument(input: GetDocumentRequest): Single<GetDocumentResponse>

Returns the root DOM node (and optionally the subtree) to the caller.

getFileInfo

fun getFileInfo(input: GetFileInfoRequest): Single<GetFileInfoResponse>

Returns file information for the given File wrapper.

getFlattenedDocument

fun getFlattenedDocument(input: GetFlattenedDocumentRequest): Single<GetFlattenedDocumentResponse>

Returns the root DOM node (and optionally the subtree) to the caller.

getFrameOwner

fun getFrameOwner(input: GetFrameOwnerRequest): Single<GetFrameOwnerResponse>

Returns iframe node that owns iframe with the given domain.

getNodeForLocation

fun getNodeForLocation(input: GetNodeForLocationRequest): Single<GetNodeForLocationResponse>

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

getNodeStackTraces

fun getNodeStackTraces(input: GetNodeStackTracesRequest): Single<GetNodeStackTracesResponse>

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

getOuterHTML

fun getOuterHTML(input: GetOuterHTMLRequest): Single<GetOuterHTMLResponse>

Returns node's HTML markup.

getRelayoutBoundary

fun getRelayoutBoundary(input: GetRelayoutBoundaryRequest): Single<GetRelayoutBoundaryResponse>

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

getSearchResults

fun getSearchResults(input: GetSearchResultsRequest): Single<GetSearchResultsResponse>

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

hideHighlight

fun hideHighlight(): Single<ResponseFrame>

Hides any highlight.

highlightNode

fun highlightNode(): Single<ResponseFrame>

Highlights DOM node.

highlightRect

fun highlightRect(): Single<ResponseFrame>

Highlights given rectangle.

inlineStyleInvalidated

fun inlineStyleInvalidated(): Flowable<InlineStyleInvalidatedEvent>

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

inlineStyleInvalidatedTimed

fun inlineStyleInvalidatedTimed(): Flowable<Timed<InlineStyleInvalidatedEvent>>

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

markUndoableState

fun markUndoableState(): Single<ResponseFrame>

Marks last undoable state.

moveTo

fun moveTo(input: MoveToRequest): Single<MoveToResponse>

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

performSearch

fun performSearch(input: PerformSearchRequest): Single<PerformSearchResponse>

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

pseudoElementAdded

fun pseudoElementAdded(): Flowable<PseudoElementAddedEvent>

Called when a pseudo element is added to an element.

pseudoElementAddedTimed

fun pseudoElementAddedTimed(): Flowable<Timed<PseudoElementAddedEvent>>

Called when a pseudo element is added to an element.

pseudoElementRemoved

fun pseudoElementRemoved(): Flowable<PseudoElementRemovedEvent>

Called when a pseudo element is removed from an element.

pseudoElementRemovedTimed

fun pseudoElementRemovedTimed(): Flowable<Timed<PseudoElementRemovedEvent>>

Called when a pseudo element is removed from an element.

pushNodeByPathToFrontend

fun pushNodeByPathToFrontend(input: PushNodeByPathToFrontendRequest): Single<PushNodeByPathToFrontendResponse>

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

pushNodesByBackendIdsToFrontend

fun pushNodesByBackendIdsToFrontend(input: PushNodesByBackendIdsToFrontendRequest): Single<PushNodesByBackendIdsToFrontendResponse>

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

querySelector

fun querySelector(input: QuerySelectorRequest): Single<QuerySelectorResponse>

Executes querySelector on a given node.

querySelectorAll

fun querySelectorAll(input: QuerySelectorAllRequest): Single<QuerySelectorAllResponse>

Executes querySelectorAll on a given node.

redo

fun redo(): Single<ResponseFrame>

Re-does the last undone action.

removeAttribute

fun removeAttribute(input: RemoveAttributeRequest): Single<ResponseFrame>

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

removeNode

fun removeNode(input: RemoveNodeRequest): Single<ResponseFrame>

Removes node with given id.

requestChildNodes

fun requestChildNodes(input: RequestChildNodesRequest): Single<ResponseFrame>

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.

requestNode

fun requestNode(input: RequestNodeRequest): Single<RequestNodeResponse>

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.

resolveNode

fun resolveNode(input: ResolveNodeRequest): Single<ResolveNodeResponse>

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

setAttributesAsText

fun setAttributesAsText(input: SetAttributesAsTextRequest): Single<ResponseFrame>

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.

setAttributeValue

fun setAttributeValue(input: SetAttributeValueRequest): Single<ResponseFrame>

Sets attribute for an element with given id.

setChildNodes

fun setChildNodes(): Flowable<SetChildNodesEvent>

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

setChildNodesTimed

fun setChildNodesTimed(): Flowable<Timed<SetChildNodesEvent>>

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

setFileInputFiles

fun setFileInputFiles(input: SetFileInputFilesRequest): Single<ResponseFrame>

Sets files for the given file input element.

setInspectedNode

fun setInspectedNode(input: SetInspectedNodeRequest): Single<ResponseFrame>

Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).

setNodeName

fun setNodeName(input: SetNodeNameRequest): Single<SetNodeNameResponse>

Sets node name for a node with given id.

setNodeStackTracesEnabled

fun setNodeStackTracesEnabled(input: SetNodeStackTracesEnabledRequest): Single<ResponseFrame>

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

setNodeValue

fun setNodeValue(input: SetNodeValueRequest): Single<ResponseFrame>

Sets node value for a node with given id.

setOuterHTML

fun setOuterHTML(input: SetOuterHTMLRequest): Single<ResponseFrame>

Sets node HTML markup, returns new node id.

shadowRootPopped

fun shadowRootPopped(): Flowable<ShadowRootPoppedEvent>

Called when shadow root is popped from the element.

shadowRootPoppedTimed

fun shadowRootPoppedTimed(): Flowable<Timed<ShadowRootPoppedEvent>>

Called when shadow root is popped from the element.

shadowRootPushed

fun shadowRootPushed(): Flowable<ShadowRootPushedEvent>

Called when shadow root is pushed into the element.

shadowRootPushedTimed

fun shadowRootPushedTimed(): Flowable<Timed<ShadowRootPushedEvent>>

Called when shadow root is pushed into the element.

undo

fun undo(): Single<ResponseFrame>

Undoes the last performed action.