← Back to Emulation domain
Emulation.updateScreen
Updates specified screen parameters. Only supported in headless mode.
Domain: Emulation
experimental
Parameters
| Name | Type | Description |
screenId | ScreenId | Target screen identifier. |
left (optional) | integer | Offset of the left edge of the screen in pixels. |
top (optional) | integer | Offset of the top edge of the screen in pixels. |
width (optional) | integer | The width of the screen in pixels. |
height (optional) | integer | The height of the screen in pixels. |
workAreaInsets (optional) | WorkAreaInsets | Specifies the screen's work area. |
devicePixelRatio (optional) | number | Specifies the screen's device pixel ratio. |
rotation (optional) | integer | Specifies the screen's rotation angle. Available values are 0, 90, 180 and 270. |
colorDepth (optional) | integer | Specifies the screen's color depth in bits. |
label (optional) | string | Specifies the descriptive label for the screen. |
isInternal (optional) | boolean | Indicates whether the screen is internal to the device or external, attached to the device. Default is false. |
Returns
| Name | Type | Description |
screenInfo | ScreenInfo | |
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"}