Table of Contents

Class EmulationAdapter

Namespace
OpenQA.Selenium.DevTools.V148.Emulation
Assembly
Selenium.WebDriver.dll

Represents an adapter for the Emulation domain to simplify the command interface.

public class EmulationAdapter
Inheritance
EmulationAdapter
Inherited Members

Constructors

EmulationAdapter(IDevToolsSession)

Initializes a new instance of the EmulationAdapter class.

public EmulationAdapter(IDevToolsSession session)

Parameters

session IDevToolsSession

The IDevToolsSession to be used with this adapter.

Exceptions

ArgumentNullException

If session is null.

Properties

Session

Gets the DevToolsSession associated with the adapter.

public IDevToolsSession Session { get; }

Property Value

IDevToolsSession

Methods

AddScreen(AddScreenCommandSettings, CancellationToken, int?, bool)

Add a new screen to the device. Only supported in headless mode.

public Task<AddScreenCommandResponse> AddScreen(AddScreenCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command AddScreenCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<AddScreenCommandResponse>

CanEmulate(CanEmulateCommandSettings?, CancellationToken, int?, bool)

Tells whether emulation is supported.

public Task<CanEmulateCommandResponse> CanEmulate(CanEmulateCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command CanEmulateCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<CanEmulateCommandResponse>

ClearDeviceMetricsOverride(ClearDeviceMetricsOverrideCommandSettings?, CancellationToken, int?, bool)

Clears the overridden device metrics.

public Task<ClearDeviceMetricsOverrideCommandResponse?> ClearDeviceMetricsOverride(ClearDeviceMetricsOverrideCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command ClearDeviceMetricsOverrideCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<ClearDeviceMetricsOverrideCommandResponse>

ClearDevicePostureOverride(ClearDevicePostureOverrideCommandSettings?, CancellationToken, int?, bool)

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.

public Task<ClearDevicePostureOverrideCommandResponse?> ClearDevicePostureOverride(ClearDevicePostureOverrideCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command ClearDevicePostureOverrideCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<ClearDevicePostureOverrideCommandResponse>

ClearDisplayFeaturesOverride(ClearDisplayFeaturesOverrideCommandSettings?, CancellationToken, int?, bool)

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.

public Task<ClearDisplayFeaturesOverrideCommandResponse?> ClearDisplayFeaturesOverride(ClearDisplayFeaturesOverrideCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command ClearDisplayFeaturesOverrideCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<ClearDisplayFeaturesOverrideCommandResponse>

ClearGeolocationOverride(ClearGeolocationOverrideCommandSettings?, CancellationToken, int?, bool)

Clears the overridden Geolocation Position and Error.

public Task<ClearGeolocationOverrideCommandResponse?> ClearGeolocationOverride(ClearGeolocationOverrideCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command ClearGeolocationOverrideCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<ClearGeolocationOverrideCommandResponse>

ClearIdleOverride(ClearIdleOverrideCommandSettings?, CancellationToken, int?, bool)

Clears Idle state overrides.

public Task<ClearIdleOverrideCommandResponse?> ClearIdleOverride(ClearIdleOverrideCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command ClearIdleOverrideCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<ClearIdleOverrideCommandResponse>

GetOverriddenSensorInformation(GetOverriddenSensorInformationCommandSettings, CancellationToken, int?, bool)

getOverriddenSensorInformation

public Task<GetOverriddenSensorInformationCommandResponse> GetOverriddenSensorInformation(GetOverriddenSensorInformationCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetOverriddenSensorInformationCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetOverriddenSensorInformationCommandResponse>

GetScreenInfos(GetScreenInfosCommandSettings?, CancellationToken, int?, bool)

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.

public Task<GetScreenInfosCommandResponse> GetScreenInfos(GetScreenInfosCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetScreenInfosCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetScreenInfosCommandResponse>

RemoveScreen(RemoveScreenCommandSettings, CancellationToken, int?, bool)

Remove screen from the device. Only supported in headless mode.

public Task<RemoveScreenCommandResponse?> RemoveScreen(RemoveScreenCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command RemoveScreenCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<RemoveScreenCommandResponse>

ResetPageScaleFactor(ResetPageScaleFactorCommandSettings?, CancellationToken, int?, bool)

Requests that page scale factor is reset to initial values.

public Task<ResetPageScaleFactorCommandResponse?> ResetPageScaleFactor(ResetPageScaleFactorCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command ResetPageScaleFactorCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<ResetPageScaleFactorCommandResponse>

SetAutoDarkModeOverride(SetAutoDarkModeOverrideCommandSettings, CancellationToken, int?, bool)

Automatically render all web contents using a dark theme.

public Task<SetAutoDarkModeOverrideCommandResponse?> SetAutoDarkModeOverride(SetAutoDarkModeOverrideCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetAutoDarkModeOverrideCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetAutoDarkModeOverrideCommandResponse>

SetAutomationOverride(SetAutomationOverrideCommandSettings, CancellationToken, int?, bool)

Allows overriding the automation flag.

public Task<SetAutomationOverrideCommandResponse?> SetAutomationOverride(SetAutomationOverrideCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetAutomationOverrideCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetAutomationOverrideCommandResponse>

SetCPUThrottlingRate(SetCPUThrottlingRateCommandSettings, CancellationToken, int?, bool)

Enables CPU throttling to emulate slow CPUs.

public Task<SetCPUThrottlingRateCommandResponse?> SetCPUThrottlingRate(SetCPUThrottlingRateCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetCPUThrottlingRateCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetCPUThrottlingRateCommandResponse>

SetDataSaverOverride(SetDataSaverOverrideCommandSettings, CancellationToken, int?, bool)

Override the value of navigator.connection.saveData

public Task<SetDataSaverOverrideCommandResponse?> SetDataSaverOverride(SetDataSaverOverrideCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetDataSaverOverrideCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetDataSaverOverrideCommandResponse>

SetDefaultBackgroundColorOverride(SetDefaultBackgroundColorOverrideCommandSettings, CancellationToken, int?, bool)

Sets or clears an override of the default background color of the frame. This override is used if the content does not specify one.

public Task<SetDefaultBackgroundColorOverrideCommandResponse?> SetDefaultBackgroundColorOverride(SetDefaultBackgroundColorOverrideCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetDefaultBackgroundColorOverrideCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetDefaultBackgroundColorOverrideCommandResponse>

SetDeviceMetricsOverride(SetDeviceMetricsOverrideCommandSettings, CancellationToken, int?, bool)

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

public Task<SetDeviceMetricsOverrideCommandResponse?> SetDeviceMetricsOverride(SetDeviceMetricsOverrideCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetDeviceMetricsOverrideCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetDeviceMetricsOverrideCommandResponse>

SetDevicePostureOverride(SetDevicePostureOverrideCommandSettings, CancellationToken, int?, bool)

Start reporting the given posture value to the Device Posture API. This override can also be set in setDeviceMetricsOverride().

public Task<SetDevicePostureOverrideCommandResponse?> SetDevicePostureOverride(SetDevicePostureOverrideCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetDevicePostureOverrideCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetDevicePostureOverrideCommandResponse>

SetDisabledImageTypes(SetDisabledImageTypesCommandSettings, CancellationToken, int?, bool)

setDisabledImageTypes

public Task<SetDisabledImageTypesCommandResponse?> SetDisabledImageTypes(SetDisabledImageTypesCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetDisabledImageTypesCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetDisabledImageTypesCommandResponse>

SetDisplayFeaturesOverride(SetDisplayFeaturesOverrideCommandSettings, CancellationToken, int?, bool)

Start using the given display features to pupulate the Viewport Segments API. This override can also be set in setDeviceMetricsOverride().

public Task<SetDisplayFeaturesOverrideCommandResponse?> SetDisplayFeaturesOverride(SetDisplayFeaturesOverrideCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetDisplayFeaturesOverrideCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetDisplayFeaturesOverrideCommandResponse>

SetDocumentCookieDisabled(SetDocumentCookieDisabledCommandSettings, CancellationToken, int?, bool)

setDocumentCookieDisabled

public Task<SetDocumentCookieDisabledCommandResponse?> SetDocumentCookieDisabled(SetDocumentCookieDisabledCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetDocumentCookieDisabledCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetDocumentCookieDisabledCommandResponse>

SetEmitTouchEventsForMouse(SetEmitTouchEventsForMouseCommandSettings, CancellationToken, int?, bool)

setEmitTouchEventsForMouse

public Task<SetEmitTouchEventsForMouseCommandResponse?> SetEmitTouchEventsForMouse(SetEmitTouchEventsForMouseCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetEmitTouchEventsForMouseCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetEmitTouchEventsForMouseCommandResponse>

SetEmulatedMedia(SetEmulatedMediaCommandSettings, CancellationToken, int?, bool)

Emulates the given media type or media feature for CSS media queries.

public Task<SetEmulatedMediaCommandResponse?> SetEmulatedMedia(SetEmulatedMediaCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetEmulatedMediaCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetEmulatedMediaCommandResponse>

SetEmulatedOSTextScale(SetEmulatedOSTextScaleCommandSettings, CancellationToken, int?, bool)

Emulates the given OS text scale.

public Task<SetEmulatedOSTextScaleCommandResponse?> SetEmulatedOSTextScale(SetEmulatedOSTextScaleCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetEmulatedOSTextScaleCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetEmulatedOSTextScaleCommandResponse>

SetEmulatedVisionDeficiency(SetEmulatedVisionDeficiencyCommandSettings, CancellationToken, int?, bool)

Emulates the given vision deficiency.

public Task<SetEmulatedVisionDeficiencyCommandResponse?> SetEmulatedVisionDeficiency(SetEmulatedVisionDeficiencyCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetEmulatedVisionDeficiencyCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetEmulatedVisionDeficiencyCommandResponse>

SetFocusEmulationEnabled(SetFocusEmulationEnabledCommandSettings, CancellationToken, int?, bool)

Enables or disables simulating a focused and active page.

public Task<SetFocusEmulationEnabledCommandResponse?> SetFocusEmulationEnabled(SetFocusEmulationEnabledCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetFocusEmulationEnabledCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetFocusEmulationEnabledCommandResponse>

SetGeolocationOverride(SetGeolocationOverrideCommandSettings, CancellationToken, int?, bool)

Overrides the Geolocation Position or Error. Omitting latitude, longitude or accuracy emulates position unavailable.

public Task<SetGeolocationOverrideCommandResponse?> SetGeolocationOverride(SetGeolocationOverrideCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetGeolocationOverrideCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetGeolocationOverrideCommandResponse>

SetHardwareConcurrencyOverride(SetHardwareConcurrencyOverrideCommandSettings, CancellationToken, int?, bool)

setHardwareConcurrencyOverride

public Task<SetHardwareConcurrencyOverrideCommandResponse?> SetHardwareConcurrencyOverride(SetHardwareConcurrencyOverrideCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetHardwareConcurrencyOverrideCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetHardwareConcurrencyOverrideCommandResponse>

SetIdleOverride(SetIdleOverrideCommandSettings, CancellationToken, int?, bool)

Overrides the Idle state.

public Task<SetIdleOverrideCommandResponse?> SetIdleOverride(SetIdleOverrideCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetIdleOverrideCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetIdleOverrideCommandResponse>

SetLocaleOverride(SetLocaleOverrideCommandSettings, CancellationToken, int?, bool)

Overrides default host system locale with the specified one.

public Task<SetLocaleOverrideCommandResponse?> SetLocaleOverride(SetLocaleOverrideCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetLocaleOverrideCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetLocaleOverrideCommandResponse>

SetNavigatorOverrides(SetNavigatorOverridesCommandSettings, CancellationToken, int?, bool)

Overrides value returned by the javascript navigator object.

public Task<SetNavigatorOverridesCommandResponse?> SetNavigatorOverrides(SetNavigatorOverridesCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetNavigatorOverridesCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetNavigatorOverridesCommandResponse>

SetPageScaleFactor(SetPageScaleFactorCommandSettings, CancellationToken, int?, bool)

Sets a specified page scale factor.

public Task<SetPageScaleFactorCommandResponse?> SetPageScaleFactor(SetPageScaleFactorCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetPageScaleFactorCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetPageScaleFactorCommandResponse>

SetPressureDataOverride(SetPressureDataOverrideCommandSettings, CancellationToken, int?, bool)

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.

public Task<SetPressureDataOverrideCommandResponse?> SetPressureDataOverride(SetPressureDataOverrideCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetPressureDataOverrideCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetPressureDataOverrideCommandResponse>

SetPressureSourceOverrideEnabled(SetPressureSourceOverrideEnabledCommandSettings, CancellationToken, int?, bool)

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.

public Task<SetPressureSourceOverrideEnabledCommandResponse?> SetPressureSourceOverrideEnabled(SetPressureSourceOverrideEnabledCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetPressureSourceOverrideEnabledCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetPressureSourceOverrideEnabledCommandResponse>

SetPressureStateOverride(SetPressureStateOverrideCommandSettings, CancellationToken, int?, bool)

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.

public Task<SetPressureStateOverrideCommandResponse?> SetPressureStateOverride(SetPressureStateOverrideCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetPressureStateOverrideCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetPressureStateOverrideCommandResponse>

SetPrimaryScreen(SetPrimaryScreenCommandSettings, CancellationToken, int?, bool)

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.

public Task<SetPrimaryScreenCommandResponse?> SetPrimaryScreen(SetPrimaryScreenCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetPrimaryScreenCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetPrimaryScreenCommandResponse>

SetSafeAreaInsetsOverride(SetSafeAreaInsetsOverrideCommandSettings, CancellationToken, int?, bool)

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.

public Task<SetSafeAreaInsetsOverrideCommandResponse?> SetSafeAreaInsetsOverride(SetSafeAreaInsetsOverrideCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetSafeAreaInsetsOverrideCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetSafeAreaInsetsOverrideCommandResponse>

SetScriptExecutionDisabled(SetScriptExecutionDisabledCommandSettings, CancellationToken, int?, bool)

Switches script execution in the page.

public Task<SetScriptExecutionDisabledCommandResponse?> SetScriptExecutionDisabled(SetScriptExecutionDisabledCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetScriptExecutionDisabledCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetScriptExecutionDisabledCommandResponse>

SetScrollbarsHidden(SetScrollbarsHiddenCommandSettings, CancellationToken, int?, bool)

setScrollbarsHidden

public Task<SetScrollbarsHiddenCommandResponse?> SetScrollbarsHidden(SetScrollbarsHiddenCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetScrollbarsHiddenCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetScrollbarsHiddenCommandResponse>

SetSensorOverrideEnabled(SetSensorOverrideEnabledCommandSettings, CancellationToken, int?, bool)

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.

public Task<SetSensorOverrideEnabledCommandResponse?> SetSensorOverrideEnabled(SetSensorOverrideEnabledCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetSensorOverrideEnabledCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetSensorOverrideEnabledCommandResponse>

SetSensorOverrideReadings(SetSensorOverrideReadingsCommandSettings, CancellationToken, int?, bool)

Updates the sensor readings reported by a sensor type previously overridden by setSensorOverrideEnabled.

public Task<SetSensorOverrideReadingsCommandResponse?> SetSensorOverrideReadings(SetSensorOverrideReadingsCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetSensorOverrideReadingsCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetSensorOverrideReadingsCommandResponse>

SetSmallViewportHeightDifferenceOverride(SetSmallViewportHeightDifferenceOverrideCommandSettings, CancellationToken, int?, bool)

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.

public Task<SetSmallViewportHeightDifferenceOverrideCommandResponse?> SetSmallViewportHeightDifferenceOverride(SetSmallViewportHeightDifferenceOverrideCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetSmallViewportHeightDifferenceOverrideCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetSmallViewportHeightDifferenceOverrideCommandResponse>

SetTimezoneOverride(SetTimezoneOverrideCommandSettings, CancellationToken, int?, bool)

Overrides default host system timezone with the specified one.

public Task<SetTimezoneOverrideCommandResponse?> SetTimezoneOverride(SetTimezoneOverrideCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetTimezoneOverrideCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetTimezoneOverrideCommandResponse>

SetTouchEmulationEnabled(SetTouchEmulationEnabledCommandSettings, CancellationToken, int?, bool)

Enables touch on platforms which do not support them.

public Task<SetTouchEmulationEnabledCommandResponse?> SetTouchEmulationEnabled(SetTouchEmulationEnabledCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetTouchEmulationEnabledCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetTouchEmulationEnabledCommandResponse>

SetUserAgentOverride(SetUserAgentOverrideCommandSettings, CancellationToken, int?, bool)

Allows overriding user agent with the given string. userAgentMetadata must be set for Client Hint headers to be sent.

public Task<SetUserAgentOverrideCommandResponse?> SetUserAgentOverride(SetUserAgentOverrideCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetUserAgentOverrideCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetUserAgentOverrideCommandResponse>

SetVirtualTimePolicy(SetVirtualTimePolicyCommandSettings, CancellationToken, int?, bool)

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.

public Task<SetVirtualTimePolicyCommandResponse> SetVirtualTimePolicy(SetVirtualTimePolicyCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetVirtualTimePolicyCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetVirtualTimePolicyCommandResponse>

SetVisibleSize(SetVisibleSizeCommandSettings, CancellationToken, int?, bool)

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.

public Task<SetVisibleSizeCommandResponse?> SetVisibleSize(SetVisibleSizeCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetVisibleSizeCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetVisibleSizeCommandResponse>

UpdateScreen(UpdateScreenCommandSettings, CancellationToken, int?, bool)

Updates specified screen parameters. Only supported in headless mode.

public Task<UpdateScreenCommandResponse> UpdateScreen(UpdateScreenCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command UpdateScreenCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<UpdateScreenCommandResponse>

Events

ScreenOrientationLockChanged

Fired when a page calls screen.orientation.lock() or screen.orientation.unlock() while device emulation is enabled. This allows the DevTools frontend to update the emulated device orientation accordingly.

public event EventHandler<ScreenOrientationLockChangedEventArgs>? ScreenOrientationLockChanged

Event Type

EventHandler<ScreenOrientationLockChangedEventArgs>

VirtualTimeBudgetExpired

Notification sent after the virtual time budget for the current VirtualTimePolicy has run out.

public event EventHandler<VirtualTimeBudgetExpiredEventArgs>? VirtualTimeBudgetExpired

Event Type

EventHandler<VirtualTimeBudgetExpiredEventArgs>