Chrome Remote Interface v0.1.0 ChromeRemoteInterface.RPC.DOM View 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 to this section Summary
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 attributes for the specified node
Returns boxes for the currently selected nodes
Returns the root DOM node (and optionally the subtree) to the caller
Returns the root DOM node (and optionally the subtree) to the caller
Returns node id at given location
Returns node’s HTML markup
Returns the id of the nearest ancestor that is a relayout boundary
Returns search results from given fromIndex
to given toIndex
from the sarch with the given identifier
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
Sets attribute for an element with given id
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 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 node value for a node with given id
Sets node HTML markup, returns new node id
Undoes the last performed action
Link to this section Functions
Collects class names for the node with given id and all of it’s child nodes.
Parameters:
nodeId -
Creates a deep copy of the specified node and places it into the target container before the given anchor.
Parameters:
nodeId - targetNodeId
).
Describes node given its id, does not require domain to be enabled. Does not start tracking any objects, can be used for automation.
Parameters:
nodeId -
Disables DOM agent for the given page.
Parameters:
Discards search results from the session with the given id. getSearchResults
should no longer be called for that search.
Parameters:
searchId -
Enables DOM agent for the given page.
Parameters:
Focuses the given element.
Parameters:
nodeId -
Returns attributes for the specified node.
Parameters:
nodeId -
Returns boxes for the currently selected nodes.
Parameters:
nodeId -
Returns the root DOM node (and optionally the subtree) to the caller.
Parameters:
depth -
Returns the root DOM node (and optionally the subtree) to the caller.
Parameters:
depth -
Returns node id at given location.
Parameters:
x -
Returns node’s HTML markup.
Parameters:
nodeId -
Returns the id of the nearest ancestor that is a relayout boundary.
Parameters:
nodeId -
Returns search results from given fromIndex
to given toIndex
from the sarch with the given identifier.
Parameters:
searchId -
Hides any highlight.
Parameters:
Highlights DOM node.
Parameters:
Highlights given rectangle.
Parameters:
Marks last undoable state.
Parameters:
Moves node into the new container, places it before the given anchor.
Parameters:
nodeId - targetNodeId
).
Searches for a given string in the DOM tree. Use getSearchResults
to access search results or cancelSearch
to end this search session.
Parameters:
query -
Requests that the node is sent to the caller given its path. // FIXME, use XPath
Parameters:
path -
Requests that a batch of nodes is sent to the caller given their backend node ids.
Parameters:
backendNodeIds -
Executes querySelector
on a given node.
Parameters:
nodeId -
Executes querySelectorAll
on a given node.
Parameters:
nodeId -
Re-does the last undone action.
Parameters:
Removes attribute with given name from an element with given id.
Parameters:
nodeId -
Removes node with given id.
Parameters:
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.
Parameters:
nodeId -
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.
Parameters:
objectId -
Resolves the JavaScript node object for a given NodeId or BackendNodeId.
Parameters:
nodeId -
Sets attribute for an element with given id.
Parameters:
nodeId -
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.
Parameters:
nodeId -
Sets files for the given file input element.
Parameters:
files -
Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).
Parameters:
nodeId -
Sets node name for a node with given id.
Parameters:
nodeId -
Sets node value for a node with given id.
Parameters:
nodeId -
Sets node HTML markup, returns new node id.
Parameters:
nodeId -
Undoes the last performed action.
Parameters: