Skip to main content

Module commands

Structs§

AddScreen
Add a new screen to the device. Only supported in headless mode. addScreen
AddScreenParams
Add a new screen to the device. Only supported in headless mode. addScreen
ClearDeviceMetricsOverride
Clears the overridden device metrics. clearDeviceMetricsOverride
ClearDeviceMetricsOverrideParams
Clears the overridden device metrics. clearDeviceMetricsOverride
ClearDevicePostureOverride
Clears a device posture override set with either setDeviceMetricsOverride() or setDevicePostureOverride() and starts using posture information from the platform again. Does nothing if no override is set. clearDevicePostureOverride
ClearDevicePostureOverrideParams
Clears a device posture override set with either setDeviceMetricsOverride() or setDevicePostureOverride() and starts using posture information from the platform again. Does nothing if no override is set. clearDevicePostureOverride
ClearDisplayFeaturesOverride
Clears the display features override set with either setDeviceMetricsOverride() or setDisplayFeaturesOverride() and starts using display features from the platform again. Does nothing if no override is set. clearDisplayFeaturesOverride
ClearDisplayFeaturesOverrideParams
Clears the display features override set with either setDeviceMetricsOverride() or setDisplayFeaturesOverride() and starts using display features from the platform again. Does nothing if no override is set. clearDisplayFeaturesOverride
ClearGeolocationOverride
Clears the overridden Geolocation Position and Error. clearGeolocationOverride
ClearGeolocationOverrideParams
Clears the overridden Geolocation Position and Error. clearGeolocationOverride
ClearIdleOverride
Clears Idle state overrides. clearIdleOverride
ClearIdleOverrideParams
Clears Idle state overrides. clearIdleOverride
GetOverriddenSensorInformation
GetOverriddenSensorInformationParams
GetScreenInfos
Returns device’s screen configuration. In headful mode, the physical screens configuration is returned, whereas in headless mode, a virtual headless screen configuration is provided instead. getScreenInfos
GetScreenInfosParams
Returns device’s screen configuration. In headful mode, the physical screens configuration is returned, whereas in headless mode, a virtual headless screen configuration is provided instead. getScreenInfos
RemoveScreen
Remove screen from the device. Only supported in headless mode. removeScreen
RemoveScreenParams
Remove screen from the device. Only supported in headless mode. removeScreen
ResetPageScaleFactor
Requests that page scale factor is reset to initial values. resetPageScaleFactor
ResetPageScaleFactorParams
Requests that page scale factor is reset to initial values. resetPageScaleFactor
SetAutoDarkModeOverride
Automatically render all web contents using a dark theme. setAutoDarkModeOverride
SetAutoDarkModeOverrideParams
Automatically render all web contents using a dark theme. setAutoDarkModeOverride
SetAutomationOverride
Allows overriding the automation flag. setAutomationOverride
SetAutomationOverrideParams
Allows overriding the automation flag. setAutomationOverride
SetCpuThrottlingRate
Enables CPU throttling to emulate slow CPUs. setCPUThrottlingRate
SetCpuThrottlingRateParams
Enables CPU throttling to emulate slow CPUs. setCPUThrottlingRate
SetDataSaverOverride
Override the value of navigator.connection.saveData setDataSaverOverride
SetDataSaverOverrideParams
Override the value of navigator.connection.saveData setDataSaverOverride
SetDefaultBackgroundColorOverride
Sets or clears an override of the default background color of the frame. This override is used if the content does not specify one. setDefaultBackgroundColorOverride
SetDefaultBackgroundColorOverrideParams
Sets or clears an override of the default background color of the frame. This override is used if the content does not specify one. setDefaultBackgroundColorOverride
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). setDeviceMetricsOverride
SetDeviceMetricsOverrideParams
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). setDeviceMetricsOverride
SetDevicePostureOverride
Start reporting the given posture value to the Device Posture API. This override can also be set in setDeviceMetricsOverride(). setDevicePostureOverride
SetDevicePostureOverrideParams
Start reporting the given posture value to the Device Posture API. This override can also be set in setDeviceMetricsOverride(). setDevicePostureOverride
SetDisabledImageTypes
SetDisabledImageTypesParams
SetDisplayFeaturesOverride
Start using the given display features to pupulate the Viewport Segments API. This override can also be set in setDeviceMetricsOverride(). setDisplayFeaturesOverride
SetDisplayFeaturesOverrideParams
Start using the given display features to pupulate the Viewport Segments API. This override can also be set in setDeviceMetricsOverride(). setDisplayFeaturesOverride
SetDocumentCookieDisabled
SetDocumentCookieDisabledParams
SetEmitTouchEventsForMouse
SetEmitTouchEventsForMouseParams
SetEmulatedMedia
Emulates the given media type or media feature for CSS media queries. setEmulatedMedia
SetEmulatedMediaParams
Emulates the given media type or media feature for CSS media queries. setEmulatedMedia
SetEmulatedOsTextScale
Emulates the given OS text scale. setEmulatedOSTextScale
SetEmulatedOsTextScaleParams
Emulates the given OS text scale. setEmulatedOSTextScale
SetEmulatedVisionDeficiency
Emulates the given vision deficiency. setEmulatedVisionDeficiency
SetEmulatedVisionDeficiencyParams
Emulates the given vision deficiency. setEmulatedVisionDeficiency
SetFocusEmulationEnabled
Enables or disables simulating a focused and active page. setFocusEmulationEnabled
SetFocusEmulationEnabledParams
Enables or disables simulating a focused and active page. setFocusEmulationEnabled
SetGeolocationOverride
Overrides the Geolocation Position or Error. Omitting latitude, longitude or accuracy emulates position unavailable. setGeolocationOverride
SetGeolocationOverrideParams
Overrides the Geolocation Position or Error. Omitting latitude, longitude or accuracy emulates position unavailable. setGeolocationOverride
SetHardwareConcurrencyOverride
SetHardwareConcurrencyOverrideParams
SetIdleOverride
Overrides the Idle state. setIdleOverride
SetIdleOverrideParams
Overrides the Idle state. setIdleOverride
SetLocaleOverride
Overrides default host system locale with the specified one. setLocaleOverride
SetLocaleOverrideParams
Overrides default host system locale with the specified one. setLocaleOverride
SetPageScaleFactor
Sets a specified page scale factor. setPageScaleFactor
SetPageScaleFactorParams
Sets a specified page scale factor. setPageScaleFactor
SetPressureDataOverride
Provides a given pressure data set that will be processed and eventually be delivered to PressureObserver users. |source| must have been previously overridden by setPressureSourceOverrideEnabled. setPressureDataOverride
SetPressureDataOverrideParams
Provides a given pressure data set that will be processed and eventually be delivered to PressureObserver users. |source| must have been previously overridden by setPressureSourceOverrideEnabled. setPressureDataOverride
SetPressureSourceOverrideEnabled
Overrides a pressure source of a given type, as used by the Compute Pressure API, so that updates to PressureObserver.observe() are provided via setPressureStateOverride instead of being retrieved from platform-provided telemetry data. setPressureSourceOverrideEnabled
SetPressureSourceOverrideEnabledParams
Overrides a pressure source of a given type, as used by the Compute Pressure API, so that updates to PressureObserver.observe() are provided via setPressureStateOverride instead of being retrieved from platform-provided telemetry data. setPressureSourceOverrideEnabled
SetPressureStateOverride
TODO: OBSOLETE: To remove when setPressureDataOverride is merged. Provides a given pressure state that will be processed and eventually be delivered to PressureObserver users. |source| must have been previously overridden by setPressureSourceOverrideEnabled. setPressureStateOverride
SetPressureStateOverrideParams
TODO: OBSOLETE: To remove when setPressureDataOverride is merged. Provides a given pressure state that will be processed and eventually be delivered to PressureObserver users. |source| must have been previously overridden by setPressureSourceOverrideEnabled. setPressureStateOverride
SetSafeAreaInsetsOverride
Overrides the values for env(safe-area-inset-) and env(safe-area-max-inset-). Unset values will cause the respective variables to be undefined, even if previously overridden. setSafeAreaInsetsOverride
SetSafeAreaInsetsOverrideParams
Overrides the values for env(safe-area-inset-) and env(safe-area-max-inset-). Unset values will cause the respective variables to be undefined, even if previously overridden. setSafeAreaInsetsOverride
SetScriptExecutionDisabled
Switches script execution in the page. setScriptExecutionDisabled
SetScriptExecutionDisabledParams
Switches script execution in the page. setScriptExecutionDisabled
SetScrollbarsHidden
SetScrollbarsHiddenParams
SetSensorOverrideEnabled
Overrides a platform sensor of a given type. If |enabled| is true, calls to Sensor.start() will use a virtual sensor as backend rather than fetching data from a real hardware sensor. Otherwise, existing virtual sensor-backend Sensor objects will fire an error event and new calls to Sensor.start() will attempt to use a real sensor instead. setSensorOverrideEnabled
SetSensorOverrideEnabledParams
Overrides a platform sensor of a given type. If |enabled| is true, calls to Sensor.start() will use a virtual sensor as backend rather than fetching data from a real hardware sensor. Otherwise, existing virtual sensor-backend Sensor objects will fire an error event and new calls to Sensor.start() will attempt to use a real sensor instead. setSensorOverrideEnabled
SetSensorOverrideReadings
Updates the sensor readings reported by a sensor type previously overridden by setSensorOverrideEnabled. setSensorOverrideReadings
SetSensorOverrideReadingsParams
Updates the sensor readings reported by a sensor type previously overridden by setSensorOverrideEnabled. setSensorOverrideReadings
SetSmallViewportHeightDifferenceOverride
Allows overriding the difference between the small and large viewport sizes, which determine the value of the svh and lvh unit, respectively. Only supported for top-level frames. setSmallViewportHeightDifferenceOverride
SetSmallViewportHeightDifferenceOverrideParams
Allows overriding the difference between the small and large viewport sizes, which determine the value of the svh and lvh unit, respectively. Only supported for top-level frames. setSmallViewportHeightDifferenceOverride
SetTimezoneOverride
Overrides default host system timezone with the specified one. setTimezoneOverride
SetTimezoneOverrideParams
Overrides default host system timezone with the specified one. setTimezoneOverride
SetTouchEmulationEnabled
Enables touch on platforms which do not support them. setTouchEmulationEnabled
SetTouchEmulationEnabledParams
Enables touch on platforms which do not support them. setTouchEmulationEnabled
SetUserAgentOverride
Allows overriding user agent with the given string. userAgentMetadata must be set for Client Hint headers to be sent. setUserAgentOverride
SetUserAgentOverrideParams
Allows overriding user agent with the given string. userAgentMetadata must be set for Client Hint headers to be sent. setUserAgentOverride
SetVirtualTimePolicy
Turns on virtual time for all frames (replacing real-time with a synthetic time source) and sets the current virtual time policy. Note this supersedes any previous time budget. setVirtualTimePolicy
SetVirtualTimePolicyParams
Turns on virtual time for all frames (replacing real-time with a synthetic time source) and sets the current virtual time policy. Note this supersedes any previous time budget. setVirtualTimePolicy

