Documentation
¶
Overview ¶
Package emulation provides type definitions for use with the Chrome Emulation protocol
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/
Index ¶
- Variables
- type CanEmulateResult
- type ClearDeviceMetricsOverrideResult
- type ClearGeolocationOverrideResult
- type ConfigurationEnum
- type OrientationTypeEnum
- type ResetPageScaleFactorResult
- type ScreenOrientation
- type SetCPUThrottlingRateParams
- type SetCPUThrottlingRateResult
- type SetDefaultBackgroundColorOverrideParams
- type SetDefaultBackgroundColorOverrideResult
- type SetDeviceMetricsOverrideParams
- type SetDeviceMetricsOverrideResult
- type SetEmitTouchEventsForMouseParams
- type SetEmitTouchEventsForMouseResult
- type SetEmulatedMediaParams
- type SetEmulatedMediaResult
- type SetGeolocationOverrideParams
- type SetGeolocationOverrideResult
- type SetNavigatorOverridesParams
- type SetNavigatorOverridesResult
- type SetPageScaleFactorParams
- type SetPageScaleFactorResult
- type SetScriptExecutionDisabledParams
- type SetScriptExecutionDisabledResult
- type SetTouchEmulationEnabledParams
- type SetTouchEmulationEnabledResult
- type SetVirtualTimePolicyParams
- type SetVirtualTimePolicyResult
- type SetVisibleSizeParams
- type SetVisibleSizeResult
- type VirtualTimeAdvancedEvent
- type VirtualTimeBudgetExpiredEvent
- type VirtualTimePausedEvent
- type VirtualTimePolicy
Constants ¶
This section is empty.
Variables ¶
var Configuration = configurationEnum{
Mobile: configurationMobile,
Desktop: configurationDesktop,
}
Configuration provides named acces to the ConfigurationEnum values.
var OrientationType = orientationTypeEnum{
PortraitPrimary: orientationTypePortraitPrimary,
PortraitSecondary: orientationTypePortraitSecondary,
LandscapePrimary: orientationTypeLandscapePrimary,
LandscapeSecondary: orientationTypeLandscapeSecondary,
}
OrientationType provides named acces to the OrientationTypeEnum values.
Functions ¶
This section is empty.
Types ¶
type CanEmulateResult ¶
type CanEmulateResult struct {
// True if emulation is supported.
Result bool `json:"result"`
// Error information related to executing this method
Err error `json:"-"`
}
CanEmulateResult represents the result of calls to Emulation.canEmulate.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-canEmulate
type ClearDeviceMetricsOverrideResult ¶
type ClearDeviceMetricsOverrideResult struct {
// Error information related to executing this method
Err error `json:"-"`
}
ClearDeviceMetricsOverrideResult represents the result of calls to Emulation.clearDeviceMetricsOverride.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-clearDeviceMetricsOverride
type ClearGeolocationOverrideResult ¶
type ClearGeolocationOverrideResult struct {
// Error information related to executing this method
Err error `json:"-"`
}
ClearGeolocationOverrideResult represents the result of calls to Emulation.clearGeolocationOverride.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-clearGeolocationOverride
type ConfigurationEnum ¶
type ConfigurationEnum int
ConfigurationEnum is optional. Touch/gesture events configuration. Default: current platform. Allowed values:
- Configuration.Mobile "mobile"
- Configuration.Desktop "desktop"
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#type-ScreenOrientation
func (ConfigurationEnum) MarshalJSON ¶
func (enum ConfigurationEnum) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler
func (ConfigurationEnum) String ¶
func (enum ConfigurationEnum) String() string
String implements Stringer
func (*ConfigurationEnum) UnmarshalJSON ¶
func (enum *ConfigurationEnum) UnmarshalJSON(bytes []byte) error
UnmarshalJSON implements json.Unmarshaler
type OrientationTypeEnum ¶
type OrientationTypeEnum int
OrientationTypeEnum represents the orientation type. Allowed values:
- OrientationType.PortraitPrimary "portraitPrimary"
- OrientationType.PortraitSecondary "portraitSecondary"
- OrientationType.LandscapePrimary "landscapePrimary"
- OrientationType.LandscapeSecondary "landscapeSecondary"
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#type-ScreenOrientation
func (OrientationTypeEnum) MarshalJSON ¶
func (enum OrientationTypeEnum) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler
func (OrientationTypeEnum) String ¶
func (enum OrientationTypeEnum) String() string
String implements Stringer
func (*OrientationTypeEnum) UnmarshalJSON ¶
func (enum *OrientationTypeEnum) UnmarshalJSON(bytes []byte) error
UnmarshalJSON implements json.Unmarshaler
type ResetPageScaleFactorResult ¶
type ResetPageScaleFactorResult struct {
// Error information related to executing this method
Err error `json:"-"`
}
ResetPageScaleFactorResult represents the result of calls to Emulation.resetPageScaleFactor.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-resetPageScaleFactor
type ScreenOrientation ¶
type ScreenOrientation struct {
// Orientation type. Allowed values:
// - OrientationType.PortraitPrimary
// - OrientationType.PortraitSecondary
// - OrientationType.LandscapePrimary
// - OrientationType.LandscapeSecondary
Type OrientationTypeEnum `json:"type"`
// Orientation angle.
Angle int `json:"angle"`
}
ScreenOrientation represents a screen orientation.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#type-ScreenOrientation
type SetCPUThrottlingRateParams ¶
type SetCPUThrottlingRateParams struct {
// Throttling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc).
Rate int64 `json:"rate"`
}
SetCPUThrottlingRateParams represents Emulation.setCPUThrottlingRate parameters.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setCPUThrottlingRate
type SetCPUThrottlingRateResult ¶
type SetCPUThrottlingRateResult struct {
// Error information related to executing this method
Err error `json:"-"`
}
SetCPUThrottlingRateResult represents the result of calls to Emulation.setCPUThrottlingRate.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setCPUThrottlingRate
type SetDefaultBackgroundColorOverrideParams ¶
type SetDefaultBackgroundColorOverrideParams struct {
// Optional. RGBA of the default background color. If not specified, any
// existing override will be cleared.
Color *dom.RGBA `json:"color,omitempty"`
}
SetDefaultBackgroundColorOverrideParams represents Emulation.setDefaultBackgroundColorOverride parameters.
type SetDefaultBackgroundColorOverrideResult ¶
type SetDefaultBackgroundColorOverrideResult struct {
// Error information related to executing this method
Err error `json:"-"`
}
SetDefaultBackgroundColorOverrideResult represents the result of calls to Emulation.setDefaultBackgroundColorOverride.
type SetDeviceMetricsOverrideParams ¶
type SetDeviceMetricsOverrideParams struct {
// Overriding width value in pixels (minimum 0, maximum 10000000). 0
// disables the override.
Width int `json:"width"`
// Overriding height value in pixels (minimum 0, maximum 10000000). 0
// disables the override.
Height int `json:"height"`
// Overriding device scale factor value. 0 disables the override.
DeviceScaleFactor float64 `json:"deviceScaleFactor"`
// Whether to emulate mobile device. This includes viewport meta tag,
// overlay scrollbars, text autosizing and more.
Mobile bool `json:"mobile"`
// Optional. Scale to apply to resulting view image. EXPERIMENTAL
Scale int `json:"scale,omitempty"`
// Optional. Overriding screen width value in pixels (minimum 0, maximum
// 10000000). EXPERIMENTAL.
ScreenWidth int `json:"screenWidth,omitempty"`
// Optional. Overriding screen height value in pixels (minimum 0, maximum
// 10000000). EXPERIMENTAL.
ScreenHeight int `json:"screenHeight,omitempty"`
// Optional. Overriding view X position on screen in pixels (minimum 0,
// maximum 10000000). EXPERIMENTAL.
PositionX int `json:"positionX,omitempty"`
// Optional. Overriding view Y position on screen in pixels (minimum 0,
// maximum 10000000). EXPERIMENTAL.
PositionY int `json:"positionY,omitempty"`
// Optional. Do not set visible view size, rely upon explicit setVisibleSize
// call. EXPERIMENTAL.
DontSetVisibleSize bool `json:"dontSetVisibleSize,omitempty"`
// Optional. Screen orientation override.
ScreenOrientation *ScreenOrientation `json:"screenOrientation,omitempty"`
// Optional. 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. EXPERIMENTAL.
Viewport *page.Viewport `json:"viewport,omitempty"`
}
SetDeviceMetricsOverrideParams represents Emulation.setDeviceMetricsOverride parameters.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setDeviceMetricsOverride
type SetDeviceMetricsOverrideResult ¶
type SetDeviceMetricsOverrideResult struct {
// Error information related to executing this method
Err error `json:"-"`
}
SetDeviceMetricsOverrideResult represents the result of calls to Emulation.setDeviceMetricsOverride.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setDeviceMetricsOverride
type SetEmitTouchEventsForMouseParams ¶
type SetEmitTouchEventsForMouseParams struct {
// Whether touch emulation based on mouse input should be enabled.
Enabled bool `json:"enabled"`
// Optional. Touch/gesture events configuration. Default: current platform.
// Allowed values:
// - mobile
// - desktop
Configuration ConfigurationEnum `json:"configuration,omitempty"`
}
SetEmitTouchEventsForMouseParams represents Emulation.setEmitTouchEventsForMouse parameters.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setEmitTouchEventsForMouse
type SetEmitTouchEventsForMouseResult ¶
type SetEmitTouchEventsForMouseResult struct {
// Error information related to executing this method
Err error `json:"-"`
}
SetEmitTouchEventsForMouseResult represents the result of calls to Emulation.setEmitTouchEventsForMouse.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setEmitTouchEventsForMouse
type SetEmulatedMediaParams ¶
type SetEmulatedMediaParams struct {
// Media type to emulate. Empty string disables the override.
Media string `json:"media"`
}
SetEmulatedMediaParams represents Emulation.setEmulatedMedia parameters.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setEmulatedMedia
type SetEmulatedMediaResult ¶
type SetEmulatedMediaResult struct {
// Error information related to executing this method
Err error `json:"-"`
}
SetEmulatedMediaResult represents the result of calls to Emulation.setEmulatedMedia.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setEmulatedMedia
type SetGeolocationOverrideParams ¶
type SetGeolocationOverrideParams struct {
// Optional. Mock latitude.
Latitude int `json:"latitude,omitempty"`
// Optional. Mock longitude.
Longitude int `json:"longitude,omitempty"`
// Optional. Mock accuracy.
Accuracy int `json:"accuracy,omitempty"`
}
SetGeolocationOverrideParams represents Emulation.setGeolocationOverride parameters.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setGeolocationOverride
type SetGeolocationOverrideResult ¶
type SetGeolocationOverrideResult struct {
// Error information related to executing this method
Err error `json:"-"`
}
SetGeolocationOverrideResult represents the result of calls to Emulation.setGeolocationOverride.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setGeolocationOverride
type SetNavigatorOverridesParams ¶
type SetNavigatorOverridesParams struct {
Platform string `json:"platform"`
}
SetNavigatorOverridesParams represents Emulation.setNavigatorOverrides parameters.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setNavigatorOverrides
type SetNavigatorOverridesResult ¶
type SetNavigatorOverridesResult struct {
Err error `json:"-"`
}
SetNavigatorOverridesResult represents the result of calls to Emulation.setNavigatorOverrides.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setNavigatorOverrides
type SetPageScaleFactorParams ¶
type SetPageScaleFactorParams struct {
// Page scale factor.
PageScaleFactor int `json:"pageScaleFactor"`
}
SetPageScaleFactorParams represents Emulation.setPageScaleFactor parameters.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setPageScaleFactor
type SetPageScaleFactorResult ¶
type SetPageScaleFactorResult struct {
// Error information related to executing this method
Err error `json:"-"`
}
SetPageScaleFactorResult represents the result of calls to Emulation.setPageScaleFactor.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setPageScaleFactor
type SetScriptExecutionDisabledParams ¶
type SetScriptExecutionDisabledParams struct {
// Whether script execution should be disabled in the page.
Value bool `json:"value"`
}
SetScriptExecutionDisabledParams represents Emulation.setScriptExecutionDisabled parameters.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setScriptExecutionDisabled
type SetScriptExecutionDisabledResult ¶
type SetScriptExecutionDisabledResult struct {
// Error information related to executing this method
Err error `json:"-"`
}
SetScriptExecutionDisabledResult represents the result of calls to Emulation.setScriptExecutionDisabled.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setScriptExecutionDisabled
type SetTouchEmulationEnabledParams ¶
type SetTouchEmulationEnabledParams struct {
// Whether the touch event emulation should be enabled.
Enabled bool `json:"enabled"`
// Optional. Maximum touch points supported. Defaults to one.
MaxTouchPoints int `json:"maxTouchPoints,omitempty"`
}
SetTouchEmulationEnabledParams represents Emulation.setTouchEmulationEnabled parameters.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setTouchEmulationEnabled
type SetTouchEmulationEnabledResult ¶
type SetTouchEmulationEnabledResult struct {
// Error information related to executing this method
Err error `json:"-"`
}
SetTouchEmulationEnabledResult represents the result of calls to Emulation.setTouchEmulationEnabled.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setTouchEmulationEnabled
type SetVirtualTimePolicyParams ¶
type SetVirtualTimePolicyParams struct {
// desc.
Policy VirtualTimePolicy `json:"policy"`
// Optional. If set, after this many virtual milliseconds have elapsed
// virtual time will be paused and a virtualTimeBudgetExpired event is sent.
Budget int `json:"budget,omitempty"`
// Optional. If set this specifies the maximum number of tasks that can be
// run before virtual is forced forwards to prevent deadlock.
MaxVirtualTimeTaskStarvationCount int `json:"maxVirtualTimeTaskStarvationCount,omitempty"`
}
SetVirtualTimePolicyParams represents Emulation.setVirtualTimePolicy parameters.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setVirtualTimePolicy
type SetVirtualTimePolicyResult ¶
type SetVirtualTimePolicyResult struct {
// Absolute timestamp at which virtual time was first enabled (milliseconds
// since epoch).
VirtualTimeBase runtime.Timestamp `json:"virtualTimeBase"`
// Error information related to executing this method
Err error `json:"-"`
}
SetVirtualTimePolicyResult represents the result of calls to Emulation.setVirtualTimePolicy.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setVirtualTimePolicy
type SetVisibleSizeParams ¶
type SetVisibleSizeParams struct {
// Frame width (DIP).
Width int `json:"width"`
// Frame height (DIP).
Height int `json:"height"`
}
SetVisibleSizeParams represents Emulation.setVisibleSize parameters.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setVisibleSize
type SetVisibleSizeResult ¶
type SetVisibleSizeResult struct {
// Error information related to executing this method
Err error `json:"-"`
}
SetVisibleSizeResult represents the result of calls to Emulation.setVisibleSize.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setVisibleSize
type VirtualTimeAdvancedEvent ¶
type VirtualTimeAdvancedEvent struct {
// The amount of virtual time that has elapsed in milliseconds since virtual
// time was first enabled.
VirtualTimeElapsed int `json:"virtualTimeElapsed"`
// Error information related to this event
Err error `json:"-"`
}
VirtualTimeAdvancedEvent represents Emulation.virtualTimeAdvanced event data.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#event-virtualTimeAdvanced
type VirtualTimeBudgetExpiredEvent ¶
type VirtualTimeBudgetExpiredEvent struct {
// Error information related to this event
Err error `json:"-"`
}
VirtualTimeBudgetExpiredEvent represents Emulation.virtualTimeBudgetExpired event data.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#event-virtualTimeBudgetExpired
type VirtualTimePausedEvent ¶
type VirtualTimePausedEvent struct {
// The amount of virtual time that has elapsed in milliseconds since virtual
// time was first enabled.
VirtualTimeElapsed int `json:"virtualTimeElapsed"`
// Error information related to this event
Err error `json:"-"`
}
VirtualTimePausedEvent represents Emulation.virtualTimePaused event data.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#event-virtualTimePaused
type VirtualTimePolicy ¶
type VirtualTimePolicy string
VirtualTimePolicy is the time policy
- 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.
EXPERIMENTAL
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#type-VirtualTimePolicy