public interface DOM
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
Modifier and Type | Method | Description |
---|---|---|
List<String> |
collectClassNamesFromSubtree(Integer nodeId) |
Collects class names for the node with given id and all of it's child nodes.
|
Integer |
copyTo(Integer nodeId,
Integer targetNodeId) |
Creates a deep copy of the specified node and places it into the target container before the
given anchor.
|
Integer |
copyTo(Integer nodeId,
Integer targetNodeId,
Integer insertBeforeNodeId) |
Creates a deep copy of the specified node and places it into the target container before the
given anchor.
|
Node |
describeNode() |
Describes node given its id, does not require domain to be enabled.
|
Node |
describeNode(Integer nodeId,
Integer backendNodeId,
String objectId,
Integer depth,
Boolean pierce) |
Describes node given its id, does not require domain to be enabled.
|
void |
disable() |
Disables DOM agent for the given page.
|
void |
discardSearchResults(String searchId) |
Discards search results from the session with the given id.
|
void |
enable() |
Enables DOM agent for the given page.
|
void |
focus() |
Focuses the given element.
|
void |
focus(Integer nodeId,
Integer backendNodeId,
String objectId) |
Focuses the given element.
|
List<String> |
getAttributes(Integer nodeId) |
Returns attributes for the specified node.
|
BoxModel |
getBoxModel() |
Returns boxes for the given node.
|
BoxModel |
getBoxModel(Integer nodeId,
Integer backendNodeId,
String objectId) |
Returns boxes for the given node.
|
Node |
getDocument() |
Returns the root DOM node (and optionally the subtree) to the caller.
|
Node |
getDocument(Integer depth,
Boolean pierce) |
Returns the root DOM node (and optionally the subtree) to the caller.
|
List<Node> |
getFlattenedDocument() |
Returns the root DOM node (and optionally the subtree) to the caller.
|
List<Node> |
getFlattenedDocument(Integer depth,
Boolean pierce) |
Returns the root DOM node (and optionally the subtree) to the caller.
|
Integer |
getNodeForLocation(Integer x,
Integer y) |
Returns node id at given location.
|
Integer |
getNodeForLocation(Integer x,
Integer y,
Boolean includeUserAgentShadowDOM) |
Returns node id at given location.
|
String |
getOuterHTML() |
Returns node's HTML markup.
|
String |
getOuterHTML(Integer nodeId) |
Returns node's HTML markup.
|
String |
getOuterHTML(Integer nodeId,
Integer backendNodeId,
String objectId) |
Returns node's HTML markup.
|
Integer |
getRelayoutBoundary(Integer nodeId) |
Returns the id of the nearest ancestor that is a relayout boundary.
|
List<Integer> |
getSearchResults(String searchId,
Integer fromIndex,
Integer toIndex) |
Returns search results from given
fromIndex to given toIndex from the search with the given
identifier. |
void |
hideHighlight() |
Hides any highlight.
|
void |
highlightNode() |
Highlights DOM node.
|
void |
highlightRect() |
Highlights given rectangle.
|
void |
markUndoableState() |
Marks last undoable state.
|
Integer |
moveTo(Integer nodeId,
Integer targetNodeId) |
Moves node into the new container, places it before the given anchor.
|
Integer |
moveTo(Integer nodeId,
Integer targetNodeId,
Integer insertBeforeNodeId) |
Moves node into the new container, places it before the given anchor.
|
PerformSearchResult |
performSearch(String query) |
Searches for a given string in the DOM tree.
|
PerformSearchResult |
performSearch(String query,
Boolean includeUserAgentShadowDOM) |
Searches for a given string in the DOM tree.
|
Integer |
pushNodeByPathToFrontend(String path) |
Requests that the node is sent to the caller given its path.
|
List<Integer> |
pushNodesByBackendIdsToFrontend(List<Integer> backendNodeIds) |
Requests that a batch of nodes is sent to the caller given their backend node ids.
|
Integer |
querySelector(Integer nodeId,
String selector) |
Executes
querySelector on a given node. |
List<Integer> |
querySelectorAll(Integer nodeId,
String selector) |
Executes
querySelectorAll on a given node. |
void |
redo() |
Re-does the last undone action.
|
void |
removeAttribute(Integer nodeId,
String name) |
Removes attribute with given name from an element with given id.
|
void |
removeNode(Integer nodeId) |
Removes node with given id.
|
void |
requestChildNodes(Integer nodeId) |
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. |
void |
requestChildNodes(Integer nodeId,
Integer depth,
Boolean pierce) |
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. |
Integer |
requestNode(String objectId) |
Requests that the node is sent to the caller given the JavaScript node object reference.
|
RemoteObject |
resolveNode() |
Resolves the JavaScript node object for a given NodeId or BackendNodeId.
|
RemoteObject |
resolveNode(Integer nodeId,
Integer backendNodeId,
String objectGroup) |
Resolves the JavaScript node object for a given NodeId or BackendNodeId.
|
void |
setAttributesAsText(Integer nodeId,
String text) |
Sets attributes on element with given id.
|
void |
setAttributesAsText(Integer nodeId,
String text,
String name) |
Sets attributes on element with given id.
|
void |
setAttributeValue(Integer nodeId,
String name,
String value) |
Sets attribute for an element with given id.
|
void |
setFileInputFiles(List<String> files) |
Sets files for the given file input element.
|
void |
setFileInputFiles(List<String> files,
Integer nodeId,
Integer backendNodeId,
String objectId) |
Sets files for the given file input element.
|
void |
setInspectedNode(Integer nodeId) |
Enables console to refer to the node with given id via (see Command Line API for more details
functions).
|
Integer |
setNodeName(Integer nodeId,
String name) |
Sets node name for a node with given id.
|
void |
setNodeValue(Integer nodeId,
String value) |
Sets node value for a node with given id.
|
void |
setOuterHTML(Integer nodeId,
String outerHTML) |
Sets node HTML markup, returns new node id.
|
void |
undo() |
Undoes the last performed action.
|
List<String> collectClassNamesFromSubtree(Integer nodeId)
nodeId
- Id of the node to collect class names.Integer copyTo(Integer nodeId, Integer targetNodeId, Integer insertBeforeNodeId)
nodeId
- Id of the node to copy.targetNodeId
- Id of the element to drop the copy into.insertBeforeNodeId
- Drop the copy before this node (if absent, the copy becomes the last child of
targetNodeId
).Node describeNode(Integer nodeId, Integer backendNodeId, String objectId, Integer depth, Boolean pierce)
nodeId
- Identifier of the node.backendNodeId
- Identifier of the backend node.objectId
- JavaScript object id of the node wrapper.depth
- The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the
entire subtree or provide an integer larger than 0.pierce
- Whether or not iframes and shadow roots should be traversed when returning the subtree
(default is false).void disable()
void discardSearchResults(String searchId)
getSearchResults
should no longer
be called for that search.searchId
- Unique search session identifier.void enable()
void focus(Integer nodeId, Integer backendNodeId, String objectId)
nodeId
- Identifier of the node.backendNodeId
- Identifier of the backend node.objectId
- JavaScript object id of the node wrapper.List<String> getAttributes(Integer nodeId)
nodeId
- Id of the node to retrieve attibutes for.BoxModel getBoxModel(Integer nodeId, Integer backendNodeId, String objectId)
nodeId
- Identifier of the node.backendNodeId
- Identifier of the backend node.objectId
- JavaScript object id of the node wrapper.Node getDocument(Integer depth, Boolean pierce)
depth
- The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the
entire subtree or provide an integer larger than 0.pierce
- Whether or not iframes and shadow roots should be traversed when returning the subtree
(default is false).List<Node> getFlattenedDocument(Integer depth, Boolean pierce)
depth
- The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the
entire subtree or provide an integer larger than 0.pierce
- Whether or not iframes and shadow roots should be traversed when returning the subtree
(default is false).Integer getNodeForLocation(Integer x, Integer y, Boolean includeUserAgentShadowDOM)
x
- X coordinate.y
- Y coordinate.includeUserAgentShadowDOM
- False to skip to the nearest non-UA shadow root ancestor (default: false).String getOuterHTML(Integer nodeId)
nodeId
- Identifier of the node.String getOuterHTML(Integer nodeId, Integer backendNodeId, String objectId)
nodeId
- Identifier of the node.backendNodeId
- Identifier of the backend node.objectId
- JavaScript object id of the node wrapper.Integer getRelayoutBoundary(Integer nodeId)
nodeId
- Id of the node.List<Integer> getSearchResults(String searchId, Integer fromIndex, Integer toIndex)
fromIndex
to given toIndex
from the search with the given
identifier.searchId
- Unique search session identifier.fromIndex
- Start index of the search result to be returned.toIndex
- End index of the search result to be returned.void hideHighlight()
void highlightNode()
void highlightRect()
void markUndoableState()
Integer moveTo(Integer nodeId, Integer targetNodeId, Integer insertBeforeNodeId)
nodeId
- Id of the node to move.targetNodeId
- Id of the element to drop the moved node into.insertBeforeNodeId
- Drop node before this one (if absent, the moved node becomes the last child of
targetNodeId
).PerformSearchResult performSearch(String query, Boolean includeUserAgentShadowDOM)
getSearchResults
to access search results or
cancelSearch
to end this search session.query
- Plain text or query selector or XPath search query.includeUserAgentShadowDOM
- True to search in user agent shadow DOM.Integer pushNodeByPathToFrontend(String path)
path
- Path to node in the proprietary format.List<Integer> pushNodesByBackendIdsToFrontend(List<Integer> backendNodeIds)
backendNodeIds
- The array of backend node ids.Integer querySelector(Integer nodeId, String selector)
querySelector
on a given node.nodeId
- Id of the node to query upon.selector
- Selector string.List<Integer> querySelectorAll(Integer nodeId, String selector)
querySelectorAll
on a given node.nodeId
- Id of the node to query upon.selector
- Selector string.void redo()
void removeAttribute(Integer nodeId, String name)
nodeId
- Id of the element to remove attribute from.name
- Name of the attribute to remove.void removeNode(Integer nodeId)
nodeId
- Id of the node to remove.void requestChildNodes(Integer nodeId, Integer depth, Boolean pierce)
setChildNodes
events where not only immediate children are retrieved, but all children down to
the specified depth.nodeId
- Id of the node to get children for.depth
- The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the
entire subtree or provide an integer larger than 0.pierce
- Whether or not iframes and shadow roots should be traversed when returning the sub-tree
(default is false).Integer requestNode(String objectId)
setChildNodes
notifications.objectId
- JavaScript object id to convert into node.RemoteObject resolveNode(Integer nodeId, Integer backendNodeId, String objectGroup)
nodeId
- Id of the node to resolve.backendNodeId
- Backend identifier of the node to resolve.objectGroup
- Symbolic group name that can be used to release multiple objects.void setAttributeValue(Integer nodeId, String name, String value)
nodeId
- Id of the element to set attribute for.name
- Attribute name.value
- Attribute value.void setAttributesAsText(Integer nodeId, String text, String name)
nodeId
- Id of the element to set attributes for.text
- Text with a number of attributes. Will parse this text using HTML parser.name
- Attribute name to replace with new attributes derived from text in case text parsed
successfully.void setFileInputFiles(List<String> files, Integer nodeId, Integer backendNodeId, String objectId)
files
- Array of file paths to set.nodeId
- Identifier of the node.backendNodeId
- Identifier of the backend node.objectId
- JavaScript object id of the node wrapper.void setInspectedNode(Integer nodeId)
nodeId
- DOM node id to be accessible by means of x command line API.Integer setNodeName(Integer nodeId, String name)
nodeId
- Id of the node to set name for.name
- New node's name.void setNodeValue(Integer nodeId, String value)
nodeId
- Id of the node to set value for.value
- New node's value.void setOuterHTML(Integer nodeId, String outerHTML)
nodeId
- Id of the node to set markup for.outerHTML
- Outer HTML markup to set.void undo()
Integer copyTo(Integer nodeId, Integer targetNodeId)
nodeId
- Id of the node to copy.targetNodeId
- Id of the element to drop the copy into.Node describeNode()
void focus()
BoxModel getBoxModel()
Node getDocument()
List<Node> getFlattenedDocument()
Integer getNodeForLocation(Integer x, Integer y)
x
- X coordinate.y
- Y coordinate.String getOuterHTML()
Integer moveTo(Integer nodeId, Integer targetNodeId)
nodeId
- Id of the node to move.targetNodeId
- Id of the element to drop the moved node into.PerformSearchResult performSearch(String query)
getSearchResults
to access search results or
cancelSearch
to end this search session.query
- Plain text or query selector or XPath search query.void requestChildNodes(Integer nodeId)
setChildNodes
events where not only immediate children are retrieved, but all children down to
the specified depth.nodeId
- Id of the node to get children for.RemoteObject resolveNode()
void setAttributesAsText(Integer nodeId, String text)
nodeId
- Id of the element to set attributes for.text
- Text with a number of attributes. Will parse this text using HTML parser.Copyright © 2017–2018 WebFolder OÜ. All rights reserved.