pub struct SetDeviceMetricsOverrideParams {Show 18 fields
pub width: i64,
pub height: i64,
pub device_scale_factor: f64,
pub mobile: bool,
pub scale: Option<f64>,
pub screen_width: Option<i64>,
pub screen_height: Option<i64>,
pub position_x: Option<i64>,
pub position_y: Option<i64>,
pub dont_set_visible_size: Option<bool>,
pub screen_orientation: Option<ScreenOrientation>,
pub viewport: Option<Viewport>,
pub display_feature: Option<DisplayFeature>,
pub device_posture: Option<DevicePosture>,
pub scrollbar_type: Option<SetDeviceMetricsOverrideScrollbarType>,
pub screen_orientation_lock_emulation: Option<bool>,
pub viewport_meta: Option<SetDeviceMetricsOverrideViewportMeta>,
pub text_layout_mode: Option<SetDeviceMetricsOverrideTextLayoutMode>,
}Expand 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 of Emulation.setDeviceMetricsOverride.
Fields§
§width: i64Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.
height: i64Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.
device_scale_factor: f64Overriding device scale factor value. 0 disables the override.
mobile: boolWhether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more.
scale: Option<f64>Scale to apply to resulting view image.
Experimental: may change without notice.
screen_width: Option<i64>Overriding screen width value in pixels (minimum 0, maximum 10000000).
Experimental: may change without notice.
screen_height: Option<i64>Overriding screen height value in pixels (minimum 0, maximum 10000000).
Experimental: may change without notice.
position_x: Option<i64>Overriding view X position on screen in pixels (minimum 0, maximum 10000000).
Experimental: may change without notice.
position_y: Option<i64>Overriding view Y position on screen in pixels (minimum 0, maximum 10000000).
Experimental: may change without notice.
dont_set_visible_size: Option<bool>Do not set visible view size, rely upon explicit setVisibleSize call.
Experimental: may change without notice.
screen_orientation: Option<ScreenOrientation>Screen orientation override.
viewport: Option<Viewport>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.
Experimental: may change without notice.
display_feature: Option<DisplayFeature>If set, the display feature of a multi-segment screen. If not set, multi-segment support is turned-off. Deprecated, use Emulation.setDisplayFeaturesOverride.
Deprecated in the protocol.
Experimental: may change without notice.
device_posture: Option<DevicePosture>If set, the posture of a foldable device. If not set the posture is set to continuous. Deprecated, use Emulation.setDevicePostureOverride.
Deprecated in the protocol.
Experimental: may change without notice.
scrollbar_type: Option<SetDeviceMetricsOverrideScrollbarType>Scrollbar type. Default: default.
Experimental: may change without notice.
screen_orientation_lock_emulation: Option<bool>If set to true, enables screen orientation lock emulation, which intercepts screen.orientation.lock() calls from the page and reports orientation changes via screenOrientationLockChanged events. This is useful for emulating mobile device orientation lock behavior in responsive design mode.
Experimental: may change without notice.
viewport_meta: Option<SetDeviceMetricsOverrideViewportMeta>Viewport meta tag behavior. Default: default. Note: if mobile is
true, the viewport meta tag is always enabled.
Experimental: may change without notice.
text_layout_mode: Option<SetDeviceMetricsOverrideTextLayoutMode>Text layout mode. Default: default. Note: if mobile is true, mobile
text layout mode (text autosizing) is always enabled.
Experimental: may change without notice.