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": "scale",
      "type": "number",
      "optional": true,
      "description": "Scale to apply to resulting view image.",
      "experimental": true
    },
    {
      "name": "screenWidth",
      "type": "integer",
      "optional": true,
      "experimental": true,
      "description": "Overriding screen width value in pixels (minimum 0, maximum 10000000)."
    },
    {
      "name": "screenHeight",
      "type": "integer",
      "optional": true,
      "experimental": true,
      "description": "Overriding screen height value in pixels (minimum 0, maximum 10000000)."
    },
    {
      "name": "positionX",
      "type": "integer",
      "optional": true,
      "experimental": true,
      "description": "Overriding view X position on screen in pixels (minimum 0, maximum 10000000)."
    },
    {
      "name": "positionY",
      "type": "integer",
      "optional": true,
      "experimental": true,
      "description": "Overriding view Y position on screen in pixels (minimum 0, maximum 10000000)."
    },
    {
      "name": "dontSetVisibleSize",
      "type": "boolean",
      "optional": true,
      "experimental": true,
      "description": "Do not set visible view size, rely upon explicit setVisibleSize call."
    },
    {
      "name": "screenOrientation",
      "$ref": "ScreenOrientation",
      "optional": true,
      "description": "Screen orientation override."
    },
    {
      "name": "viewport",
      "$ref": "Page.Viewport",
      "optional": true,
      "experimental": true,
      "description": "If set, the visible area of the page will be overridden to this viewport. This viewport change is not observed by the page, e.g. viewport-relative elements do not change positions."
    }
  ]
}