← Back to Emulation domain

Emulation.setVisibleSize

Resizes the frame/viewport of the page. Note that this does not affect the frame's container (e.g. browser window). Can be used to produce screenshots of the specified size. Not supported on Android.

Domain: Emulation deprecated

Parameters

NameTypeDescription
widthintegerFrame width (DIP).
heightintegerFrame height (DIP).

Example Request

{
  "id": 1,
  "method": "Emulation.setVisibleSize",
  "params": {
    "width": 1280,
    "height": 720
  }
}

Example Response

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

Usage in Node.js

const result = await send('Emulation.setVisibleSize', {"width": 1280, "height": 720});
console.log(result);