Chrome Remote Interface v0.0.5 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

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 JavaScript node object for given node id

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

Link to this function collectClassNamesFromSubtree(page_pid) View Source

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

Parameters: nodeId - - Id of the node to collect class names.

Link to this function collectClassNamesFromSubtree(page_pid, parameters) View Source
Link to this function collectClassNamesFromSubtree(page_pid, parameters, opts) View Source

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

Parameters: 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).

Link to this function copyTo(page_pid, parameters) View Source
Link to this function copyTo(page_pid, parameters, opts) View Source

Disables DOM agent for the given page.

Parameters:

Link to this function disable(page_pid, parameters) View Source
Link to this function disable(page_pid, parameters, opts) View Source
Link to this function discardSearchResults(page_pid) View Source

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

Parameters: searchId - - Unique search session identifier.

Link to this function discardSearchResults(page_pid, parameters) View Source
Link to this function discardSearchResults(page_pid, parameters, opts) View Source

Enables DOM agent for the given page.

Parameters:

Link to this function enable(page_pid, parameters) View Source
Link to this function enable(page_pid, parameters, opts) View Source

Focuses the given element.

Parameters: nodeId - - Id of the node to focus.

Link to this function focus(page_pid, parameters) View Source
Link to this function focus(page_pid, parameters, opts) View Source

Returns attributes for the specified node.

Parameters: nodeId - - Id of the node to retrieve attibutes for.

Link to this function getAttributes(page_pid, parameters) View Source
Link to this function getAttributes(page_pid, parameters, opts) View Source

Returns boxes for the currently selected nodes.

Parameters: nodeId - - Id of the node to get box model for.

Link to this function getBoxModel(page_pid, parameters) View Source
Link to this function getBoxModel(page_pid, parameters, opts) View Source

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

Parameters: 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).

Link to this function getDocument(page_pid, parameters) View Source
Link to this function getDocument(page_pid, parameters, opts) View Source
Link to this function getFlattenedDocument(page_pid) View Source

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

Parameters: 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).

Link to this function getFlattenedDocument(page_pid, parameters) View Source
Link to this function getFlattenedDocument(page_pid, parameters, opts) View Source
Link to this function getNodeForLocation(page_pid) View Source

Returns node id at given location.

Parameters: x - - X coordinate.y - - Y coordinate.includeUserAgentShadowDOM - - False to skip to the nearest non-UA shadow root ancestor (default: false).

Link to this function getNodeForLocation(page_pid, parameters) View Source
Link to this function getNodeForLocation(page_pid, parameters, opts) View Source

Returns node’s HTML markup.

Parameters: nodeId - - Id of the node to get markup for.

Link to this function getOuterHTML(page_pid, parameters) View Source
Link to this function getOuterHTML(page_pid, parameters, opts) View Source
Link to this function getRelayoutBoundary(page_pid) View Source

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

Parameters: nodeId - - Id of the node.

Link to this function getRelayoutBoundary(page_pid, parameters) View Source
Link to this function getRelayoutBoundary(page_pid, parameters, opts) View Source
Link to this function getSearchResults(page_pid) View Source

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

Parameters: 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.

Link to this function getSearchResults(page_pid, parameters) View Source
Link to this function getSearchResults(page_pid, parameters, opts) View Source

Hides any highlight.

Parameters:

Link to this function hideHighlight(page_pid, parameters) View Source
Link to this function hideHighlight(page_pid, parameters, opts) View Source

Highlights DOM node.

Parameters:

Link to this function highlightNode(page_pid, parameters) View Source
Link to this function highlightNode(page_pid, parameters, opts) View Source

Highlights given rectangle.

Parameters:

Link to this function highlightRect(page_pid, parameters) View Source
Link to this function highlightRect(page_pid, parameters, opts) View Source
Link to this function markUndoableState(page_pid) View Source

Marks last undoable state.

Parameters:

Link to this function markUndoableState(page_pid, parameters) View Source
Link to this function markUndoableState(page_pid, parameters, opts) View Source

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

Parameters: 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).

Link to this function moveTo(page_pid, parameters) View Source
Link to this function moveTo(page_pid, parameters, opts) View Source

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

Parameters: query - - Plain text or query selector or XPath search query.includeUserAgentShadowDOM - - True to search in user agent shadow DOM.

Link to this function performSearch(page_pid, parameters) View Source
Link to this function performSearch(page_pid, parameters, opts) View Source
Link to this function pushNodeByPathToFrontend(page_pid) View Source

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

