Skip to main content

Module emulation

Module emulation 

Source
Expand description

This domain emulates different environments for the page.

Structs§

AddScreenParams
Add a new screen to the device. Only supported in headless mode.
AddScreenParamsBuilder
AddScreenReturns
Add a new screen to the device. Only supported in headless mode.
AddScreenReturnsBuilder
CanEmulateParams
CanEmulateReturns
Tells whether emulation is supported.
CanEmulateReturnsBuilder
ClearDeviceMetricsOverrideParams
ClearDevicePostureOverrideParams
ClearDisplayFeaturesOverrideParams
ClearGeolocationOverrideParams
ClearIdleOverrideParams
DevicePosture
DevicePostureBuilder
DisplayFeature
DisplayFeatureBuilder
GetOverriddenSensorInformationParams
GetOverriddenSensorInformationParamsBuilder
GetOverriddenSensorInformationReturns
GetOverriddenSensorInformationReturnsBuilder
GetScreenInfosParams
GetScreenInfosReturns
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.
GetScreenInfosReturnsBuilder
MediaFeature
MediaFeatureBuilder
PressureMetadata
PressureMetadataBuilder
RemoveScreenParams
Remove screen from the device. Only supported in headless mode.
RemoveScreenParamsBuilder
ResetPageScaleFactorParams
SafeAreaInsets
SafeAreaInsetsBuilder
ScreenInfo
Screen information similar to the one returned by window.getScreenDetails() method, see https://w3c.github.io/window-management/#screendetailed.
ScreenInfoBuilder
ScreenOrientation
Screen orientation.
ScreenOrientationBuilder
SensorMetadata
SensorMetadataBuilder
SensorReading
SensorReadingBuilder
SensorReadingQuaternion
SensorReadingQuaternionBuilder
SensorReadingSingle
SensorReadingSingleBuilder
SensorReadingXYZ
SensorReadingXYZBuilder
SetAutoDarkModeOverrideParams
Automatically render all web contents using a dark theme.
SetAutoDarkModeOverrideParamsBuilder
SetAutomationOverrideParams
Allows overriding the automation flag.
SetAutomationOverrideParamsBuilder
SetCPUThrottlingRateParams
Enables CPU throttling to emulate slow CPUs.
SetCPUThrottlingRateParamsBuilder
SetDataSaverOverrideParams
Override the value of navigator.connection.saveData
SetDataSaverOverrideParamsBuilder
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.
SetDefaultBackgroundColorOverrideParamsBuilder
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).
SetDeviceMetricsOverrideParamsBuilder
SetDevicePostureOverrideParams
Start reporting the given posture value to the Device Posture API. This override can also be set in setDeviceMetricsOverride().
SetDevicePostureOverrideParamsBuilder
SetDisabledImageTypesParams
SetDisabledImageTypesParamsBuilder
SetDisplayFeaturesOverrideParams
Start using the given display features to pupulate the Viewport Segments API. This override can also be set in setDeviceMetricsOverride().
SetDisplayFeaturesOverrideParamsBuilder
SetDocumentCookieDisabledParams
SetDocumentCookieDisabledParamsBuilder
SetEmitTouchEventsForMouseParams
SetEmitTouchEventsForMouseParamsBuilder
SetEmulatedMediaParams
Emulates the given media type or media feature for CSS media queries.
SetEmulatedMediaParamsBuilder
SetEmulatedOSTextScaleParams
Emulates the given OS text scale.
SetEmulatedOSTextScaleParamsBuilder
SetEmulatedVisionDeficiencyParams
Emulates the given vision deficiency.
SetEmulatedVisionDeficiencyParamsBuilder
SetFocusEmulationEnabledParams
Enables or disables simulating a focused and active page.
SetFocusEmulationEnabledParamsBuilder
SetGeolocationOverrideParams
Overrides the Geolocation Position or Error. Omitting latitude, longitude or accuracy emulates position unavailable.
SetGeolocationOverrideParamsBuilder
SetHardwareConcurrencyOverrideParams
SetHardwareConcurrencyOverrideParamsBuilder
SetIdleOverrideParams
Overrides the Idle state.
SetIdleOverrideParamsBuilder
SetLocaleOverrideParams
Overrides default host system locale with the specified one.
SetLocaleOverrideParamsBuilder
SetNavigatorOverridesParams
Overrides value returned by the javascript navigator object.
SetNavigatorOverridesParamsBuilder
SetPageScaleFactorParams
Sets a specified page scale factor.
SetPageScaleFactorParamsBuilder
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.
SetPressureDataOverrideParamsBuilder
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.
SetPressureSourceOverrideEnabledParamsBuilder
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.
SetPressureStateOverrideParamsBuilder
SetPrimaryScreenParams
Set primary screen. Only supported in headless mode. Note that this changes the coordinate system origin to the top-left of the new primary screen, updating the bounds and work areas of all existing screens accordingly.
SetPrimaryScreenParamsBuilder
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.
SetSafeAreaInsetsOverrideParamsBuilder
SetScriptExecutionDisabledParams
Switches script execution in the page.
SetScriptExecutionDisabledParamsBuilder
SetScrollbarsHiddenParams
SetScrollbarsHiddenParamsBuilder
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.
SetSensorOverrideEnabledParamsBuilder
SetSensorOverrideReadingsParams
Updates the sensor readings reported by a sensor type previously overridden by setSensorOverrideEnabled.
SetSensorOverrideReadingsParamsBuilder
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.
SetSmallViewportHeightDifferenceOverrideParamsBuilder
SetTimezoneOverrideParams
Overrides default host system timezone with the specified one.
SetTimezoneOverrideParamsBuilder
SetTouchEmulationEnabledParams
Enables touch on platforms which do not support them.
SetTouchEmulationEnabledParamsBuilder
SetUserAgentOverrideParams
Allows overriding user agent with the given string. ‘userAgentMetadata’ must be set for Client Hint headers to be sent.
SetUserAgentOverrideParamsBuilder
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.
SetVirtualTimePolicyParamsBuilder
SetVirtualTimePolicyReturns
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.
SetVirtualTimePolicyReturnsBuilder
SetVisibleSizeParams
Resizes the frame/viewport of the page. Note that this does not affect the frame’s container (e.g. browser window). Can be used to produce screenshots of the specified size. Not supported on Android.
SetVisibleSizeParamsBuilder
UpdateScreenParams
Updates specified screen parameters. Only supported in headless mode.
UpdateScreenParamsBuilder
UpdateScreenReturns
Updates specified screen parameters. Only supported in headless mode.
UpdateScreenReturnsBuilder
UserAgentBrandVersion
Used to specify User Agent Client Hints to emulate. See https://wicg.github.io/ua-client-hints
UserAgentBrandVersionBuilder
UserAgentMetadata
Used to specify User Agent Client Hints to emulate. See https://wicg.github.io/ua-client-hints Missing optional values will be filled in by the target with what it would normally use.
UserAgentMetadataBuilder
WorkAreaInsets
WorkAreaInsetsBuilder

Enums§

DisabledImageType
Enum of image types that can be disabled.
PressureSource
PressureState
SensorType
Used to specify sensor types to emulate. See https://w3c.github.io/sensors/#automation for more information.
VirtualTimePolicy
advance: If the scheduler runs out of immediate work, the virtual time base may fast forward to allow the next delayed task (if any) to run; pause: The virtual time base may not advance; pauseIfNetworkFetchesPending: The virtual time base may not advance if there are any pending resource fetches.

Type Aliases§

ScreenId