← Back to DOM domain

DOM.requestNode

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.

Domain: DOM stable

Parameters

NameTypeDescription
objectIdRuntime.RemoteObjectIdJavaScript object id to convert into node.

Returns

NameTypeDescription
nodeIdNodeIdNode id for given object.

Example Request

{
  "id": 1,
  "method": "DOM.requestNode",
  "params": {
    "objectId": "{\"injectedScriptId\":1,\"id\":1}"
  }
}

Example Response

{
  "id": 1,
  "result": {
    "nodeId": 3
  }
}

Usage in Node.js

const result = await send('DOM.requestNode', {"objectId": "{\"injectedScriptId\":1,\"id\":1}"});
console.log(result);
// {"nodeId": 3}