Enums§

AddScreenMethod
ClearDeviceMetricsOverrideMethod
ClearDevicePostureOverrideMethod
ClearDisplayFeaturesOverrideMethod
ClearGeolocationOverrideMethod
ClearIdleOverrideMethod
EmulationCommands
GetOverriddenSensorInformationMethod
GetScreenInfosMethod
RemoveScreenMethod
ResetPageScaleFactorMethod
SetAutoDarkModeOverrideMethod
SetAutomationOverrideMethod
SetCpuThrottlingRateMethod
SetDataSaverOverrideMethod
SetDefaultBackgroundColorOverrideMethod
SetDeviceMetricsOverrideMethod
SetDeviceMetricsOverrideScrollbarType
Scrollbar type. Default: default.
SetDevicePostureOverrideMethod
SetDisabledImageTypesMethod
SetDisplayFeaturesOverrideMethod
SetDocumentCookieDisabledMethod
SetEmitTouchEventsForMouseConfiguration
Touch/gesture events configuration. Default: current platform.
SetEmitTouchEventsForMouseMethod
SetEmulatedMediaMethod
SetEmulatedOsTextScaleMethod
SetEmulatedVisionDeficiencyMethod
SetEmulatedVisionDeficiencyType
Vision deficiency to emulate. Order: best-effort emulations come first, followed by any physiologically accurate emulations for medically recognized color vision deficiencies.
SetFocusEmulationEnabledMethod
SetGeolocationOverrideMethod
SetHardwareConcurrencyOverrideMethod
SetIdleOverrideMethod
SetLocaleOverrideMethod
SetPageScaleFactorMethod
SetPressureDataOverrideMethod
SetPressureSourceOverrideEnabledMethod
SetPressureStateOverrideMethod
SetSafeAreaInsetsOverrideMethod
SetScriptExecutionDisabledMethod
SetScrollbarsHiddenMethod
SetSensorOverrideEnabledMethod
SetSensorOverrideReadingsMethod
SetSmallViewportHeightDifferenceOverrideMethod
SetTimezoneOverrideMethod
SetTouchEmulationEnabledMethod
SetUserAgentOverrideMethod
SetVirtualTimePolicyMethod