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 integerOverriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.
height integerOverriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.
deviceScaleFactor numberOverriding device scale factor value. 0 disables the override.
mobile booleanWhether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more.
fitWindow booleanWhether a view that exceeds the available browser window area should be scaled down to fit.
scaleOptional
numberScale to apply to resulting view image. Ignored in |fitWindow| mode.
offsetXOptional
numberNot used.
offsetYOptional
numberNot used.
screenWidthOptional
integerOverriding screen width value in pixels (minimum 0, maximum 10000000). Only used for |mobile==true|.
screenHeightOptional
integerOverriding screen height value in pixels (minimum 0, maximum 10000000). Only used for |mobile==true|.
positionXOptional
integerOverriding view X position on screen in pixels (minimum 0, maximum 10000000). Only used for |mobile==true|.
positionYOptional
integerOverriding view Y position on screen in pixels (minimum 0, maximum 10000000). Only used for |mobile==true|.
screenOrientationOptional
Screen orientation override.
Emulation.setEmulatedMedia #
Emulates the given media for CSS media queries.
Parameters
media stringMedia type to emulate. Empty string disables the override.
Emulation.setTouchEmulationEnabled #
Toggles mouse event-based touch event emulation.
Parameters
enabled booleanWhether the touch event emulation should be enabled.
configurationOptional
stringTouch/gesture events configuration. Default: current platform.
Allowed values: mobile, desktop
Types
Emulation.ScreenOrientation #
Screen orientation.
Type: object
Properties
type stringOrientation type.
Allowed values: portraitPrimary, portraitSecondary, landscapePrimary, landscapeSecondary
angle integerOrientation angle.