← Back to Target domain

Target.openDevTools

Opens a DevTools window for the target.

Domain: Target experimental

Parameters

NameTypeDescription
targetIdTargetIDThis can be the page or tab target ID.
panelId (optional)stringThe id of the panel we want DevTools to open initially. Currently supported panels are elements, console, network, sources, resources, timeline, chrome-recorder, heap-profiler, lighthouse, and security.

Returns

NameTypeDescription
targetIdTargetIDThe targetId of DevTools page target.

Example Request

{
  "id": 1,
  "method": "Target.openDevTools",
  "params": {
    "targetId": "TARGET_ID_HERE"
  }
}

Example Response

{
  "id": 1,
  "result": {
    "targetId": "TARGET_NEW_001"
  }
}

Usage in Node.js

const result = await send('Target.openDevTools', {"targetId": "TARGET_ID_HERE"});
console.log(result);
// {"targetId": "TARGET_NEW_001"}