← Back to Emulation domain

Emulation.addScreen

Add a new screen to the device. Only supported in headless mode.

Domain: Emulation experimental

Parameters

NameTypeDescription
leftintegerOffset of the left edge of the screen in pixels.
topintegerOffset of the top edge of the screen in pixels.
widthintegerThe width of the screen in pixels.
heightintegerThe height of the screen in pixels.
workAreaInsets (optional)WorkAreaInsetsSpecifies the screen's work area. Default is entire screen.
devicePixelRatio (optional)numberSpecifies the screen's device pixel ratio. Default is 1.
rotation (optional)integerSpecifies the screen's rotation angle. Available values are 0, 90, 180 and 270. Default is 0.
colorDepth (optional)integerSpecifies the screen's color depth in bits. Default is 24.
label (optional)stringSpecifies the descriptive label for the screen. Default is none.
isInternal (optional)booleanIndicates whether the screen is internal to the device or external, attached to the device. Default is false.

Returns

NameTypeDescription
screenInfoScreenInfo

Example Request

{
  "id": 1,
  "method": "Emulation.addScreen",
  "params": {
    "left": 1,
    "top": 1,
    "width": 1280,
    "height": 720
  }
}

Example Response

{
  "id": 1,
  "result": {
    "screenInfo": "screenInfo-value"
  }
}

Usage in Node.js

const result = await send('Emulation.addScreen', {"left": 1, "top": 1, "width": 1280, "height": 720});
console.log(result);
// {"screenInfo": "screenInfo-value"}