← Back to Browser domain

Browser.setContentsSize

Set size of the browser contents resizing browser window as necessary.

Domain: Browser experimental

Parameters

NameTypeDescription
windowIdWindowIDBrowser window id.
width (optional)integerThe window contents width in DIP. Assumes current width if omitted. Must be specified if 'height' is omitted.
height (optional)integerThe window contents height in DIP. Assumes current height if omitted. Must be specified if 'width' is omitted.

Example Request

{
  "id": 1,
  "method": "Browser.setContentsSize",
  "params": {
    "windowId": "windowId-value"
  }
}

Example Response

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

Usage in Node.js

const result = await send('Browser.setContentsSize', {"windowId": "windowId-value"});
console.log(result);