Emulation Domain
This domain emulates different environments for the page.
Methods
- Emulation.clearDeviceMetricsOverride
- Emulation.setDeviceMetricsOverride
- Emulation.setEmulatedMedia
- Emulation.setTouchEmulationEnabled
Types
Methods
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).
Parameters
width
integer
Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.
height
integer
Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.
deviceScaleFactor
number
Overriding device scale factor value. 0 disables the override.
mobile
boolean
Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more.
fitWindow
boolean
Whether a view that exceeds the available browser window area should be scaled down to fit.
scale
Optional
number
Scale to apply to resulting view image. Ignored in |fitWindow| mode.
offsetX
Optional
number
Not used.
offsetY
Optional
number
Not used.
screenWidth
Optional
integer
Overriding screen width value in pixels (minimum 0, maximum 10000000). Only used for |mobile==true|.
screenHeight
Optional
integer
Overriding screen height value in pixels (minimum 0, maximum 10000000). Only used for |mobile==true|.
positionX
Optional
integer
Overriding view X position on screen in pixels (minimum 0, maximum 10000000). Only used for |mobile==true|.
positionY
Optional
integer
Overriding view Y position on screen in pixels (minimum 0, maximum 10000000). Only used for |mobile==true|.
screenOrientation
Optional
Screen orientation override.
Emulation.setEmulatedMedia #
Emulates the given media for CSS media queries.
Parameters
media
string
Media type to emulate. Empty string disables the override.
Emulation.setTouchEmulationEnabled #
Toggles mouse event-based touch event emulation.
Parameters
enabled
boolean
Whether the touch event emulation should be enabled.
configuration
Optional
string
Touch/gesture events configuration. Default: current platform.
Allowed values: mobile
, desktop
Types
Emulation.ScreenOrientation #
Screen orientation.
Type: object
Properties
type
string
Orientation type.
Allowed values: portraitPrimary
, portraitSecondary
, landscapePrimary
, landscapeSecondary
angle
integer
Orientation angle.