Parameters: path - - Path to node in the proprietary format.

Link to this function pushNodeByPathToFrontend(page_pid, parameters) View Source
Link to this function pushNodeByPathToFrontend(page_pid, parameters, opts) View Source
Link to this function pushNodesByBackendIdsToFrontend(page_pid) View Source

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

Parameters: backendNodeIds - - The array of backend node ids.

Link to this function pushNodesByBackendIdsToFrontend(page_pid, parameters) View Source
Link to this function pushNodesByBackendIdsToFrontend(page_pid, parameters, opts) View Source

Executes querySelector on a given node.

Parameters: nodeId - - Id of the node to query upon.selector - - Selector string.

Link to this function querySelector(page_pid, parameters) View Source
Link to this function querySelector(page_pid, parameters, opts) View Source
Link to this function querySelectorAll(page_pid) View Source

Executes querySelectorAll on a given node.

Parameters: nodeId - - Id of the node to query upon.selector - - Selector string.

Link to this function querySelectorAll(page_pid, parameters) View Source
Link to this function querySelectorAll(page_pid, parameters, opts) View Source

Re-does the last undone action.

Parameters:

Link to this function redo(page_pid, parameters) View Source
Link to this function redo(page_pid, parameters, opts) View Source
Link to this function removeAttribute(page_pid) View Source

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

Parameters: nodeId - - Id of the element to remove attribute from.name - - Name of the attribute to remove.

Link to this function removeAttribute(page_pid, parameters) View Source
Link to this function removeAttribute(page_pid, parameters, opts) View Source

Removes node with given id.

Parameters: nodeId - - Id of the node to remove.

Link to this function removeNode(page_pid, parameters) View Source
Link to this function removeNode(page_pid, parameters, opts) View Source
Link to this function requestChildNodes(page_pid) View Source

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 - - 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).

Link to this function requestChildNodes(page_pid, parameters) View Source
Link to this function requestChildNodes(page_pid, parameters, opts) View Source

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 - - JavaScript object id to convert into node.

Link to this function requestNode(page_pid, parameters) View Source
Link to this function requestNode(page_pid, parameters, opts) View Source

Resolves JavaScript node object for given node id.

Parameters: nodeId - - Id of the node to resolve.objectGroup - - Symbolic group name that can be used to release multiple objects.

Link to this function resolveNode(page_pid, parameters) View Source
Link to this function resolveNode(page_pid, parameters, opts) View Source
Link to this function setAttributeValue(page_pid) View Source

Sets attribute for an element with given id.

Parameters: nodeId - - Id of the element to set attribute for.name - - Attribute name.value - - Attribute value.

Link to this function setAttributeValue(page_pid, parameters) View Source
Link to this function setAttributeValue(page_pid, parameters, opts) View Source
Link to this function setAttributesAsText(page_pid) View Source

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 - - 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.

Link to this function setAttributesAsText(page_pid, parameters) View Source
Link to this function setAttributesAsText(page_pid, parameters, opts) View Source
Link to this function setFileInputFiles(page_pid) View Source

Sets files for the given file input element.

Parameters: nodeId - - Id of the file input node to set files for.files - - Array of file paths to set.

Link to this function setFileInputFiles(page_pid, parameters) View Source
Link to this function setFileInputFiles(page_pid, parameters, opts) View Source
Link to this function setInspectedNode(page_pid) View Source

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

Parameters: nodeId - - DOM node id to be accessible by means of $x command line API.

Link to this function setInspectedNode(page_pid, parameters) View Source
Link to this function setInspectedNode(page_pid, parameters, opts) View Source

Sets node name for a node with given id.

Parameters: nodeId - - Id of the node to set name for.name - - New node’s name.

Link to this function setNodeName(page_pid, parameters) View Source
Link to this function setNodeName(page_pid, parameters, opts) View Source

Sets node value for a node with given id.

Parameters: nodeId - - Id of the node to set value for.value - - New node’s value.

Link to this function setNodeValue(page_pid, parameters) View Source
Link to this function setNodeValue(page_pid, parameters, opts) View Source

Sets node HTML markup, returns new node id.

Parameters: nodeId - - Id of the node to set markup for.outerHTML - - Outer HTML markup to set.

Link to this function setOuterHTML(page_pid, parameters) View Source
Link to this function setOuterHTML(page_pid, parameters, opts) View Source

Undoes the last performed action.

Parameters:

Link to this function undo(page_pid, parameters) View Source
Link to this function undo(page_pid, parameters, opts) View Source