Documentation
¶
Overview ¶
Package experimental provides type definitions for use with the Chrome HeadlessExperimental protocol
https://chromedevtools.github.io/devtools-protocol/tot/HeadlessExperimental/
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Format = formatEnum{
Jpeg: formatJpeg,
Png: formatPng,
}
Format provides named acces to the FormatEnum values.
Functions ¶
This section is empty.
Types ¶
type BeginFrameParams ¶
type BeginFrameParams struct {
// Optional. Timestamp of this BeginFrame (milliseconds since epoch). If not
// set, the current time will be used.
FrameTime runtime.Timestamp `json:"frameTime,omitempty"`
// Optional. Deadline of this BeginFrame (milliseconds since epoch). If not
// set, the deadline will be calculated from the frameTime and interval.
Deadline runtime.Timestamp `json:"deadline,omitempty"`
// Optional. The interval between BeginFrames that is reported to the
// compositor, in milliseconds. Defaults to a 60 frames/second interval,
// i.e. about 16.666 milliseconds.
Interval float64 `json:"interval,omitempty"`
// Optional. If set, a screenshot of the frame will be captured and returned
// in the response. Otherwise, no screenshot will be captured.
Screenshot *ScreenshotParams `json:"screenshot,omitempty"`
}
BeginFrameParams represents HeadlessExperimental.beginFrame parameters.
https://chromedevtools.github.io/devtools-protocol/tot/HeadlessExperimental/#method-beginFrame
type BeginFrameResult ¶
type BeginFrameResult struct {
// Whether the BeginFrame resulted in damage and, thus, a new frame was
// committed to the display.
HasDamage bool `json:"hasDamage"`
// Whether the main frame submitted a new display frame in response to this
// BeginFrame.
MainFrameContentUpdated bool `json:"mainFrameContentUpdated"`
// Base64-encoded image data of the screenshot, if one was requested and
// successfully taken.
ScreenshotData string `json:"screenshotData"`
// Error information related to executing this method
Err error `json:"-"`
}
BeginFrameResult represents the result of calls to HeadlessExperimental.beginFrame.
https://chromedevtools.github.io/devtools-protocol/tot/HeadlessExperimental/#method-beginFrame
type DisableResult ¶
type DisableResult struct {
// Error information related to executing this method
Err error `json:"-"`
}
DisableResult represents the result of calls to HeadlessExperimental.disable.
https://chromedevtools.github.io/devtools-protocol/tot/HeadlessExperimental/#method-disable
type EnableResult ¶
type EnableResult struct {
// Error information related to executing this method
Err error `json:"-"`
}
EnableResult represents the result of calls to HeadlessExperimental.enable.
https://chromedevtools.github.io/devtools-protocol/tot/HeadlessExperimental/#method-enable
type FormatEnum ¶
type FormatEnum int
FormatEnum is optional. Image compression format (defaults to png). Allowed values:
- Format.Jpeg "jpeg"
- Format.Png "png"
https://chromedevtools.github.io/devtools-protocol/tot/HeadlessExperimental/#type-ScreenshotParams
func (FormatEnum) MarshalJSON ¶
func (enum FormatEnum) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler
func (*FormatEnum) UnmarshalJSON ¶
func (enum *FormatEnum) UnmarshalJSON(bytes []byte) error
UnmarshalJSON implements json.Unmarshaler
type MainFrameReadyForScreenshotsEvent ¶
type MainFrameReadyForScreenshotsEvent struct {
// Error information related to this event
Err error `json:"-"`
}
MainFrameReadyForScreenshotsEvent represents HeadlessExperimental.mainFrameReadyForScreenshots event data.
type NeedsBeginFramesChangedEvent ¶
type NeedsBeginFramesChangedEvent struct {
// True if BeginFrames are needed, false otherwise.
NeedsBeginFrames bool `json:"needsBeginFrames"`
// Error information related to this event
Err error `json:"-"`
}
NeedsBeginFramesChangedEvent represents HeadlessExperimental.needsBeginFramesChanged event data.
type ScreenshotParams ¶
type ScreenshotParams struct {
// Optional. Image compression format (defaults to png). Allowed values:
// - jpeg
// - png
Format FormatEnum `json:"format,omitempty"`
// Optional. Compression quality from range [0..100] (jpeg only).
Quality int `json:"quality,omitempty"`
}
ScreenshotParams represents encoding options for a screenshot.
https://chromedevtools.github.io/devtools-protocol/tot/HeadlessExperimental/#type-ScreenshotParams