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

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.

Enables DOM agent for the given page.

Focuses the given element.

Returns attributes for the specified node.

Returns boxes for the given node.

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's HTML markup.

Hides any highlight.

Highlights DOM node.

Highlights given rectangle.

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

Executes querySelector on a given node.

Executes querySelectorAll on a given node.

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.

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.

Link to this section Functions

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

Link to this function

describeNode(page_pid, parameters) View Source

Link to this function

describeNode(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

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 - - Identifier of the node.backendNodeId - - Identifier of the backend node.objectId - - JavaScript object id of the node wrapper.

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

Parameters: nodeId - - Identifier of the node.backendNodeId - - Identifier of the backend node.objectId - - JavaScript object id of the node wrapper.

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

Returns node's HTML markup.

Parameters: nodeId - - Identifier of the node.backendNodeId - - Identifier of the backend node.objectId - - JavaScript object id of the node wrapper.

Link to this function

getOuterHTML(page_pid, parameters) View Source

Link to this function

getOuterHTML(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

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

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

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 the JavaScript node object for a given NodeId or BackendNodeId.

Parameters: 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.executionContextId - - Execution context in which to resolve the node.

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

Link to this function

setFileInputFiles(page_pid, parameters) View Source

Link to this function

setFileInputFiles(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