Documentation ¶
Overview ¶
Package emulation implements the Emulation domain. This domain emulates different environments for the page.
Index ¶
- func NewClient(conn *rpcc.Conn) *domainClient
- type CanEmulateReply
- type DevicePosture
- type DisabledImageType
- type DisplayFeature
- type GetOverriddenSensorInformationArgs
- type GetOverriddenSensorInformationReply
- type MediaFeature
- type PressureMetadata
- type PressureSource
- type PressureState
- type ScreenOrientation
- type SensorMetadata
- type SensorReading
- type SensorReadingQuaternion
- type SensorReadingSingle
- type SensorReadingXYZ
- type SensorType
- type SetAutoDarkModeOverrideArgs
- type SetAutomationOverrideArgs
- type SetCPUThrottlingRateArgs
- type SetDefaultBackgroundColorOverrideArgs
- type SetDeviceMetricsOverrideArgs
- func (a *SetDeviceMetricsOverrideArgs) SetDevicePosture(devicePosture DevicePosture) *SetDeviceMetricsOverrideArgsdeprecated
- func (a *SetDeviceMetricsOverrideArgs) SetDisplayFeature(displayFeature DisplayFeature) *SetDeviceMetricsOverrideArgs
- func (a *SetDeviceMetricsOverrideArgs) SetDontSetVisibleSize(dontSetVisibleSize bool) *SetDeviceMetricsOverrideArgs
- func (a *SetDeviceMetricsOverrideArgs) SetPositionX(positionX int) *SetDeviceMetricsOverrideArgs
- func (a *SetDeviceMetricsOverrideArgs) SetPositionY(positionY int) *SetDeviceMetricsOverrideArgs
- func (a *SetDeviceMetricsOverrideArgs) SetScale(scale float64) *SetDeviceMetricsOverrideArgs
- func (a *SetDeviceMetricsOverrideArgs) SetScreenHeight(screenHeight int) *SetDeviceMetricsOverrideArgs
- func (a *SetDeviceMetricsOverrideArgs) SetScreenOrientation(screenOrientation ScreenOrientation) *SetDeviceMetricsOverrideArgs
- func (a *SetDeviceMetricsOverrideArgs) SetScreenWidth(screenWidth int) *SetDeviceMetricsOverrideArgs
- func (a *SetDeviceMetricsOverrideArgs) SetViewport(viewport page.Viewport) *SetDeviceMetricsOverrideArgs
- type SetDevicePostureOverrideArgs
- type SetDisabledImageTypesArgs
- type SetDocumentCookieDisabledArgs
- type SetEmitTouchEventsForMouseArgs
- type SetEmulatedMediaArgs
- type SetEmulatedVisionDeficiencyArgs
- type SetFocusEmulationEnabledArgs
- type SetGeolocationOverrideArgs
- type SetHardwareConcurrencyOverrideArgs
- type SetIdleOverrideArgs
- type SetLocaleOverrideArgs
- type SetNavigatorOverridesArgs
- type SetPageScaleFactorArgs
- type SetPressureSourceOverrideEnabledArgs
- type SetPressureStateOverrideArgs
- type SetScriptExecutionDisabledArgs
- type SetScrollbarsHiddenArgs
- type SetSensorOverrideEnabledArgs
- type SetSensorOverrideReadingsArgs
- type SetTimezoneOverrideArgs
- type SetTouchEmulationEnabledArgs
- type SetUserAgentOverrideArgs
- func (a *SetUserAgentOverrideArgs) SetAcceptLanguage(acceptLanguage string) *SetUserAgentOverrideArgs
- func (a *SetUserAgentOverrideArgs) SetPlatform(platform string) *SetUserAgentOverrideArgs
- func (a *SetUserAgentOverrideArgs) SetUserAgentMetadata(userAgentMetadata UserAgentMetadata) *SetUserAgentOverrideArgs
- type SetVirtualTimePolicyArgs
- func (a *SetVirtualTimePolicyArgs) SetBudget(budget float64) *SetVirtualTimePolicyArgs
- func (a *SetVirtualTimePolicyArgs) SetInitialVirtualTime(initialVirtualTime network.TimeSinceEpoch) *SetVirtualTimePolicyArgs
- func (a *SetVirtualTimePolicyArgs) SetMaxVirtualTimeTaskStarvationCount(maxVirtualTimeTaskStarvationCount int) *SetVirtualTimePolicyArgs
- type SetVirtualTimePolicyReply
- type SetVisibleSizeArgs
- type UserAgentBrandVersion
- type UserAgentMetadata
- type VirtualTimeBudgetExpiredClient
- type VirtualTimeBudgetExpiredReply
- type VirtualTimePolicy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CanEmulateReply ¶
type CanEmulateReply struct {
Result bool `json:"result"` // True if emulation is supported.
}
CanEmulateReply represents the return values for CanEmulate in the Emulation domain.
type DevicePosture ¶ added in v0.35.0
type DevicePosture struct { // Type Current posture of the device // // Values: "continuous", "folded". Type string `json:"type"` }
DevicePosture
type DisabledImageType ¶ added in v0.31.0
type DisabledImageType string
DisabledImageType Enum of image types that can be disabled.
Note: This type is experimental.
const ( DisabledImageTypeNotSet DisabledImageType = "" DisabledImageTypeAVIF DisabledImageType = "avif" DisabledImageTypeWEBP DisabledImageType = "webp" )
DisabledImageType as enums.
func (DisabledImageType) String ¶ added in v0.31.0
func (e DisabledImageType) String() string
func (DisabledImageType) Valid ¶ added in v0.31.0
func (e DisabledImageType) Valid() bool
type DisplayFeature ¶ added in v0.31.0
type DisplayFeature struct { // Orientation Orientation of a display feature in relation to screen // // Values: "vertical", "horizontal". Orientation string `json:"orientation"` Offset int `json:"offset"` // The offset from the screen origin in either the x (for vertical orientation) or y (for horizontal orientation) direction. MaskLength int `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
type GetOverriddenSensorInformationArgs ¶ added in v0.35.0
type GetOverriddenSensorInformationArgs struct {
Type SensorType `json:"type"` // No description.
}
GetOverriddenSensorInformationArgs represents the arguments for GetOverriddenSensorInformation in the Emulation domain.
func NewGetOverriddenSensorInformationArgs ¶ added in v0.35.0
func NewGetOverriddenSensorInformationArgs(typ SensorType) *GetOverriddenSensorInformationArgs
NewGetOverriddenSensorInformationArgs initializes GetOverriddenSensorInformationArgs with the required arguments.
type GetOverriddenSensorInformationReply ¶ added in v0.35.0
type GetOverriddenSensorInformationReply struct {
RequestedSamplingFrequency float64 `json:"requestedSamplingFrequency"` // No description.
}
GetOverriddenSensorInformationReply represents the return values for GetOverriddenSensorInformation in the Emulation domain.
type MediaFeature ¶ added in v0.25.0
type MediaFeature struct { Name string `json:"name"` // No description. Value string `json:"value"` // No description. }
MediaFeature
type PressureMetadata ¶ added in v0.35.0
type PressureMetadata struct {
Available *bool `json:"available,omitempty"` // No description.
}
PressureMetadata
Note: This type is experimental.
type PressureSource ¶ added in v0.35.0
type PressureSource string
PressureSource
Note: This type is experimental.
const ( PressureSourceNotSet PressureSource = "" PressureSourceCPU PressureSource = "cpu" )
PressureSource as enums.
func (PressureSource) String ¶ added in v0.35.0
func (e PressureSource) String() string
func (PressureSource) Valid ¶ added in v0.35.0
func (e PressureSource) Valid() bool
type PressureState ¶ added in v0.35.0
type PressureState string
PressureState
Note: This type is experimental.
const ( PressureStateNotSet PressureState = "" PressureStateNominal PressureState = "nominal" PressureStateFair PressureState = "fair" PressureStateSerious PressureState = "serious" PressureStateCritical PressureState = "critical" )
PressureState as enums.
func (PressureState) String ¶ added in v0.35.0
func (e PressureState) String() string
func (PressureState) Valid ¶ added in v0.35.0
func (e PressureState) Valid() bool
type ScreenOrientation ¶
type ScreenOrientation struct { // Type Orientation type. // // Values: "portraitPrimary", "portraitSecondary", "landscapePrimary", "landscapeSecondary". Type string `json:"type"` Angle int `json:"angle"` // Orientation angle. }
ScreenOrientation Screen orientation.
type SensorMetadata ¶ added in v0.35.0
type SensorMetadata struct { Available *bool `json:"available,omitempty"` // No description. MinimumFrequency *float64 `json:"minimumFrequency,omitempty"` // No description. MaximumFrequency *float64 `json:"maximumFrequency,omitempty"` // No description. }
SensorMetadata
Note: This type is experimental.
type SensorReading ¶ added in v0.35.0
type SensorReading struct { Single *SensorReadingSingle `json:"single,omitempty"` // No description. Xyz *SensorReadingXYZ `json:"xyz,omitempty"` // No description. Quaternion *SensorReadingQuaternion `json:"quaternion,omitempty"` // No description. }
SensorReading
Note: This type is experimental.
type SensorReadingQuaternion ¶ added in v0.35.0
type SensorReadingQuaternion struct { X float64 `json:"x"` // No description. Y float64 `json:"y"` // No description. Z float64 `json:"z"` // No description. W float64 `json:"w"` // No description. }
SensorReadingQuaternion
Note: This type is experimental.
type SensorReadingSingle ¶ added in v0.35.0
type SensorReadingSingle struct {
Value float64 `json:"value"` // No description.
}
SensorReadingSingle
Note: This type is experimental.
type SensorReadingXYZ ¶ added in v0.35.0
type SensorReadingXYZ struct { X float64 `json:"x"` // No description. Y float64 `json:"y"` // No description. Z float64 `json:"z"` // No description. }
SensorReadingXYZ
Note: This type is experimental.
type SensorType ¶ added in v0.35.0
type SensorType string
SensorType Used to specify sensor types to emulate. See https://w3c.github.io/sensors/#automation for more information.
Note: This type is experimental.
const ( SensorTypeNotSet SensorType = "" SensorTypeAbsoluteOrientation SensorType = "absolute-orientation" SensorTypeAccelerometer SensorType = "accelerometer" SensorTypeAmbientLight SensorType = "ambient-light" SensorTypeGravity SensorType = "gravity" SensorTypeGyroscope SensorType = "gyroscope" SensorTypeLinearAcceleration SensorType = "linear-acceleration" SensorTypeMagnetometer SensorType = "magnetometer" SensorTypeProximity SensorType = "proximity" SensorTypeRelativeOrientation SensorType = "relative-orientation" )
SensorType as enums.
func (SensorType) String ¶ added in v0.35.0
func (e SensorType) String() string
func (SensorType) Valid ¶ added in v0.35.0
func (e SensorType) Valid() bool
type SetAutoDarkModeOverrideArgs ¶ added in v0.33.0
type SetAutoDarkModeOverrideArgs struct {
Enabled *bool `json:"enabled,omitempty"` // Whether to enable or disable automatic dark mode. If not specified, any existing override will be cleared.
}
SetAutoDarkModeOverrideArgs represents the arguments for SetAutoDarkModeOverride in the Emulation domain.
func NewSetAutoDarkModeOverrideArgs ¶ added in v0.33.0
func NewSetAutoDarkModeOverrideArgs() *SetAutoDarkModeOverrideArgs
NewSetAutoDarkModeOverrideArgs initializes SetAutoDarkModeOverrideArgs with the required arguments.
func (*SetAutoDarkModeOverrideArgs) SetEnabled ¶ added in v0.33.0
func (a *SetAutoDarkModeOverrideArgs) SetEnabled(enabled bool) *SetAutoDarkModeOverrideArgs
SetEnabled sets the Enabled optional argument. Whether to enable or disable automatic dark mode. If not specified, any existing override will be cleared.
type SetAutomationOverrideArgs ¶ added in v0.33.0
type SetAutomationOverrideArgs struct {
Enabled bool `json:"enabled"` // Whether the override should be enabled.
}
SetAutomationOverrideArgs represents the arguments for SetAutomationOverride in the Emulation domain.
func NewSetAutomationOverrideArgs ¶ added in v0.33.0
func NewSetAutomationOverrideArgs(enabled bool) *SetAutomationOverrideArgs
NewSetAutomationOverrideArgs initializes SetAutomationOverrideArgs with the required arguments.
type SetCPUThrottlingRateArgs ¶
type SetCPUThrottlingRateArgs struct {
Rate float64 `json:"rate"` // Throttling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc).
}
SetCPUThrottlingRateArgs represents the arguments for SetCPUThrottlingRate in the Emulation domain.
func NewSetCPUThrottlingRateArgs ¶
func NewSetCPUThrottlingRateArgs(rate float64) *SetCPUThrottlingRateArgs
NewSetCPUThrottlingRateArgs initializes SetCPUThrottlingRateArgs with the required arguments.
type SetDefaultBackgroundColorOverrideArgs ¶
type SetDefaultBackgroundColorOverrideArgs struct {
Color *dom.RGBA `json:"color,omitempty"` // RGBA of the default background color. If not specified, any existing override will be cleared.
}
SetDefaultBackgroundColorOverrideArgs represents the arguments for SetDefaultBackgroundColorOverride in the Emulation domain.
func NewSetDefaultBackgroundColorOverrideArgs ¶
func NewSetDefaultBackgroundColorOverrideArgs() *SetDefaultBackgroundColorOverrideArgs
NewSetDefaultBackgroundColorOverrideArgs initializes SetDefaultBackgroundColorOverrideArgs with the required arguments.
func (*SetDefaultBackgroundColorOverrideArgs) SetColor ¶
func (a *SetDefaultBackgroundColorOverrideArgs) SetColor(color dom.RGBA) *SetDefaultBackgroundColorOverrideArgs
SetColor sets the Color optional argument. RGBA of the default background color. If not specified, any existing override will be cleared.
type SetDeviceMetricsOverrideArgs ¶
type SetDeviceMetricsOverrideArgs struct { Width int `json:"width"` // Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override. Height int `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 Scale to apply to resulting view image. // // Note: This property is experimental. Scale *float64 `json:"scale,omitempty"` // ScreenWidth Overriding screen width value in pixels (minimum 0, // maximum 10000000). // // Note: This property is experimental. ScreenWidth *int `json:"screenWidth,omitempty"` // ScreenHeight Overriding screen height value in pixels (minimum 0, // maximum 10000000). // // Note: This property is experimental. ScreenHeight *int `json:"screenHeight,omitempty"` // PositionX Overriding view X position on screen in pixels (minimum // 0, maximum 10000000). // // Note: This property is experimental. PositionX *int `json:"positionX,omitempty"` // PositionY Overriding view Y position on screen in pixels (minimum // 0, maximum 10000000). // // Note: This property is experimental. PositionY *int `json:"positionY,omitempty"` // DontSetVisibleSize Do not set visible view size, rely upon explicit // setVisibleSize call. // // Note: This property is experimental. DontSetVisibleSize *bool `json:"dontSetVisibleSize,omitempty"` ScreenOrientation *ScreenOrientation `json:"screenOrientation,omitempty"` // Screen orientation override. // Viewport 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. // // Note: This property is experimental. Viewport *page.Viewport `json:"viewport,omitempty"` // DisplayFeature If set, the display feature of a multi-segment // screen. If not set, multi-segment support is turned-off. // // Note: This property is experimental. DisplayFeature *DisplayFeature `json:"displayFeature,omitempty"` // DevicePosture is deprecated. // // Deprecated: If set, the posture of a foldable device. If not set // the posture is set to continuous. Deprecated, use // Emulation.setDevicePostureOverride. // // Note: This property is experimental. DevicePosture *DevicePosture `json:"devicePosture,omitempty"` }
SetDeviceMetricsOverrideArgs represents the arguments for SetDeviceMetricsOverride in the Emulation domain.
func NewSetDeviceMetricsOverrideArgs ¶
func NewSetDeviceMetricsOverrideArgs(width int, height int, deviceScaleFactor float64, mobile bool) *SetDeviceMetricsOverrideArgs
NewSetDeviceMetricsOverrideArgs initializes SetDeviceMetricsOverrideArgs with the required arguments.
func (*SetDeviceMetricsOverrideArgs) SetDevicePosture
deprecated
added in
v0.35.0
func (a *SetDeviceMetricsOverrideArgs) SetDevicePosture(devicePosture DevicePosture) *SetDeviceMetricsOverrideArgs
SetDevicePosture sets the DevicePosture optional argument.
Deprecated: If set, the posture of a foldable device. If not set the posture is set to continuous. Deprecated, use Emulation.setDevicePostureOverride.
Note: This property is experimental.
func (*SetDeviceMetricsOverrideArgs) SetDisplayFeature ¶ added in v0.31.0
func (a *SetDeviceMetricsOverrideArgs) SetDisplayFeature(displayFeature DisplayFeature) *SetDeviceMetricsOverrideArgs
SetDisplayFeature sets the DisplayFeature optional argument. If set, the display feature of a multi-segment screen. If not set, multi-segment support is turned-off.
Note: This property is experimental.
func (*SetDeviceMetricsOverrideArgs) SetDontSetVisibleSize ¶ added in v0.9.1
func (a *SetDeviceMetricsOverrideArgs) SetDontSetVisibleSize(dontSetVisibleSize bool) *SetDeviceMetricsOverrideArgs
SetDontSetVisibleSize sets the DontSetVisibleSize optional argument. Do not set visible view size, rely upon explicit setVisibleSize call.
Note: This property is experimental.
func (*SetDeviceMetricsOverrideArgs) SetPositionX ¶
func (a *SetDeviceMetricsOverrideArgs) SetPositionX(positionX int) *SetDeviceMetricsOverrideArgs
SetPositionX sets the PositionX optional argument. Overriding view X position on screen in pixels (minimum 0, maximum 10000000).
Note: This property is experimental.
func (*SetDeviceMetricsOverrideArgs) SetPositionY ¶
func (a *SetDeviceMetricsOverrideArgs) SetPositionY(positionY int) *SetDeviceMetricsOverrideArgs
SetPositionY sets the PositionY optional argument. Overriding view Y position on screen in pixels (minimum 0, maximum 10000000).
Note: This property is experimental.
func (*SetDeviceMetricsOverrideArgs) SetScale ¶
func (a *SetDeviceMetricsOverrideArgs) SetScale(scale float64) *SetDeviceMetricsOverrideArgs
SetScale sets the Scale optional argument. Scale to apply to resulting view image.
Note: This property is experimental.
func (*SetDeviceMetricsOverrideArgs) SetScreenHeight ¶
func (a *SetDeviceMetricsOverrideArgs) SetScreenHeight(screenHeight int) *SetDeviceMetricsOverrideArgs
SetScreenHeight sets the ScreenHeight optional argument. Overriding screen height value in pixels (minimum 0, maximum 10000000).
Note: This property is experimental.
func (*SetDeviceMetricsOverrideArgs) SetScreenOrientation ¶
func (a *SetDeviceMetricsOverrideArgs) SetScreenOrientation(screenOrientation ScreenOrientation) *SetDeviceMetricsOverrideArgs
SetScreenOrientation sets the ScreenOrientation optional argument. Screen orientation override.
func (*SetDeviceMetricsOverrideArgs) SetScreenWidth ¶
func (a *SetDeviceMetricsOverrideArgs) SetScreenWidth(screenWidth int) *SetDeviceMetricsOverrideArgs
SetScreenWidth sets the ScreenWidth optional argument. Overriding screen width value in pixels (minimum 0, maximum 10000000).
Note: This property is experimental.
func (*SetDeviceMetricsOverrideArgs) SetViewport ¶ added in v0.14.1
func (a *SetDeviceMetricsOverrideArgs) SetViewport(viewport page.Viewport) *SetDeviceMetricsOverrideArgs
SetViewport sets the Viewport optional argument. 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.
Note: This property is experimental.
type SetDevicePostureOverrideArgs ¶ added in v0.35.0
type SetDevicePostureOverrideArgs struct {
Posture DevicePosture `json:"posture"` // No description.
}
SetDevicePostureOverrideArgs represents the arguments for SetDevicePostureOverride in the Emulation domain.
func NewSetDevicePostureOverrideArgs ¶ added in v0.35.0
func NewSetDevicePostureOverrideArgs(posture DevicePosture) *SetDevicePostureOverrideArgs
NewSetDevicePostureOverrideArgs initializes SetDevicePostureOverrideArgs with the required arguments.
type SetDisabledImageTypesArgs ¶ added in v0.31.0
type SetDisabledImageTypesArgs struct {
ImageTypes []DisabledImageType `json:"imageTypes"` // Image types to disable.
}
SetDisabledImageTypesArgs represents the arguments for SetDisabledImageTypes in the Emulation domain.
func NewSetDisabledImageTypesArgs ¶ added in v0.31.0
func NewSetDisabledImageTypesArgs(imageTypes []DisabledImageType) *SetDisabledImageTypesArgs
NewSetDisabledImageTypesArgs initializes SetDisabledImageTypesArgs with the required arguments.
type SetDocumentCookieDisabledArgs ¶ added in v0.18.4
type SetDocumentCookieDisabledArgs struct {
Disabled bool `json:"disabled"` // Whether document.coookie API should be disabled.
}
SetDocumentCookieDisabledArgs represents the arguments for SetDocumentCookieDisabled in the Emulation domain.
func NewSetDocumentCookieDisabledArgs ¶ added in v0.18.4
func NewSetDocumentCookieDisabledArgs(disabled bool) *SetDocumentCookieDisabledArgs
NewSetDocumentCookieDisabledArgs initializes SetDocumentCookieDisabledArgs with the required arguments.
type SetEmitTouchEventsForMouseArgs ¶ added in v0.11.1
type SetEmitTouchEventsForMouseArgs struct { Enabled bool `json:"enabled"` // Whether touch emulation based on mouse input should be enabled. // Configuration Touch/gesture events configuration. Default: current // platform. // // Values: "mobile", "desktop". Configuration *string `json:"configuration,omitempty"` }
SetEmitTouchEventsForMouseArgs represents the arguments for SetEmitTouchEventsForMouse in the Emulation domain.
func NewSetEmitTouchEventsForMouseArgs ¶ added in v0.11.1
func NewSetEmitTouchEventsForMouseArgs(enabled bool) *SetEmitTouchEventsForMouseArgs
NewSetEmitTouchEventsForMouseArgs initializes SetEmitTouchEventsForMouseArgs with the required arguments.
func (*SetEmitTouchEventsForMouseArgs) SetConfiguration ¶ added in v0.11.1
func (a *SetEmitTouchEventsForMouseArgs) SetConfiguration(configuration string) *SetEmitTouchEventsForMouseArgs
SetConfiguration sets the Configuration optional argument. Touch/gesture events configuration. Default: current platform.
Values: "mobile", "desktop".
type SetEmulatedMediaArgs ¶
type SetEmulatedMediaArgs struct { Media *string `json:"media,omitempty"` // Media type to emulate. Empty string disables the override. Features []MediaFeature `json:"features,omitempty"` // Media features to emulate. }
SetEmulatedMediaArgs represents the arguments for SetEmulatedMedia in the Emulation domain.
func NewSetEmulatedMediaArgs ¶
func NewSetEmulatedMediaArgs() *SetEmulatedMediaArgs
NewSetEmulatedMediaArgs initializes SetEmulatedMediaArgs with the required arguments.
func (*SetEmulatedMediaArgs) SetFeatures ¶ added in v0.25.0
func (a *SetEmulatedMediaArgs) SetFeatures(features []MediaFeature) *SetEmulatedMediaArgs
SetFeatures sets the Features optional argument. Media features to emulate.
func (*SetEmulatedMediaArgs) SetMedia ¶ added in v0.25.0
func (a *SetEmulatedMediaArgs) SetMedia(media string) *SetEmulatedMediaArgs
SetMedia sets the Media optional argument. Media type to emulate. Empty string disables the override.
type SetEmulatedVisionDeficiencyArgs ¶ added in v0.26.0
type SetEmulatedVisionDeficiencyArgs struct { // Type Vision deficiency to emulate. Order: best-effort emulations // come first, followed by any physiologically accurate emulations for // medically recognized color vision deficiencies. // // Values: "none", "blurredVision", "reducedContrast", "achromatopsia", "deuteranopia", "protanopia", "tritanopia". Type string `json:"type"` }
SetEmulatedVisionDeficiencyArgs represents the arguments for SetEmulatedVisionDeficiency in the Emulation domain.
func NewSetEmulatedVisionDeficiencyArgs ¶ added in v0.26.0
func NewSetEmulatedVisionDeficiencyArgs(typ string) *SetEmulatedVisionDeficiencyArgs
NewSetEmulatedVisionDeficiencyArgs initializes SetEmulatedVisionDeficiencyArgs with the required arguments.
type SetFocusEmulationEnabledArgs ¶ added in v0.19.1
type SetFocusEmulationEnabledArgs struct {
Enabled bool `json:"enabled"` // Whether to enable to disable focus emulation.
}
SetFocusEmulationEnabledArgs represents the arguments for SetFocusEmulationEnabled in the Emulation domain.
func NewSetFocusEmulationEnabledArgs ¶ added in v0.19.1
func NewSetFocusEmulationEnabledArgs(enabled bool) *SetFocusEmulationEnabledArgs
NewSetFocusEmulationEnabledArgs initializes SetFocusEmulationEnabledArgs with the required arguments.
type SetGeolocationOverrideArgs ¶
type SetGeolocationOverrideArgs struct { Latitude *float64 `json:"latitude,omitempty"` // Mock latitude Longitude *float64 `json:"longitude,omitempty"` // Mock longitude Accuracy *float64 `json:"accuracy,omitempty"` // Mock accuracy }
SetGeolocationOverrideArgs represents the arguments for SetGeolocationOverride in the Emulation domain.
func NewSetGeolocationOverrideArgs ¶
func NewSetGeolocationOverrideArgs() *SetGeolocationOverrideArgs
NewSetGeolocationOverrideArgs initializes SetGeolocationOverrideArgs with the required arguments.
func (*SetGeolocationOverrideArgs) SetAccuracy ¶
func (a *SetGeolocationOverrideArgs) SetAccuracy(accuracy float64) *SetGeolocationOverrideArgs
SetAccuracy sets the Accuracy optional argument. Mock accuracy
func (*SetGeolocationOverrideArgs) SetLatitude ¶
func (a *SetGeolocationOverrideArgs) SetLatitude(latitude float64) *SetGeolocationOverrideArgs
SetLatitude sets the Latitude optional argument. Mock latitude
func (*SetGeolocationOverrideArgs) SetLongitude ¶
func (a *SetGeolocationOverrideArgs) SetLongitude(longitude float64) *SetGeolocationOverrideArgs
SetLongitude sets the Longitude optional argument. Mock longitude
type SetHardwareConcurrencyOverrideArgs ¶ added in v0.33.0
type SetHardwareConcurrencyOverrideArgs struct {
HardwareConcurrency int `json:"hardwareConcurrency"` // Hardware concurrency to report
}
SetHardwareConcurrencyOverrideArgs represents the arguments for SetHardwareConcurrencyOverride in the Emulation domain.
func NewSetHardwareConcurrencyOverrideArgs ¶ added in v0.33.0
func NewSetHardwareConcurrencyOverrideArgs(hardwareConcurrency int) *SetHardwareConcurrencyOverrideArgs
NewSetHardwareConcurrencyOverrideArgs initializes SetHardwareConcurrencyOverrideArgs with the required arguments.
type SetIdleOverrideArgs ¶ added in v0.31.0
type SetIdleOverrideArgs struct { IsUserActive bool `json:"isUserActive"` // Mock isUserActive IsScreenUnlocked bool `json:"isScreenUnlocked"` // Mock isScreenUnlocked }
SetIdleOverrideArgs represents the arguments for SetIdleOverride in the Emulation domain.
func NewSetIdleOverrideArgs ¶ added in v0.31.0
func NewSetIdleOverrideArgs(isUserActive bool, isScreenUnlocked bool) *SetIdleOverrideArgs
NewSetIdleOverrideArgs initializes SetIdleOverrideArgs with the required arguments.
type SetLocaleOverrideArgs ¶ added in v0.26.0
type SetLocaleOverrideArgs struct {
Locale *string `json:"locale,omitempty"` // ICU style C locale (e.g. "en_US"). If not specified or empty, disables the override and restores default host system locale.
}
SetLocaleOverrideArgs represents the arguments for SetLocaleOverride in the Emulation domain.
func NewSetLocaleOverrideArgs ¶ added in v0.26.0
func NewSetLocaleOverrideArgs() *SetLocaleOverrideArgs
NewSetLocaleOverrideArgs initializes SetLocaleOverrideArgs with the required arguments.
func (*SetLocaleOverrideArgs) SetLocale ¶ added in v0.26.0
func (a *SetLocaleOverrideArgs) SetLocale(locale string) *SetLocaleOverrideArgs
SetLocale sets the Locale optional argument. ICU style C locale (e.g. "en_US"). If not specified or empty, disables the override and restores default host system locale.
type SetNavigatorOverridesArgs ¶ added in v0.13.1
type SetNavigatorOverridesArgs struct {
}SetNavigatorOverridesArgs represents the arguments for SetNavigatorOverrides in the Emulation domain.
func NewSetNavigatorOverridesArgs ¶ added in v0.13.1
func NewSetNavigatorOverridesArgs(platform string) *SetNavigatorOverridesArgs
NewSetNavigatorOverridesArgs initializes SetNavigatorOverridesArgs with the required arguments.
type SetPageScaleFactorArgs ¶
type SetPageScaleFactorArgs struct {
PageScaleFactor float64 `json:"pageScaleFactor"` // Page scale factor.
}
SetPageScaleFactorArgs represents the arguments for SetPageScaleFactor in the Emulation domain.
func NewSetPageScaleFactorArgs ¶
func NewSetPageScaleFactorArgs(pageScaleFactor float64) *SetPageScaleFactorArgs
NewSetPageScaleFactorArgs initializes SetPageScaleFactorArgs with the required arguments.
type SetPressureSourceOverrideEnabledArgs ¶ added in v0.35.0
type SetPressureSourceOverrideEnabledArgs struct { Enabled bool `json:"enabled"` // No description. Source PressureSource `json:"source"` // No description. Metadata *PressureMetadata `json:"metadata,omitempty"` // No description. }
SetPressureSourceOverrideEnabledArgs represents the arguments for SetPressureSourceOverrideEnabled in the Emulation domain.
func NewSetPressureSourceOverrideEnabledArgs ¶ added in v0.35.0
func NewSetPressureSourceOverrideEnabledArgs(enabled bool, source PressureSource) *SetPressureSourceOverrideEnabledArgs
NewSetPressureSourceOverrideEnabledArgs initializes SetPressureSourceOverrideEnabledArgs with the required arguments.
func (*SetPressureSourceOverrideEnabledArgs) SetMetadata ¶ added in v0.35.0
func (a *SetPressureSourceOverrideEnabledArgs) SetMetadata(metadata PressureMetadata) *SetPressureSourceOverrideEnabledArgs
SetMetadata sets the Metadata optional argument.
type SetPressureStateOverrideArgs ¶ added in v0.35.0
type SetPressureStateOverrideArgs struct { Source PressureSource `json:"source"` // No description. State PressureState `json:"state"` // No description. }
SetPressureStateOverrideArgs represents the arguments for SetPressureStateOverride in the Emulation domain.
func NewSetPressureStateOverrideArgs ¶ added in v0.35.0
func NewSetPressureStateOverrideArgs(source PressureSource, state PressureState) *SetPressureStateOverrideArgs
NewSetPressureStateOverrideArgs initializes SetPressureStateOverrideArgs with the required arguments.
type SetScriptExecutionDisabledArgs ¶
type SetScriptExecutionDisabledArgs struct {
Value bool `json:"value"` // Whether script execution should be disabled in the page.
}
SetScriptExecutionDisabledArgs represents the arguments for SetScriptExecutionDisabled in the Emulation domain.
func NewSetScriptExecutionDisabledArgs ¶
func NewSetScriptExecutionDisabledArgs(value bool) *SetScriptExecutionDisabledArgs
NewSetScriptExecutionDisabledArgs initializes SetScriptExecutionDisabledArgs with the required arguments.
type SetScrollbarsHiddenArgs ¶ added in v0.18.3
type SetScrollbarsHiddenArgs struct {
Hidden bool `json:"hidden"` // Whether scrollbars should be always hidden.
}
SetScrollbarsHiddenArgs represents the arguments for SetScrollbarsHidden in the Emulation domain.
func NewSetScrollbarsHiddenArgs ¶ added in v0.18.3
func NewSetScrollbarsHiddenArgs(hidden bool) *SetScrollbarsHiddenArgs
NewSetScrollbarsHiddenArgs initializes SetScrollbarsHiddenArgs with the required arguments.
type SetSensorOverrideEnabledArgs ¶ added in v0.35.0
type SetSensorOverrideEnabledArgs struct { Enabled bool `json:"enabled"` // No description. Type SensorType `json:"type"` // No description. Metadata *SensorMetadata `json:"metadata,omitempty"` // No description. }
SetSensorOverrideEnabledArgs represents the arguments for SetSensorOverrideEnabled in the Emulation domain.
func NewSetSensorOverrideEnabledArgs ¶ added in v0.35.0
func NewSetSensorOverrideEnabledArgs(enabled bool, typ SensorType) *SetSensorOverrideEnabledArgs
NewSetSensorOverrideEnabledArgs initializes SetSensorOverrideEnabledArgs with the required arguments.
func (*SetSensorOverrideEnabledArgs) SetMetadata ¶ added in v0.35.0
func (a *SetSensorOverrideEnabledArgs) SetMetadata(metadata SensorMetadata) *SetSensorOverrideEnabledArgs
SetMetadata sets the Metadata optional argument.
type SetSensorOverrideReadingsArgs ¶ added in v0.35.0
type SetSensorOverrideReadingsArgs struct { Type SensorType `json:"type"` // No description. Reading SensorReading `json:"reading"` // No description. }
SetSensorOverrideReadingsArgs represents the arguments for SetSensorOverrideReadings in the Emulation domain.
func NewSetSensorOverrideReadingsArgs ¶ added in v0.35.0
func NewSetSensorOverrideReadingsArgs(typ SensorType, reading SensorReading) *SetSensorOverrideReadingsArgs
NewSetSensorOverrideReadingsArgs initializes SetSensorOverrideReadingsArgs with the required arguments.
type SetTimezoneOverrideArgs ¶ added in v0.23.2
type SetTimezoneOverrideArgs 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.
}
SetTimezoneOverrideArgs represents the arguments for SetTimezoneOverride in the Emulation domain.
func NewSetTimezoneOverrideArgs ¶ added in v0.23.2
func NewSetTimezoneOverrideArgs(timezoneID string) *SetTimezoneOverrideArgs
NewSetTimezoneOverrideArgs initializes SetTimezoneOverrideArgs with the required arguments.
type SetTouchEmulationEnabledArgs ¶
type SetTouchEmulationEnabledArgs struct { Enabled bool `json:"enabled"` // Whether the touch event emulation should be enabled. MaxTouchPoints *int `json:"maxTouchPoints,omitempty"` // Maximum touch points supported. Defaults to one. }
SetTouchEmulationEnabledArgs represents the arguments for SetTouchEmulationEnabled in the Emulation domain.
func NewSetTouchEmulationEnabledArgs ¶
func NewSetTouchEmulationEnabledArgs(enabled bool) *SetTouchEmulationEnabledArgs
NewSetTouchEmulationEnabledArgs initializes SetTouchEmulationEnabledArgs with the required arguments.
func (*SetTouchEmulationEnabledArgs) SetMaxTouchPoints ¶ added in v0.11.1
func (a *SetTouchEmulationEnabledArgs) SetMaxTouchPoints(maxTouchPoints int) *SetTouchEmulationEnabledArgs
SetMaxTouchPoints sets the MaxTouchPoints optional argument. Maximum touch points supported. Defaults to one.
type SetUserAgentOverrideArgs ¶ added in v0.18.3
type SetUserAgentOverrideArgs struct { UserAgent string `json:"userAgent"` // User agent to use. AcceptLanguage *string `json:"acceptLanguage,omitempty"` // Browser language to emulate. Platform *string `json:"platform,omitempty"` // The platform navigator.platform should return. // UserAgentMetadata To be sent in Sec-CH-UA-* headers and returned in // navigator.userAgentData // // Note: This property is experimental. UserAgentMetadata *UserAgentMetadata `json:"userAgentMetadata,omitempty"` }
SetUserAgentOverrideArgs represents the arguments for SetUserAgentOverride in the Emulation domain.
func NewSetUserAgentOverrideArgs ¶ added in v0.18.3
func NewSetUserAgentOverrideArgs(userAgent string) *SetUserAgentOverrideArgs
NewSetUserAgentOverrideArgs initializes SetUserAgentOverrideArgs with the required arguments.
func (*SetUserAgentOverrideArgs) SetAcceptLanguage ¶ added in v0.18.3
func (a *SetUserAgentOverrideArgs) SetAcceptLanguage(acceptLanguage string) *SetUserAgentOverrideArgs
SetAcceptLanguage sets the AcceptLanguage optional argument. Browser language to emulate.
func (*SetUserAgentOverrideArgs) SetPlatform ¶ added in v0.18.3
func (a *SetUserAgentOverrideArgs) SetPlatform(platform string) *SetUserAgentOverrideArgs
SetPlatform sets the Platform optional argument. The platform navigator.platform should return.
func (*SetUserAgentOverrideArgs) SetUserAgentMetadata ¶ added in v0.29.0
func (a *SetUserAgentOverrideArgs) SetUserAgentMetadata(userAgentMetadata UserAgentMetadata) *SetUserAgentOverrideArgs
SetUserAgentMetadata sets the UserAgentMetadata optional argument. To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData
Note: This property is experimental.
type SetVirtualTimePolicyArgs ¶
type SetVirtualTimePolicyArgs struct { Policy VirtualTimePolicy `json:"policy"` // No description. Budget *float64 `json:"budget,omitempty"` // If set, after this many virtual milliseconds have elapsed virtual time will be paused and a virtualTimeBudgetExpired event is sent. MaxVirtualTimeTaskStarvationCount *int `json:"maxVirtualTimeTaskStarvationCount,omitempty"` // If set this specifies the maximum number of tasks that can be run before virtual is forced forwards to prevent deadlock. InitialVirtualTime network.TimeSinceEpoch `json:"initialVirtualTime,omitempty"` // If set, base::Time::Now will be overridden to initially return this value. }
SetVirtualTimePolicyArgs represents the arguments for SetVirtualTimePolicy in the Emulation domain.
func NewSetVirtualTimePolicyArgs ¶
func NewSetVirtualTimePolicyArgs(policy VirtualTimePolicy) *SetVirtualTimePolicyArgs
NewSetVirtualTimePolicyArgs initializes SetVirtualTimePolicyArgs with the required arguments.
func (*SetVirtualTimePolicyArgs) SetBudget ¶
func (a *SetVirtualTimePolicyArgs) SetBudget(budget float64) *SetVirtualTimePolicyArgs
SetBudget sets the Budget optional argument. If set, after this many virtual milliseconds have elapsed virtual time will be paused and a virtualTimeBudgetExpired event is sent.
func (*SetVirtualTimePolicyArgs) SetInitialVirtualTime ¶ added in v0.18.2
func (a *SetVirtualTimePolicyArgs) SetInitialVirtualTime(initialVirtualTime network.TimeSinceEpoch) *SetVirtualTimePolicyArgs
SetInitialVirtualTime sets the InitialVirtualTime optional argument. If set, base::Time::Now will be overridden to initially return this value.
func (*SetVirtualTimePolicyArgs) SetMaxVirtualTimeTaskStarvationCount ¶ added in v0.14.1
func (a *SetVirtualTimePolicyArgs) SetMaxVirtualTimeTaskStarvationCount(maxVirtualTimeTaskStarvationCount int) *SetVirtualTimePolicyArgs
SetMaxVirtualTimeTaskStarvationCount sets the MaxVirtualTimeTaskStarvationCount optional argument. If set this specifies the maximum number of tasks that can be run before virtual is forced forwards to prevent deadlock.
type SetVirtualTimePolicyReply ¶ added in v0.14.2
type SetVirtualTimePolicyReply struct {
VirtualTimeTicksBase float64 `json:"virtualTimeTicksBase"` // Absolute timestamp at which virtual time was first enabled (up time in milliseconds).
}
SetVirtualTimePolicyReply represents the return values for SetVirtualTimePolicy in the Emulation domain.
type SetVisibleSizeArgs ¶
type SetVisibleSizeArgs struct { Width int `json:"width"` // Frame width (DIP). Height int `json:"height"` // Frame height (DIP). }
SetVisibleSizeArgs represents the arguments for SetVisibleSize in the Emulation domain.
func NewSetVisibleSizeArgs ¶
func NewSetVisibleSizeArgs(width int, height int) *SetVisibleSizeArgs
NewSetVisibleSizeArgs initializes SetVisibleSizeArgs with the required arguments.
type UserAgentBrandVersion ¶ added in v0.29.0
type UserAgentBrandVersion struct { Brand string `json:"brand"` // No description. Version string `json:"version"` // No description. }
UserAgentBrandVersion Used to specify User Agent Client Hints to emulate. See https://wicg.github.io/ua-client-hints
Note: This type is experimental.
type UserAgentMetadata ¶ added in v0.29.0
type UserAgentMetadata struct { Brands []UserAgentBrandVersion `json:"brands,omitempty"` // Brands appearing in Sec-CH-UA. FullVersionList []UserAgentBrandVersion `json:"fullVersionList,omitempty"` // Brands appearing in Sec-CH-UA-Full-Version-List. // FullVersion is deprecated. // // Deprecated: This property should not be used. FullVersion *string `json:"fullVersion,omitempty"` Platform string `json:"platform"` // No description. PlatformVersion string `json:"platformVersion"` // No description. Architecture string `json:"architecture"` // No description. Model string `json:"model"` // No description. Mobile bool `json:"mobile"` // No description. Bitness *string `json:"bitness,omitempty"` // No description. Wow64 *bool `json:"wow64,omitempty"` // No description. }
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.
Note: This type is experimental.
type VirtualTimeBudgetExpiredClient ¶
type VirtualTimeBudgetExpiredClient interface { // Recv calls RecvMsg on rpcc.Stream, blocks until the event is // triggered, context canceled or connection closed. Recv() (*VirtualTimeBudgetExpiredReply, error) rpcc.Stream }
VirtualTimeBudgetExpiredClient is a client for VirtualTimeBudgetExpired events. Notification sent after the virtual time budget for the current VirtualTimePolicy has run out.
type VirtualTimeBudgetExpiredReply ¶
type VirtualTimeBudgetExpiredReply struct { }
VirtualTimeBudgetExpiredReply is the reply for VirtualTimeBudgetExpired events.
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.
Note: This type is experimental.
const ( VirtualTimePolicyNotSet VirtualTimePolicy = "" VirtualTimePolicyAdvance VirtualTimePolicy = "advance" VirtualTimePolicyPause VirtualTimePolicy = "pause" VirtualTimePolicyPauseIfNetworkFetchesPending VirtualTimePolicy = "pauseIfNetworkFetchesPending" )
VirtualTimePolicy as enums.
func (VirtualTimePolicy) String ¶
func (e VirtualTimePolicy) String() string
func (VirtualTimePolicy) Valid ¶
func (e VirtualTimePolicy) Valid() bool