← Back to Emulation domain

Emulation.updateScreen

Updates specified screen parameters. Only supported in headless mode.

Domain: Emulation experimental

Parameters

NameTypeDescription
screenIdScreenIdTarget screen identifier.
left (optional)integerOffset of the left edge of the screen in pixels.
top (optional)integerOffset of the top edge of the screen in pixels.
width (optional)integerThe width of the screen in pixels.
height (optional)integerThe height of the screen in pixels.
workAreaInsets (optional)WorkAreaInsetsSpecifies the screen's work area.
devicePixelRatio (optional)numberSpecifies the screen's device pixel ratio.
rotation (optional)integerSpecifies the screen's rotation angle. Available values are 0, 90, 180 and 270.
colorDepth (optional)integerSpecifies the screen's color depth in bits.
label (optional)stringSpecifies the descriptive label for the screen.
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.updateScreen",
  "params": {
    "screenId": "screenId-value"
  }
}

Example Response

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

Usage in Node.js

const result = await send('Emulation.updateScreen', {"screenId": "screenId-value"});
console.log(result);
// {"screenInfo": "screenInfo-value"}