Emulation.setDeviceMetricsOverride

Overrides the values of device screen dimensions (window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media query results).

{
  "name": "setDeviceMetricsOverride",
  "description": "Overrides the values of device screen dimensions (window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, and \"device-width\"/\"device-height\"-related CSS media query results).",
  "parameters": [
    {
      "name": "width",
      "type": "integer",
      "description": "Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override."
    },
    {
      "name": "height",
      "type": "integer",
      "description": "Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override."
    },
    {
      "name": "deviceScaleFactor",
      "type": "number",
      "description": "Overriding device scale factor value. 0 disables the override."
    },
    {
      "name": "mobile",
      "type": "boolean",
      "description": "Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more."
    },
    {
      "name": "fitWindow",
      "type": "boolean",
      "description": "Whether a view that exceeds the available browser window area should be scaled down to fit."
    },
    {
      "name": "scale",
      "type": "number",
      "optional": true,
      "experimental": true,
      "description": "Scale to apply to resulting view image. Ignored in |fitWindow| mode."
    },
    {
      "name": "offsetX",
      "type": "number",
      "optional": true,
      "deprecated": true,
      "experimental": true,
      "description": "Not used."
    },
    {
      "name": "offsetY",
      "type": "number",
      "optional": true,
      "deprecated": true,
      "experimental": true,
      "description": "Not used."
    },
    {
      "name": "screenWidth",
      "type": "integer",
      "optional": true,
      "experimental": true,
      "description": "Overriding screen width value in pixels (minimum 0, maximum 10000000). Only used for |mobile==true|."
    },
    {
      "name": "screenHeight",
      "type": "integer",
      "optional": true,
      "experimental": true,
      "description": "Overriding screen height value in pixels (minimum 0, maximum 10000000). Only used for |mobile==true|."
    },
    {
      "name": "positionX",
      "type": "integer",
      "optional": true,
      "experimental": true,
      "description": "Overriding view X position on screen in pixels (minimum 0, maximum 10000000). Only used for |mobile==true|."
    },
    {
      "name": "positionY",
      "type": "integer",
      "optional": true,
      "experimental": true,
      "description": "Overriding view Y position on screen in pixels (minimum 0, maximum 10000000). Only used for |mobile==true|."
    },
    {
      "name": "screenOrientation",
      "$ref": "ScreenOrientation",
      "optional": true,
      "description": "Screen orientation override."
    }
  ],
  "handlers": [
    "browser"
  ]
}