← Back to Browser domain
Browser.getWindowForTarget
Get the browser window that contains the devtools target.
Domain: Browser
experimental
Parameters
| Name | Type | Description |
targetId (optional) | Target.TargetID | Devtools agent host id. If called as a part of the session, associated targetId is used. |
Returns
| Name | Type | Description |
windowId | WindowID | Browser window id. |
bounds | Bounds | Bounds information of the window. When window state is 'minimized', the restored window
position and size are returned. |
Example Request
{
"id": 1,
"method": "Browser.getWindowForTarget"
}
Example Response
{
"id": 1,
"result": {
"windowId": "windowId-value",
"bounds": "bounds-value"
}
}
Usage in Node.js
const result = await send('Browser.getWindowForTarget');
console.log(result);
// {"windowId": "windowId-value", "bounds": "bounds-value"}