setDeviceMetricsOverride

Deprecated

Deprecated in the Chrome DevTools protocol

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).

Official doc

Note: this function uses an input class, and constructing this class manually may lead to incompatibilities if the class's constructor arguments change in the future. For maximum compatibility, it is advised to use the overload of this function that directly takes the mandatory parameters as arguments, and the optional ones from a configuration lambda.


inline suspend fun setDeviceMetricsOverride(width: Int, height: Int, deviceScaleFactor: Double, mobile: Boolean, optionalArgs: SetDeviceMetricsOverrideRequest.Builder.() -> Unit = {}): SetDeviceMetricsOverrideResponse(source)

Deprecated

Deprecated in the Chrome DevTools protocol

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).

Official doc

Parameters

width

Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.

height

Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.

deviceScaleFactor

Overriding device scale factor value. 0 disables the override.

mobile

Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more.