Documentation
¶
Overview ¶
Package emulation provides the Chrome DevTools Protocol commands, types, and events for the Emulation domain.
This domain emulates different environments for the page.
Generated by the pdlgen command.
Index ¶
- Constants
- Variables
- type AddScreenParams
- type AddScreenResult
- type DevicePosture
- type DevicePostureType
- type DisabledImageType
- type DisplayFeature
- type DisplayFeatureOrientation
- type EventScreenOrientationLockChanged
- type EventVirtualTimeBudgetExpired
- type GetOverriddenSensorInformationParams
- type GetOverriddenSensorInformationResult
- type GetScreenInfosResult
- type MediaFeature
- type PressureMetadata
- type PressureSource
- type PressureState
- type RemoveScreenParams
- type SafeAreaInsets
- type ScreenID
- type ScreenInfo
- type ScreenOrientation
- type ScreenOrientationType
- type SensorMetadata
- type SensorReading
- type SensorReadingQuaternion
- type SensorReadingSingle
- type SensorReadingXYZ
- type SensorType
- type SetAutoDarkModeOverrideParams
- type SetAutomationOverrideParams
- type SetCPUPerformanceOverrideParams
- type SetCPUPerformanceOverridePerformanceTier
- type SetCPUThrottlingRateParams
- type SetDataSaverOverrideParams
- type SetDefaultBackgroundColorOverrideParams
- type SetDeviceMetricsOverrideParams
- type SetDeviceMetricsOverrideScrollbarType
- type SetDeviceMetricsOverrideTextLayoutMode
- type SetDeviceMetricsOverrideViewportMeta
- type SetDevicePostureOverrideParams
- type SetDisabledImageTypesParams
- type SetDisplayFeaturesOverrideParams
- type SetDocumentCookieDisabledParams
- type SetEmitTouchEventsForMouseConfiguration
- type SetEmitTouchEventsForMouseParams
- type SetEmulatedMediaParams
- type SetEmulatedOSTextScaleParams
- type SetEmulatedVisionDeficiencyParams
- type SetEmulatedVisionDeficiencyType
- type SetFocusEmulationEnabledParams
- type SetGeolocationOverrideParams
- type SetHardwareConcurrencyOverrideParams
- type SetIdleOverrideParams
- type SetLocaleOverrideParams
- type SetPageScaleFactorParams
- type SetPressureSourceOverrideEnabledParams
- type SetPressureStateOverrideParams
- type SetPrimaryScreenParams
- type SetSafeAreaInsetsOverrideParams
- type SetScriptExecutionDisabledParams
- type SetScrollbarsHiddenParams
- type SetSensorOverrideEnabledParams
- type SetSensorOverrideReadingsParams
- type SetSmallViewportHeightDifferenceOverrideParams
- type SetTimezoneOverrideParams
- type SetTouchEmulationEnabledParams
- type SetUserAgentOverrideParams
- type SetVirtualKeyboardGeometryOverrideParams
- type SetVirtualTimePolicyParams
- type SetVirtualTimePolicyResult
- type UpdateScreenParams
- type UpdateScreenResult
- type UserAgentBrandVersion
- type UserAgentMetadata
- type VirtualTimePolicy
- type WorkAreaInsets
Constants ¶
const ( CommandClearDeviceMetricsOverride = "Emulation.clearDeviceMetricsOverride" CommandClearGeolocationOverride = "Emulation.clearGeolocationOverride" CommandResetPageScaleFactor = "Emulation.resetPageScaleFactor" CommandSetFocusEmulationEnabled = "Emulation.setFocusEmulationEnabled" CommandSetAutoDarkModeOverride = "Emulation.setAutoDarkModeOverride" CommandSetCPUThrottlingRate = "Emulation.setCPUThrottlingRate" CommandSetDefaultBackgroundColorOverride = "Emulation.setDefaultBackgroundColorOverride" CommandSetSafeAreaInsetsOverride = "Emulation.setSafeAreaInsetsOverride" CommandSetVirtualKeyboardGeometryOverride = "Emulation.setVirtualKeyboardGeometryOverride" CommandSetDeviceMetricsOverride = "Emulation.setDeviceMetricsOverride" CommandSetDevicePostureOverride = "Emulation.setDevicePostureOverride" CommandClearDevicePostureOverride = "Emulation.clearDevicePostureOverride" CommandSetDisplayFeaturesOverride = "Emulation.setDisplayFeaturesOverride" CommandClearDisplayFeaturesOverride = "Emulation.clearDisplayFeaturesOverride" CommandSetScrollbarsHidden = "Emulation.setScrollbarsHidden" CommandSetDocumentCookieDisabled = "Emulation.setDocumentCookieDisabled" CommandSetEmitTouchEventsForMouse = "Emulation.setEmitTouchEventsForMouse" CommandSetEmulatedMedia = "Emulation.setEmulatedMedia" CommandSetEmulatedVisionDeficiency = "Emulation.setEmulatedVisionDeficiency" CommandSetEmulatedOSTextScale = "Emulation.setEmulatedOSTextScale" CommandSetGeolocationOverride = "Emulation.setGeolocationOverride" CommandGetOverriddenSensorInformation = "Emulation.getOverriddenSensorInformation" CommandSetSensorOverrideEnabled = "Emulation.setSensorOverrideEnabled" CommandSetSensorOverrideReadings = "Emulation.setSensorOverrideReadings" CommandSetPressureSourceOverrideEnabled = "Emulation.setPressureSourceOverrideEnabled" CommandSetPressureStateOverride = "Emulation.setPressureStateOverride" CommandSetIdleOverride = "Emulation.setIdleOverride" CommandClearIdleOverride = "Emulation.clearIdleOverride" CommandSetPageScaleFactor = "Emulation.setPageScaleFactor" CommandSetScriptExecutionDisabled = "Emulation.setScriptExecutionDisabled" CommandSetTouchEmulationEnabled = "Emulation.setTouchEmulationEnabled" CommandSetVirtualTimePolicy = "Emulation.setVirtualTimePolicy" CommandSetLocaleOverride = "Emulation.setLocaleOverride" CommandSetTimezoneOverride = "Emulation.setTimezoneOverride" CommandSetDisabledImageTypes = "Emulation.setDisabledImageTypes" CommandSetDataSaverOverride = "Emulation.setDataSaverOverride" CommandSetHardwareConcurrencyOverride = "Emulation.setHardwareConcurrencyOverride" CommandSetCPUPerformanceOverride = "Emulation.setCPUPerformanceOverride" CommandSetUserAgentOverride = "Emulation.setUserAgentOverride" CommandSetAutomationOverride = "Emulation.setAutomationOverride" CommandSetSmallViewportHeightDifferenceOverride = "Emulation.setSmallViewportHeightDifferenceOverride" CommandGetScreenInfos = "Emulation.getScreenInfos" CommandAddScreen = "Emulation.addScreen" CommandUpdateScreen = "Emulation.updateScreen" CommandRemoveScreen = "Emulation.removeScreen" CommandSetPrimaryScreen = "Emulation.setPrimaryScreen" )
Command names.
Variables ¶
var AddScreen = cdp.Command[AddScreenParams, AddScreenResult]{Method: CommandAddScreen}
AddScreen add a new screen to the device. Only supported in headless mode.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-addScreen
var ClearDeviceMetricsOverride = cdp.Command[cdp.Empty, cdp.Empty]{Method: CommandClearDeviceMetricsOverride}
ClearDeviceMetricsOverride clears the overridden device metrics.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-clearDeviceMetricsOverride
var ClearDevicePostureOverride = cdp.Command[cdp.Empty, cdp.Empty]{Method: CommandClearDevicePostureOverride}
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.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-clearDevicePostureOverride
var ClearDisplayFeaturesOverride = cdp.Command[cdp.Empty, cdp.Empty]{Method: CommandClearDisplayFeaturesOverride}
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.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-clearDisplayFeaturesOverride
var ClearGeolocationOverride = cdp.Command[cdp.Empty, cdp.Empty]{Method: CommandClearGeolocationOverride}
ClearGeolocationOverride clears the overridden Geolocation Position and Error.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-clearGeolocationOverride
var ClearIdleOverride = cdp.Command[cdp.Empty, cdp.Empty]{Method: CommandClearIdleOverride}
ClearIdleOverride clears Idle state overrides.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-clearIdleOverride
var GetOverriddenSensorInformation = cdp.Command[GetOverriddenSensorInformationParams, GetOverriddenSensorInformationResult]{Method: CommandGetOverriddenSensorInformation}
GetOverriddenSensorInformation [no description].
var GetScreenInfos = cdp.Command[cdp.Empty, GetScreenInfosResult]{Method: CommandGetScreenInfos}
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.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-getScreenInfos
var RemoveScreen = cdp.Command[RemoveScreenParams, cdp.Empty]{Method: CommandRemoveScreen}
RemoveScreen remove screen from the device. Only supported in headless mode.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-removeScreen
var ResetPageScaleFactor = cdp.Command[cdp.Empty, cdp.Empty]{Method: CommandResetPageScaleFactor}
ResetPageScaleFactor requests that page scale factor is reset to initial values.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-resetPageScaleFactor
var ScreenOrientationLockChanged = cdp.Event[EventScreenOrientationLockChanged]{Method: "Emulation.screenOrientationLockChanged"}
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.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#event-screenOrientationLockChanged
var SetAutoDarkModeOverride = cdp.Command[SetAutoDarkModeOverrideParams, cdp.Empty]{Method: CommandSetAutoDarkModeOverride}
SetAutoDarkModeOverride automatically render all web contents using a dark theme.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setAutoDarkModeOverride
var SetAutomationOverride = cdp.Command[SetAutomationOverrideParams, cdp.Empty]{Method: CommandSetAutomationOverride}
SetAutomationOverride allows overriding the automation flag.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setAutomationOverride
var SetCPUPerformanceOverride = cdp.Command[SetCPUPerformanceOverrideParams, cdp.Empty]{Method: CommandSetCPUPerformanceOverride}
SetCPUPerformanceOverride overrides the value of navigator.cpuPerformance.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setCPUPerformanceOverride
var SetCPUThrottlingRate = cdp.Command[SetCPUThrottlingRateParams, cdp.Empty]{Method: CommandSetCPUThrottlingRate}
SetCPUThrottlingRate enables CPU throttling to emulate slow CPUs.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setCPUThrottlingRate
var SetDataSaverOverride = cdp.Command[SetDataSaverOverrideParams, cdp.Empty]{Method: CommandSetDataSaverOverride}
SetDataSaverOverride override the value of navigator.connection.saveData.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setDataSaverOverride
var SetDefaultBackgroundColorOverride = cdp.Command[SetDefaultBackgroundColorOverrideParams, cdp.Empty]{Method: CommandSetDefaultBackgroundColorOverride}
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.
var SetDeviceMetricsOverride = cdp.Command[SetDeviceMetricsOverrideParams, cdp.Empty]{Method: CommandSetDeviceMetricsOverride}
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).
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setDeviceMetricsOverride
var SetDevicePostureOverride = cdp.Command[SetDevicePostureOverrideParams, cdp.Empty]{Method: CommandSetDevicePostureOverride}
SetDevicePostureOverride start reporting the given posture value to the Device Posture API. This override can also be set in setDeviceMetricsOverride().
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setDevicePostureOverride
var SetDisabledImageTypes = cdp.Command[SetDisabledImageTypesParams, cdp.Empty]{Method: CommandSetDisabledImageTypes}
SetDisabledImageTypes [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setDisabledImageTypes
var SetDisplayFeaturesOverride = cdp.Command[SetDisplayFeaturesOverrideParams, cdp.Empty]{Method: CommandSetDisplayFeaturesOverride}
SetDisplayFeaturesOverride start using the given display features to pupulate the Viewport Segments API. This override can also be set in setDeviceMetricsOverride().
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setDisplayFeaturesOverride
var SetDocumentCookieDisabled = cdp.Command[SetDocumentCookieDisabledParams, cdp.Empty]{Method: CommandSetDocumentCookieDisabled}
SetDocumentCookieDisabled [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setDocumentCookieDisabled
var SetEmitTouchEventsForMouse = cdp.Command[SetEmitTouchEventsForMouseParams, cdp.Empty]{Method: CommandSetEmitTouchEventsForMouse}
SetEmitTouchEventsForMouse [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setEmitTouchEventsForMouse
var SetEmulatedMedia = cdp.Command[SetEmulatedMediaParams, cdp.Empty]{Method: CommandSetEmulatedMedia}
SetEmulatedMedia emulates the given media type or media feature for CSS media queries.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setEmulatedMedia
var SetEmulatedOSTextScale = cdp.Command[SetEmulatedOSTextScaleParams, cdp.Empty]{Method: CommandSetEmulatedOSTextScale}
SetEmulatedOSTextScale emulates the given OS text scale.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setEmulatedOSTextScale
var SetEmulatedVisionDeficiency = cdp.Command[SetEmulatedVisionDeficiencyParams, cdp.Empty]{Method: CommandSetEmulatedVisionDeficiency}
SetEmulatedVisionDeficiency emulates the given vision deficiency.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setEmulatedVisionDeficiency
var SetFocusEmulationEnabled = cdp.Command[SetFocusEmulationEnabledParams, cdp.Empty]{Method: CommandSetFocusEmulationEnabled}
SetFocusEmulationEnabled enables or disables simulating a focused and active page.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setFocusEmulationEnabled
var SetGeolocationOverride = cdp.Command[SetGeolocationOverrideParams, cdp.Empty]{Method: CommandSetGeolocationOverride}
SetGeolocationOverride overrides the Geolocation Position or Error. Omitting latitude, longitude or accuracy emulates position unavailable.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setGeolocationOverride
var SetHardwareConcurrencyOverride = cdp.Command[SetHardwareConcurrencyOverrideParams, cdp.Empty]{Method: CommandSetHardwareConcurrencyOverride}
SetHardwareConcurrencyOverride [no description].
var SetIdleOverride = cdp.Command[SetIdleOverrideParams, cdp.Empty]{Method: CommandSetIdleOverride}
SetIdleOverride overrides the Idle state.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setIdleOverride
var SetLocaleOverride = cdp.Command[SetLocaleOverrideParams, cdp.Empty]{Method: CommandSetLocaleOverride}
SetLocaleOverride overrides default host system locale with the specified one.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setLocaleOverride
var SetPageScaleFactor = cdp.Command[SetPageScaleFactorParams, cdp.Empty]{Method: CommandSetPageScaleFactor}
SetPageScaleFactor sets a specified page scale factor.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setPageScaleFactor
var SetPressureSourceOverrideEnabled = cdp.Command[SetPressureSourceOverrideEnabledParams, cdp.Empty]{Method: CommandSetPressureSourceOverrideEnabled}
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.
var SetPressureStateOverride = cdp.Command[SetPressureStateOverrideParams, cdp.Empty]{Method: CommandSetPressureStateOverride}
SetPressureStateOverride provides a given pressure state that will be processed and eventually be delivered to PressureObserver users. |source| must have been previously overridden by setPressureSourceOverrideEnabled.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setPressureStateOverride
var SetPrimaryScreen = cdp.Command[SetPrimaryScreenParams, cdp.Empty]{Method: CommandSetPrimaryScreen}
SetPrimaryScreen 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.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setPrimaryScreen
var SetSafeAreaInsetsOverride = cdp.Command[SetSafeAreaInsetsOverrideParams, cdp.Empty]{Method: CommandSetSafeAreaInsetsOverride}
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.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setSafeAreaInsetsOverride
var SetScriptExecutionDisabled = cdp.Command[SetScriptExecutionDisabledParams, cdp.Empty]{Method: CommandSetScriptExecutionDisabled}
SetScriptExecutionDisabled switches script execution in the page.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setScriptExecutionDisabled
var SetScrollbarsHidden = cdp.Command[SetScrollbarsHiddenParams, cdp.Empty]{Method: CommandSetScrollbarsHidden}
SetScrollbarsHidden [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setScrollbarsHidden
var SetSensorOverrideEnabled = cdp.Command[SetSensorOverrideEnabledParams, cdp.Empty]{Method: CommandSetSensorOverrideEnabled}
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.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setSensorOverrideEnabled
var SetSensorOverrideReadings = cdp.Command[SetSensorOverrideReadingsParams, cdp.Empty]{Method: CommandSetSensorOverrideReadings}
SetSensorOverrideReadings updates the sensor readings reported by a sensor type previously overridden by setSensorOverrideEnabled.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setSensorOverrideReadings
var SetSmallViewportHeightDifferenceOverride = cdp.Command[SetSmallViewportHeightDifferenceOverrideParams, cdp.Empty]{Method: CommandSetSmallViewportHeightDifferenceOverride}
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.
var SetTimezoneOverride = cdp.Command[SetTimezoneOverrideParams, cdp.Empty]{Method: CommandSetTimezoneOverride}
SetTimezoneOverride overrides default host system timezone with the specified one.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setTimezoneOverride
var SetTouchEmulationEnabled = cdp.Command[SetTouchEmulationEnabledParams, cdp.Empty]{Method: CommandSetTouchEmulationEnabled}
SetTouchEmulationEnabled enables touch on platforms which do not support them.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setTouchEmulationEnabled
var SetUserAgentOverride = cdp.Command[SetUserAgentOverrideParams, cdp.Empty]{Method: CommandSetUserAgentOverride}
SetUserAgentOverride allows overriding user agent with the given string. userAgentMetadata must be set for Client Hint headers to be sent.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setUserAgentOverride
var SetVirtualKeyboardGeometryOverride = cdp.Command[SetVirtualKeyboardGeometryOverrideParams, cdp.Empty]{Method: CommandSetVirtualKeyboardGeometryOverride}
SetVirtualKeyboardGeometryOverride overrides virtual keyboard geometry in CSS pixels, relative to the top-level viewport. The provided rect is used for navigator.virtualKeyboard.boundingRect, geometrychange events, and env(keyboard-inset-*) values on the inspected frame. The override applies independently of navigator.virtualKeyboard.overlaysContent so clients can preview overlay geometry without mutating page state. Values are rounded to the nearest CSS pixel. Omitting the rect clears the override.
var SetVirtualTimePolicy = cdp.Command[SetVirtualTimePolicyParams, SetVirtualTimePolicyResult]{Method: CommandSetVirtualTimePolicy}
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.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setVirtualTimePolicy
var UpdateScreen = cdp.Command[UpdateScreenParams, UpdateScreenResult]{Method: CommandUpdateScreen}
UpdateScreen updates specified screen parameters. Only supported in headless mode.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-updateScreen
var VirtualTimeBudgetExpired = cdp.Event[EventVirtualTimeBudgetExpired]{Method: "Emulation.virtualTimeBudgetExpired"}
VirtualTimeBudgetExpired notification sent after the virtual time budget for the current VirtualTimePolicy has run out.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#event-virtualTimeBudgetExpired
Functions ¶
This section is empty.
Types ¶
type AddScreenParams ¶
type AddScreenParams struct {
Left int64 `json:"left"` // Offset of the left edge of the screen in pixels.
Top int64 `json:"top"` // Offset of the top edge of the screen in pixels.
Width int64 `json:"width"` // The width of the screen in pixels.
Height int64 `json:"height"` // The height of the screen in pixels.
WorkAreaInsets *WorkAreaInsets `json:"workAreaInsets,omitempty,omitzero"` // Specifies the screen's work area. Default is entire screen.
DevicePixelRatio float64 `json:"devicePixelRatio,omitempty,omitzero"` // Specifies the screen's device pixel ratio. Default is 1.
Rotation int64 `json:"rotation,omitempty,omitzero"` // Specifies the screen's rotation angle. Available values are 0, 90, 180 and 270. Default is 0.
ColorDepth int64 `json:"colorDepth,omitempty,omitzero"` // Specifies the screen's color depth in bits. Default is 24.
Label string `json:"label,omitempty,omitzero"` // Specifies the descriptive label for the screen. Default is none.
IsInternal *bool `json:"isInternal,omitempty,omitzero"` // Indicates whether the screen is internal to the device or external, attached to the device. Default is false.
}
AddScreenParams are the parameters of the command Emulation.addScreen.
type AddScreenResult ¶ added in v0.157.3
type AddScreenResult struct {
ScreenInfo *ScreenInfo `json:"screenInfo,omitempty,omitzero"`
}
AddScreenResult is the result of the command Emulation.addScreen.
type DevicePosture ¶
type DevicePosture struct {
Type DevicePostureType `json:"type"` // Current posture of the device
}
DevicePosture [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#type-DevicePosture
type DevicePostureType ¶ added in v0.157.1
type DevicePostureType string
DevicePostureType current posture of the device.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#type-DevicePosture
const ( DevicePostureTypeContinuous DevicePostureType = "continuous" DevicePostureTypeFolded DevicePostureType = "folded" )
DevicePostureType values.
func (DevicePostureType) String ¶ added in v0.157.1
func (t DevicePostureType) String() string
String returns the DevicePostureType as string value.
type DisabledImageType ¶
type DisabledImageType string
DisabledImageType enum of image types that can be disabled.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#type-DisabledImageType
const ( DisabledImageTypeAvif DisabledImageType = "avif" DisabledImageTypeJxl DisabledImageType = "jxl" DisabledImageTypeWebp DisabledImageType = "webp" )
DisabledImageType values.
func (DisabledImageType) String ¶
func (t DisabledImageType) String() string
String returns the DisabledImageType as string value.
type DisplayFeature ¶
type DisplayFeature struct {
Orientation DisplayFeatureOrientation `json:"orientation"` // Orientation of a display feature in relation to screen
Offset int64 `json:"offset"` // The offset from the screen origin in either the x (for vertical orientation) or y (for horizontal orientation) direction.
MaskLength int64 `json:"maskLength"` // A display feature may mask content such that it is not physically displayed - this length along with the offset describes this area. A display feature that only splits content will have a 0 mask_length.
}
DisplayFeature [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#type-DisplayFeature
type DisplayFeatureOrientation ¶ added in v0.157.1
type DisplayFeatureOrientation string
DisplayFeatureOrientation orientation of a display feature in relation to screen.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#type-DisplayFeature
const ( DisplayFeatureOrientationVertical DisplayFeatureOrientation = "vertical" DisplayFeatureOrientationHorizontal DisplayFeatureOrientation = "horizontal" )
DisplayFeatureOrientation values.
func (DisplayFeatureOrientation) String ¶ added in v0.157.1
func (t DisplayFeatureOrientation) String() string
String returns the DisplayFeatureOrientation as string value.
type EventScreenOrientationLockChanged ¶
type EventScreenOrientationLockChanged struct {
Locked bool `json:"locked"` // Whether the screen orientation is currently locked.
Orientation *ScreenOrientation `json:"orientation,omitempty,omitzero"` // The orientation lock type requested by the page. Only set when locked is true.
}
EventScreenOrientationLockChanged 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.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#event-screenOrientationLockChanged
type EventVirtualTimeBudgetExpired ¶
type EventVirtualTimeBudgetExpired struct{}
EventVirtualTimeBudgetExpired notification sent after the virtual time budget for the current VirtualTimePolicy has run out.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#event-virtualTimeBudgetExpired
type GetOverriddenSensorInformationParams ¶
type GetOverriddenSensorInformationParams struct {
Type SensorType `json:"type"`
}
GetOverriddenSensorInformationParams are the parameters of the command Emulation.getOverriddenSensorInformation.
type GetOverriddenSensorInformationResult ¶ added in v0.157.3
type GetOverriddenSensorInformationResult struct {
RequestedSamplingFrequency float64 `json:"requestedSamplingFrequency,omitempty,omitzero"`
}
GetOverriddenSensorInformationResult is the result of the command Emulation.getOverriddenSensorInformation.
type GetScreenInfosResult ¶ added in v0.157.3
type GetScreenInfosResult struct {
ScreenInfos []*ScreenInfo `json:"screenInfos,omitempty,omitzero"`
}
GetScreenInfosResult is the result of the command Emulation.getScreenInfos.
type MediaFeature ¶
MediaFeature [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#type-MediaFeature
type PressureMetadata ¶
type PressureMetadata struct {
Available bool `json:"available"`
}
PressureMetadata [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#type-PressureMetadata
type PressureSource ¶
type PressureSource string
PressureSource [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#type-PressureSource
const (
PressureSourceCPU PressureSource = "cpu"
)
PressureSource values.
func (PressureSource) String ¶
func (t PressureSource) String() string
String returns the PressureSource as string value.
type PressureState ¶
type PressureState string
PressureState [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#type-PressureState
const ( PressureStateNominal PressureState = "nominal" PressureStateFair PressureState = "fair" PressureStateSerious PressureState = "serious" PressureStateCritical PressureState = "critical" )
PressureState values.
func (PressureState) String ¶
func (t PressureState) String() string
String returns the PressureState as string value.
type RemoveScreenParams ¶
type RemoveScreenParams struct {
ScreenID ScreenID `json:"screenId"`
}
RemoveScreenParams are the parameters of the command Emulation.removeScreen.
type SafeAreaInsets ¶
type SafeAreaInsets struct {
Top *int64 `json:"top,omitempty,omitzero"` // Overrides safe-area-inset-top.
TopMax *int64 `json:"topMax,omitempty,omitzero"` // Overrides safe-area-max-inset-top.
Left *int64 `json:"left,omitempty,omitzero"` // Overrides safe-area-inset-left.
LeftMax *int64 `json:"leftMax,omitempty,omitzero"` // Overrides safe-area-max-inset-left.
Bottom *int64 `json:"bottom,omitempty,omitzero"` // Overrides safe-area-inset-bottom.
BottomMax *int64 `json:"bottomMax,omitempty,omitzero"` // Overrides safe-area-max-inset-bottom.
Right *int64 `json:"right,omitempty,omitzero"` // Overrides safe-area-inset-right.
RightMax *int64 `json:"rightMax,omitempty,omitzero"` // Overrides safe-area-max-inset-right.
}
SafeAreaInsets [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#type-SafeAreaInsets
type ScreenID ¶
type ScreenID string
ScreenID [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#type-ScreenId
type ScreenInfo ¶
type ScreenInfo struct {
Left int64 `json:"left"` // Offset of the left edge of the screen.
Top int64 `json:"top"` // Offset of the top edge of the screen.
Width int64 `json:"width"` // Width of the screen.
Height int64 `json:"height"` // Height of the screen.
AvailLeft int64 `json:"availLeft"` // Offset of the left edge of the available screen area.
AvailTop int64 `json:"availTop"` // Offset of the top edge of the available screen area.
AvailWidth int64 `json:"availWidth"` // Width of the available screen area.
AvailHeight int64 `json:"availHeight"` // Height of the available screen area.
DevicePixelRatio float64 `json:"devicePixelRatio"` // Specifies the screen's device pixel ratio.
Orientation *ScreenOrientation `json:"orientation"` // Specifies the screen's orientation.
ColorDepth int64 `json:"colorDepth"` // Specifies the screen's color depth in bits.
IsExtended bool `json:"isExtended"` // Indicates whether the device has multiple screens.
IsInternal bool `json:"isInternal"` // Indicates whether the screen is internal to the device or external, attached to the device.
IsPrimary bool `json:"isPrimary"` // Indicates whether the screen is set as the the operating system primary screen.
Label string `json:"label"` // Specifies the descriptive label for the screen.
ID ScreenID `json:"id"` // Specifies the unique identifier of the screen.
}
ScreenInfo screen information similar to the one returned by window.getScreenDetails() method, see https://w3c.github.io/window-management/#screendetailed.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#type-ScreenInfo
type ScreenOrientation ¶
type ScreenOrientation struct {
Type ScreenOrientationType `json:"type"` // Orientation type.
Angle int64 `json:"angle"` // Orientation angle.
}
ScreenOrientation screen orientation.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#type-ScreenOrientation
type ScreenOrientationType ¶ added in v0.157.1
type ScreenOrientationType string
ScreenOrientationType orientation type.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#type-ScreenOrientation
const ( ScreenOrientationTypePortraitPrimary ScreenOrientationType = "portraitPrimary" ScreenOrientationTypePortraitSecondary ScreenOrientationType = "portraitSecondary" ScreenOrientationTypeLandscapePrimary ScreenOrientationType = "landscapePrimary" ScreenOrientationTypeLandscapeSecondary ScreenOrientationType = "landscapeSecondary" )
ScreenOrientationType values.
func (ScreenOrientationType) String ¶ added in v0.157.1
func (t ScreenOrientationType) String() string
String returns the ScreenOrientationType as string value.
type SensorMetadata ¶
type SensorMetadata struct {
Available bool `json:"available"`
MinimumFrequency float64 `json:"minimumFrequency,omitempty,omitzero"`
MaximumFrequency float64 `json:"maximumFrequency,omitempty,omitzero"`
}
SensorMetadata [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#type-SensorMetadata
type SensorReading ¶
type SensorReading struct {
Single *SensorReadingSingle `json:"single,omitempty,omitzero"`
Xyz *SensorReadingXYZ `json:"xyz,omitempty,omitzero"`
Quaternion *SensorReadingQuaternion `json:"quaternion,omitempty,omitzero"`
}
SensorReading [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#type-SensorReading
type SensorReadingQuaternion ¶
type SensorReadingQuaternion struct {
X float64 `json:"x"`
Y float64 `json:"y"`
Z float64 `json:"z"`
W float64 `json:"w"`
}
SensorReadingQuaternion [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#type-SensorReadingQuaternion
type SensorReadingSingle ¶
type SensorReadingSingle struct {
Value float64 `json:"value"`
}
SensorReadingSingle [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#type-SensorReadingSingle
type SensorReadingXYZ ¶
SensorReadingXYZ [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#type-SensorReadingXYZ
type SensorType ¶
type SensorType string
SensorType used to specify sensor types to emulate. See https://w3c.github.io/sensors/#automation for more information.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#type-SensorType
const ( SensorTypeAbsoluteOrientation SensorType = "absolute-orientation" SensorTypeAccelerometer SensorType = "accelerometer" SensorTypeAmbientLight SensorType = "ambient-light" SensorTypeGravity SensorType = "gravity" SensorTypeGyroscope SensorType = "gyroscope" SensorTypeLinearAcceleration SensorType = "linear-acceleration" SensorTypeMagnetometer SensorType = "magnetometer" SensorTypeRelativeOrientation SensorType = "relative-orientation" )
SensorType values.
func (SensorType) String ¶
func (t SensorType) String() string
String returns the SensorType as string value.
type SetAutoDarkModeOverrideParams ¶
type SetAutoDarkModeOverrideParams struct {
Enabled *bool `json:"enabled,omitempty,omitzero"` // Whether to enable or disable automatic dark mode. If not specified, any existing override will be cleared.
}
SetAutoDarkModeOverrideParams are the parameters of the command Emulation.setAutoDarkModeOverride.
type SetAutomationOverrideParams ¶
type SetAutomationOverrideParams struct {
Enabled bool `json:"enabled"` // Whether the override should be enabled.
}
SetAutomationOverrideParams are the parameters of the command Emulation.setAutomationOverride.
type SetCPUPerformanceOverrideParams ¶
type SetCPUPerformanceOverrideParams struct {
PerformanceTier SetCPUPerformanceOverridePerformanceTier `json:"performanceTier,omitempty,omitzero"` // Override value. Omitting the parameter disables the override.
}
SetCPUPerformanceOverrideParams are the parameters of the command Emulation.setCPUPerformanceOverride.
type SetCPUPerformanceOverridePerformanceTier ¶ added in v0.157.1
type SetCPUPerformanceOverridePerformanceTier string
SetCPUPerformanceOverridePerformanceTier override value. Omitting the parameter disables the override.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setCPUPerformanceOverride
const ( SetCPUPerformanceOverridePerformanceTierUnknown SetCPUPerformanceOverridePerformanceTier = "unknown" SetCPUPerformanceOverridePerformanceTierLow SetCPUPerformanceOverridePerformanceTier = "low" SetCPUPerformanceOverridePerformanceTierMid SetCPUPerformanceOverridePerformanceTier = "mid" SetCPUPerformanceOverridePerformanceTierHigh SetCPUPerformanceOverridePerformanceTier = "high" SetCPUPerformanceOverridePerformanceTierUltra SetCPUPerformanceOverridePerformanceTier = "ultra" )
SetCPUPerformanceOverridePerformanceTier values.
func (SetCPUPerformanceOverridePerformanceTier) String ¶ added in v0.157.1
func (t SetCPUPerformanceOverridePerformanceTier) String() string
String returns the SetCPUPerformanceOverridePerformanceTier as string value.
type SetCPUThrottlingRateParams ¶
type SetCPUThrottlingRateParams struct {
Rate float64 `json:"rate"` // Throttling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc).
}
SetCPUThrottlingRateParams are the parameters of the command Emulation.setCPUThrottlingRate.
type SetDataSaverOverrideParams ¶
type SetDataSaverOverrideParams struct {
DataSaverEnabled *bool `json:"dataSaverEnabled,omitempty,omitzero"` // Override value. Omitting the parameter disables the override.
}
SetDataSaverOverrideParams are the parameters of the command Emulation.setDataSaverOverride.
type SetDefaultBackgroundColorOverrideParams ¶
type SetDefaultBackgroundColorOverrideParams struct {
Color *cdp.RGBA `json:"color,omitempty,omitzero"` // RGBA of the default background color. If not specified, any existing override will be cleared.
}
SetDefaultBackgroundColorOverrideParams are the parameters of the command Emulation.setDefaultBackgroundColorOverride.
type SetDeviceMetricsOverrideParams ¶
type SetDeviceMetricsOverrideParams struct {
Width int64 `json:"width"` // Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.
Height int64 `json:"height"` // Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.
DeviceScaleFactor float64 `json:"deviceScaleFactor"` // Overriding device scale factor value. 0 disables the override.
Mobile bool `json:"mobile"` // Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more.
Scale float64 `json:"scale,omitempty,omitzero"` // Scale to apply to resulting view image.
ScreenWidth int64 `json:"screenWidth,omitempty,omitzero"` // Overriding screen width value in pixels (minimum 0, maximum 10000000).
ScreenHeight int64 `json:"screenHeight,omitempty,omitzero"` // Overriding screen height value in pixels (minimum 0, maximum 10000000).
PositionX int64 `json:"positionX,omitempty,omitzero"` // Overriding view X position on screen in pixels (minimum 0, maximum 10000000).
PositionY int64 `json:"positionY,omitempty,omitzero"` // Overriding view Y position on screen in pixels (minimum 0, maximum 10000000).
DontSetVisibleSize *bool `json:"dontSetVisibleSize,omitempty,omitzero"` // Do not set visible view size, rely upon explicit setVisibleSize call.
ScreenOrientation *ScreenOrientation `json:"screenOrientation,omitempty,omitzero"` // Screen orientation override.
Viewport *page.Viewport `json:"viewport,omitempty,omitzero"` // 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.
ScrollbarType SetDeviceMetricsOverrideScrollbarType `json:"scrollbarType,omitempty,omitzero"` // Scrollbar type. Default: default.
ScreenOrientationLockEmulation *bool `json:"screenOrientationLockEmulation,omitempty,omitzero"` // 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.
ViewportMeta SetDeviceMetricsOverrideViewportMeta `json:"viewportMeta,omitempty,omitzero"` // Viewport meta tag behavior. Default: default. Note: if mobile is true, the viewport meta tag is always enabled.
TextLayoutMode SetDeviceMetricsOverrideTextLayoutMode `json:"textLayoutMode,omitempty,omitzero"` // Text layout mode. Default: default. Note: if mobile is true, mobile text layout mode (text autosizing) is always enabled.
}
SetDeviceMetricsOverrideParams are the parameters of the command Emulation.setDeviceMetricsOverride.
type SetDeviceMetricsOverrideScrollbarType ¶ added in v0.157.1
type SetDeviceMetricsOverrideScrollbarType string
SetDeviceMetricsOverrideScrollbarType scrollbar type. Default: default.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setDeviceMetricsOverride
const ( SetDeviceMetricsOverrideScrollbarTypeOverlay SetDeviceMetricsOverrideScrollbarType = "overlay" SetDeviceMetricsOverrideScrollbarTypeDefault SetDeviceMetricsOverrideScrollbarType = "default" )
SetDeviceMetricsOverrideScrollbarType values.
func (SetDeviceMetricsOverrideScrollbarType) String ¶ added in v0.157.1
func (t SetDeviceMetricsOverrideScrollbarType) String() string
String returns the SetDeviceMetricsOverrideScrollbarType as string value.
type SetDeviceMetricsOverrideTextLayoutMode ¶ added in v0.157.1
type SetDeviceMetricsOverrideTextLayoutMode string
SetDeviceMetricsOverrideTextLayoutMode text layout mode. Default: default. Note: if mobile is true, mobile text layout mode (text autosizing) is always enabled.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setDeviceMetricsOverride
const ( SetDeviceMetricsOverrideTextLayoutModeMobile SetDeviceMetricsOverrideTextLayoutMode = "mobile" SetDeviceMetricsOverrideTextLayoutModeDefault SetDeviceMetricsOverrideTextLayoutMode = "default" )
SetDeviceMetricsOverrideTextLayoutMode values.
func (SetDeviceMetricsOverrideTextLayoutMode) String ¶ added in v0.157.1
func (t SetDeviceMetricsOverrideTextLayoutMode) String() string
String returns the SetDeviceMetricsOverrideTextLayoutMode as string value.
type SetDeviceMetricsOverrideViewportMeta ¶ added in v0.157.1
type SetDeviceMetricsOverrideViewportMeta string
SetDeviceMetricsOverrideViewportMeta viewport meta tag behavior. Default: default. Note: if mobile is true, the viewport meta tag is always enabled.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setDeviceMetricsOverride
const ( SetDeviceMetricsOverrideViewportMetaEnable SetDeviceMetricsOverrideViewportMeta = "enable" SetDeviceMetricsOverrideViewportMetaDefault SetDeviceMetricsOverrideViewportMeta = "default" )
SetDeviceMetricsOverrideViewportMeta values.
func (SetDeviceMetricsOverrideViewportMeta) String ¶ added in v0.157.1
func (t SetDeviceMetricsOverrideViewportMeta) String() string
String returns the SetDeviceMetricsOverrideViewportMeta as string value.
type SetDevicePostureOverrideParams ¶
type SetDevicePostureOverrideParams struct {
Posture *DevicePosture `json:"posture"`
}
SetDevicePostureOverrideParams are the parameters of the command Emulation.setDevicePostureOverride.
type SetDisabledImageTypesParams ¶
type SetDisabledImageTypesParams struct {
ImageTypes []DisabledImageType `json:"imageTypes"` // Image types to disable.
}
SetDisabledImageTypesParams are the parameters of the command Emulation.setDisabledImageTypes.
type SetDisplayFeaturesOverrideParams ¶
type SetDisplayFeaturesOverrideParams struct {
Features []*DisplayFeature `json:"features"`
}
SetDisplayFeaturesOverrideParams are the parameters of the command Emulation.setDisplayFeaturesOverride.
type SetDocumentCookieDisabledParams ¶
type SetDocumentCookieDisabledParams struct {
Disabled bool `json:"disabled"` // Whether document.coookie API should be disabled.
}
SetDocumentCookieDisabledParams are the parameters of the command Emulation.setDocumentCookieDisabled.
type SetEmitTouchEventsForMouseConfiguration ¶ added in v0.157.1
type SetEmitTouchEventsForMouseConfiguration string
SetEmitTouchEventsForMouseConfiguration touch/gesture events configuration. Default: current platform.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setEmitTouchEventsForMouse
const ( SetEmitTouchEventsForMouseConfigurationMobile SetEmitTouchEventsForMouseConfiguration = "mobile" SetEmitTouchEventsForMouseConfigurationDesktop SetEmitTouchEventsForMouseConfiguration = "desktop" )
SetEmitTouchEventsForMouseConfiguration values.
func (SetEmitTouchEventsForMouseConfiguration) String ¶ added in v0.157.1
func (t SetEmitTouchEventsForMouseConfiguration) String() string
String returns the SetEmitTouchEventsForMouseConfiguration as string value.
type SetEmitTouchEventsForMouseParams ¶
type SetEmitTouchEventsForMouseParams struct {
Enabled bool `json:"enabled"` // Whether touch emulation based on mouse input should be enabled.
Configuration SetEmitTouchEventsForMouseConfiguration `json:"configuration,omitempty,omitzero"` // Touch/gesture events configuration. Default: current platform.
}
SetEmitTouchEventsForMouseParams are the parameters of the command Emulation.setEmitTouchEventsForMouse.
type SetEmulatedMediaParams ¶
type SetEmulatedMediaParams struct {
Media string `json:"media,omitempty,omitzero"` // Media type to emulate. Empty string disables the override.
Features []*MediaFeature `json:"features,omitempty,omitzero"` // Media features to emulate.
}
SetEmulatedMediaParams are the parameters of the command Emulation.setEmulatedMedia.
type SetEmulatedOSTextScaleParams ¶
type SetEmulatedOSTextScaleParams struct {
Scale float64 `json:"scale,omitempty,omitzero"`
}
SetEmulatedOSTextScaleParams are the parameters of the command Emulation.setEmulatedOSTextScale.
type SetEmulatedVisionDeficiencyParams ¶
type SetEmulatedVisionDeficiencyParams struct {
Type SetEmulatedVisionDeficiencyType `json:"type"` // Vision deficiency to emulate. Order: best-effort emulations come first, followed by any physiologically accurate emulations for medically recognized color vision deficiencies.
}
SetEmulatedVisionDeficiencyParams are the parameters of the command Emulation.setEmulatedVisionDeficiency.
type SetEmulatedVisionDeficiencyType ¶ added in v0.157.1
type SetEmulatedVisionDeficiencyType string
SetEmulatedVisionDeficiencyType vision deficiency to emulate. Order: best-effort emulations come first, followed by any physiologically accurate emulations for medically recognized color vision deficiencies.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setEmulatedVisionDeficiency
const ( SetEmulatedVisionDeficiencyTypeNone SetEmulatedVisionDeficiencyType = "none" SetEmulatedVisionDeficiencyTypeBlurredVision SetEmulatedVisionDeficiencyType = "blurredVision" SetEmulatedVisionDeficiencyTypeReducedContrast SetEmulatedVisionDeficiencyType = "reducedContrast" SetEmulatedVisionDeficiencyTypeAchromatopsia SetEmulatedVisionDeficiencyType = "achromatopsia" SetEmulatedVisionDeficiencyTypeDeuteranopia SetEmulatedVisionDeficiencyType = "deuteranopia" SetEmulatedVisionDeficiencyTypeProtanopia SetEmulatedVisionDeficiencyType = "protanopia" SetEmulatedVisionDeficiencyTypeTritanopia SetEmulatedVisionDeficiencyType = "tritanopia" )
SetEmulatedVisionDeficiencyType values.
func (SetEmulatedVisionDeficiencyType) String ¶ added in v0.157.1
func (t SetEmulatedVisionDeficiencyType) String() string
String returns the SetEmulatedVisionDeficiencyType as string value.
type SetFocusEmulationEnabledParams ¶
type SetFocusEmulationEnabledParams struct {
Enabled bool `json:"enabled"` // Whether to enable to disable focus emulation.
}
SetFocusEmulationEnabledParams are the parameters of the command Emulation.setFocusEmulationEnabled.
type SetGeolocationOverrideParams ¶
type SetGeolocationOverrideParams struct {
Latitude *float64 `json:"latitude,omitempty,omitzero"` // Mock latitude
Longitude *float64 `json:"longitude,omitempty,omitzero"` // Mock longitude
Accuracy *float64 `json:"accuracy,omitempty,omitzero"` // Mock accuracy
Altitude *float64 `json:"altitude,omitempty,omitzero"` // Mock altitude
AltitudeAccuracy *float64 `json:"altitudeAccuracy,omitempty,omitzero"` // Mock altitudeAccuracy
Heading *float64 `json:"heading,omitempty,omitzero"` // Mock heading
Speed *float64 `json:"speed,omitempty,omitzero"` // Mock speed
}
SetGeolocationOverrideParams are the parameters of the command Emulation.setGeolocationOverride.
type SetHardwareConcurrencyOverrideParams ¶
type SetHardwareConcurrencyOverrideParams struct {
HardwareConcurrency int64 `json:"hardwareConcurrency"` // Hardware concurrency to report
}
SetHardwareConcurrencyOverrideParams are the parameters of the command Emulation.setHardwareConcurrencyOverride.
type SetIdleOverrideParams ¶
type SetIdleOverrideParams struct {
IsUserActive bool `json:"isUserActive"` // Mock isUserActive
IsScreenUnlocked bool `json:"isScreenUnlocked"` // Mock isScreenUnlocked
}
SetIdleOverrideParams are the parameters of the command Emulation.setIdleOverride.
type SetLocaleOverrideParams ¶
type SetLocaleOverrideParams struct {
Locale string `json:"locale,omitempty,omitzero"` // ICU style C locale (e.g. "en_US"). If not specified or empty, disables the override and restores default host system locale.
}
SetLocaleOverrideParams are the parameters of the command Emulation.setLocaleOverride.
type SetPageScaleFactorParams ¶
type SetPageScaleFactorParams struct {
PageScaleFactor float64 `json:"pageScaleFactor"` // Page scale factor.
}
SetPageScaleFactorParams are the parameters of the command Emulation.setPageScaleFactor.
type SetPressureSourceOverrideEnabledParams ¶
type SetPressureSourceOverrideEnabledParams struct {
Enabled bool `json:"enabled"`
Source PressureSource `json:"source"`
Metadata *PressureMetadata `json:"metadata,omitempty,omitzero"`
}
SetPressureSourceOverrideEnabledParams are the parameters of the command Emulation.setPressureSourceOverrideEnabled.
type SetPressureStateOverrideParams ¶
type SetPressureStateOverrideParams struct {
Source PressureSource `json:"source"`
State PressureState `json:"state"`
}
SetPressureStateOverrideParams are the parameters of the command Emulation.setPressureStateOverride.
type SetPrimaryScreenParams ¶
type SetPrimaryScreenParams struct {
ScreenID ScreenID `json:"screenId"`
}
SetPrimaryScreenParams are the parameters of the command Emulation.setPrimaryScreen.
type SetSafeAreaInsetsOverrideParams ¶
type SetSafeAreaInsetsOverrideParams struct {
Insets *SafeAreaInsets `json:"insets"`
}
SetSafeAreaInsetsOverrideParams are the parameters of the command Emulation.setSafeAreaInsetsOverride.
type SetScriptExecutionDisabledParams ¶
type SetScriptExecutionDisabledParams struct {
Value bool `json:"value"` // Whether script execution should be disabled in the page.
}
SetScriptExecutionDisabledParams are the parameters of the command Emulation.setScriptExecutionDisabled.
type SetScrollbarsHiddenParams ¶
type SetScrollbarsHiddenParams struct {
Hidden bool `json:"hidden"` // Whether scrollbars should be always hidden.
}
SetScrollbarsHiddenParams are the parameters of the command Emulation.setScrollbarsHidden.
type SetSensorOverrideEnabledParams ¶
type SetSensorOverrideEnabledParams struct {
Enabled bool `json:"enabled"`
Type SensorType `json:"type"`
Metadata *SensorMetadata `json:"metadata,omitempty,omitzero"`
}
SetSensorOverrideEnabledParams are the parameters of the command Emulation.setSensorOverrideEnabled.
type SetSensorOverrideReadingsParams ¶
type SetSensorOverrideReadingsParams struct {
Type SensorType `json:"type"`
Reading *SensorReading `json:"reading"`
}
SetSensorOverrideReadingsParams are the parameters of the command Emulation.setSensorOverrideReadings.
type SetSmallViewportHeightDifferenceOverrideParams ¶
type SetSmallViewportHeightDifferenceOverrideParams struct {
Difference int64 `json:"difference"` // This will cause an element of size 100svh to be difference pixels smaller than an element of size 100lvh.
}
SetSmallViewportHeightDifferenceOverrideParams are the parameters of the command Emulation.setSmallViewportHeightDifferenceOverride.
type SetTimezoneOverrideParams ¶
type SetTimezoneOverrideParams struct {
TimezoneID string `json:"timezoneId"` // The timezone identifier. List of supported timezones: https://source.chromium.org/chromium/chromium/deps/icu.git/+/faee8bc70570192d82d2978a71e2a615788597d1:source/data/misc/metaZones.txt If empty, disables the override and restores default host system timezone.
}
SetTimezoneOverrideParams are the parameters of the command Emulation.setTimezoneOverride.
type SetTouchEmulationEnabledParams ¶
type SetTouchEmulationEnabledParams struct {
Enabled bool `json:"enabled"` // Whether the touch event emulation should be enabled.
MaxTouchPoints int64 `json:"maxTouchPoints,omitempty,omitzero"` // Maximum touch points supported. Defaults to one.
}
SetTouchEmulationEnabledParams are the parameters of the command Emulation.setTouchEmulationEnabled.
type SetUserAgentOverrideParams ¶
type SetUserAgentOverrideParams struct {
UserAgent string `json:"userAgent"` // User agent to use.
AcceptLanguage string `json:"acceptLanguage,omitempty,omitzero"` // Browser language to emulate.
Platform string `json:"platform,omitempty,omitzero"` // The platform navigator.platform should return.
UserAgentMetadata *UserAgentMetadata `json:"userAgentMetadata,omitempty,omitzero"` // To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData
}
SetUserAgentOverrideParams are the parameters of the command Emulation.setUserAgentOverride.
type SetVirtualKeyboardGeometryOverrideParams ¶
type SetVirtualKeyboardGeometryOverrideParams struct {
KeyboardRect *dom.Rect `json:"keyboardRect,omitempty,omitzero"`
}
SetVirtualKeyboardGeometryOverrideParams are the parameters of the command Emulation.setVirtualKeyboardGeometryOverride.
type SetVirtualTimePolicyParams ¶
type SetVirtualTimePolicyParams struct {
Policy VirtualTimePolicy `json:"policy"`
Budget *float64 `json:"budget,omitempty,omitzero"` // If set, after this many virtual milliseconds have elapsed virtual time will be paused and a virtualTimeBudgetExpired event is sent.
MaxVirtualTimeTaskStarvationCount int64 `json:"maxVirtualTimeTaskStarvationCount,omitempty,omitzero"` // If set this specifies the maximum number of tasks that can be run before virtual is forced forwards to prevent deadlock.
InitialVirtualTime cdp.TimeSinceEpoch `json:"initialVirtualTime,omitempty,omitzero"` // If set, base::Time::Now will be overridden to initially return this value.
}
SetVirtualTimePolicyParams are the parameters of the command Emulation.setVirtualTimePolicy.
type SetVirtualTimePolicyResult ¶ added in v0.157.3
type SetVirtualTimePolicyResult struct {
VirtualTimeTicksBase float64 `json:"virtualTimeTicksBase,omitempty,omitzero"` // Absolute timestamp at which virtual time was first enabled (up time in milliseconds).
}
SetVirtualTimePolicyResult is the result of the command Emulation.setVirtualTimePolicy.
type UpdateScreenParams ¶
type UpdateScreenParams struct {
ScreenID ScreenID `json:"screenId"` // Target screen identifier.
Left *int64 `json:"left,omitempty,omitzero"` // Offset of the left edge of the screen in pixels.
Top *int64 `json:"top,omitempty,omitzero"` // Offset of the top edge of the screen in pixels.
Width int64 `json:"width,omitempty,omitzero"` // The width of the screen in pixels.
Height int64 `json:"height,omitempty,omitzero"` // The height of the screen in pixels.
WorkAreaInsets *WorkAreaInsets `json:"workAreaInsets,omitempty,omitzero"` // Specifies the screen's work area.
DevicePixelRatio float64 `json:"devicePixelRatio,omitempty,omitzero"` // Specifies the screen's device pixel ratio.
Rotation *int64 `json:"rotation,omitempty,omitzero"` // Specifies the screen's rotation angle. Available values are 0, 90, 180 and 270.
ColorDepth int64 `json:"colorDepth,omitempty,omitzero"` // Specifies the screen's color depth in bits.
Label string `json:"label,omitempty,omitzero"` // Specifies the descriptive label for the screen.
IsInternal *bool `json:"isInternal,omitempty,omitzero"` // Indicates whether the screen is internal to the device or external, attached to the device. Default is false.
}
UpdateScreenParams are the parameters of the command Emulation.updateScreen.
type UpdateScreenResult ¶ added in v0.157.3
type UpdateScreenResult struct {
ScreenInfo *ScreenInfo `json:"screenInfo,omitempty,omitzero"`
}
UpdateScreenResult is the result of the command Emulation.updateScreen.
type UserAgentBrandVersion ¶
UserAgentBrandVersion used to specify User Agent Client Hints to emulate. See https://wicg.github.io/ua-client-hints.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#type-UserAgentBrandVersion
type UserAgentMetadata ¶
type UserAgentMetadata struct {
Brands []*UserAgentBrandVersion `json:"brands,omitempty,omitzero"` // Brands appearing in Sec-CH-UA.
FullVersionList []*UserAgentBrandVersion `json:"fullVersionList,omitempty,omitzero"` // Brands appearing in Sec-CH-UA-Full-Version-List.
Platform string `json:"platform"`
PlatformVersion string `json:"platformVersion"`
Architecture string `json:"architecture"`
Model string `json:"model"`
Mobile bool `json:"mobile"`
Bitness string `json:"bitness,omitempty,omitzero"`
Wow64 bool `json:"wow64"`
FormFactors []string `json:"formFactors,omitempty,omitzero"` // Used to specify User Agent form-factor values. See https://wicg.github.io/ua-client-hints/#sec-ch-ua-form-factors
}
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.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#type-UserAgentMetadata
type VirtualTimePolicy ¶
type VirtualTimePolicy string
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.
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#type-VirtualTimePolicy
const ( VirtualTimePolicyAdvance VirtualTimePolicy = "advance" VirtualTimePolicyPause VirtualTimePolicy = "pause" VirtualTimePolicyPauseIfNetworkFetchesPending VirtualTimePolicy = "pauseIfNetworkFetchesPending" )
VirtualTimePolicy values.
func (VirtualTimePolicy) String ¶
func (t VirtualTimePolicy) String() string
String returns the VirtualTimePolicy as string value.
type WorkAreaInsets ¶
type WorkAreaInsets struct {
Top int64 `json:"top,omitempty,omitzero"` // Work area top inset in pixels. Default is 0;
Left int64 `json:"left,omitempty,omitzero"` // Work area left inset in pixels. Default is 0;
Bottom int64 `json:"bottom,omitempty,omitzero"` // Work area bottom inset in pixels. Default is 0;
Right int64 `json:"right,omitempty,omitzero"` // Work area right inset in pixels. Default is 0;
}
WorkAreaInsets [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#type-WorkAreaInsets