cdproto: github.com/chromedp/cdproto/headlessexperimental Index | Files

package headlessexperimental

import "github.com/chromedp/cdproto/headlessexperimental"

Package headlessexperimental provides the Chrome DevTools Protocol commands, types, and events for the HeadlessExperimental domain.

This domain provides experimental commands only supported in headless mode.

Generated by the cdproto-gen command.

Index

Package Files

easyjson.go headlessexperimental.go types.go

Constants

const (
    CommandBeginFrame = "HeadlessExperimental.beginFrame"
    CommandDisable    = "HeadlessExperimental.disable"
    CommandEnable     = "HeadlessExperimental.enable"
)

Command names.

type BeginFrameParams Uses

type BeginFrameParams struct {
    FrameTimeTicks   float64           `json:"frameTimeTicks,omitempty"`   // Timestamp of this BeginFrame in Renderer TimeTicks (milliseconds of uptime). If not set, the current time will be used.
    Interval         float64           `json:"interval,omitempty"`         // 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.
    NoDisplayUpdates bool              `json:"noDisplayUpdates,omitempty"` // Whether updates should not be committed and drawn onto the display. False by default. If true, only side effects of the BeginFrame will be run, such as layout and animations, but any visual updates may not be visible on the display or in screenshots.
    Screenshot       *ScreenshotParams `json:"screenshot,omitempty"`       // If set, a screenshot of the frame will be captured and returned in the response. Otherwise, no screenshot will be captured. Note that capturing a screenshot can fail, for example, during renderer initialization. In such a case, no screenshot data will be returned.
}

BeginFrameParams sends a BeginFrame to the target and returns when the frame was completed. Optionally captures a screenshot from the resulting frame. Requires that the target was created with enabled BeginFrameControl. Designed for use with --run-all-compositor-stages-before-draw, see also https://goo.gl/3zHXhB for more background.

func BeginFrame Uses

func BeginFrame() *BeginFrameParams

BeginFrame sends a BeginFrame to the target and returns when the frame was completed. Optionally captures a screenshot from the resulting frame. Requires that the target was created with enabled BeginFrameControl. Designed for use with --run-all-compositor-stages-before-draw, see also https://goo.gl/3zHXhB for more background.

See: https://chromedevtools.github.io/devtools-protocol/tot/HeadlessExperimental#method-beginFrame

parameters:

func (*BeginFrameParams) Do Uses

func (p *BeginFrameParams) Do(ctx context.Context) (hasDamage bool, screenshotData []byte, err error)

Do executes HeadlessExperimental.beginFrame against the provided context.

returns:

hasDamage - Whether the BeginFrame resulted in damage and, thus, a new frame was committed to the display. Reported for diagnostic uses, may be removed in the future.
screenshotData - Base64-encoded image data of the screenshot, if one was requested and successfully taken.

func (BeginFrameParams) MarshalEasyJSON Uses

func (v BeginFrameParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (BeginFrameParams) MarshalJSON Uses

func (v BeginFrameParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*BeginFrameParams) UnmarshalEasyJSON Uses

func (v *BeginFrameParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*BeginFrameParams) UnmarshalJSON Uses

func (v *BeginFrameParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (BeginFrameParams) WithFrameTimeTicks Uses

func (p BeginFrameParams) WithFrameTimeTicks(frameTimeTicks float64) *BeginFrameParams

WithFrameTimeTicks timestamp of this BeginFrame in Renderer TimeTicks (milliseconds of uptime). If not set, the current time will be used.

func (BeginFrameParams) WithInterval Uses

func (p BeginFrameParams) WithInterval(interval float64) *BeginFrameParams

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

func (BeginFrameParams) WithNoDisplayUpdates Uses

func (p BeginFrameParams) WithNoDisplayUpdates(noDisplayUpdates bool) *BeginFrameParams

WithNoDisplayUpdates whether updates should not be committed and drawn onto the display. False by default. If true, only side effects of the BeginFrame will be run, such as layout and animations, but any visual updates may not be visible on the display or in screenshots.

func (BeginFrameParams) WithScreenshot Uses

func (p BeginFrameParams) WithScreenshot(screenshot *ScreenshotParams) *BeginFrameParams

WithScreenshot if set, a screenshot of the frame will be captured and returned in the response. Otherwise, no screenshot will be captured. Note that capturing a screenshot can fail, for example, during renderer initialization. In such a case, no screenshot data will be returned.

type BeginFrameReturns Uses

type BeginFrameReturns struct {
    HasDamage      bool   `json:"hasDamage,omitempty"`      // Whether the BeginFrame resulted in damage and, thus, a new frame was committed to the display. Reported for diagnostic uses, may be removed in the future.
    ScreenshotData string `json:"screenshotData,omitempty"` // Base64-encoded image data of the screenshot, if one was requested and successfully taken.
}

BeginFrameReturns return values.

func (BeginFrameReturns) MarshalEasyJSON Uses

func (v BeginFrameReturns) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (BeginFrameReturns) MarshalJSON Uses

func (v BeginFrameReturns) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*BeginFrameReturns) UnmarshalEasyJSON Uses

func (v *BeginFrameReturns) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*BeginFrameReturns) UnmarshalJSON Uses

func (v *BeginFrameReturns) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type DisableParams Uses

type DisableParams struct{}

DisableParams disables headless events for the target.

func Disable Uses

func Disable() *DisableParams

Disable disables headless events for the target.

See: https://chromedevtools.github.io/devtools-protocol/tot/HeadlessExperimental#method-disable

func (*DisableParams) Do Uses

func (p *DisableParams) Do(ctx context.Context) (err error)

Do executes HeadlessExperimental.disable against the provided context.

func (DisableParams) MarshalEasyJSON Uses

func (v DisableParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (DisableParams) MarshalJSON Uses

func (v DisableParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*DisableParams) UnmarshalEasyJSON Uses

func (v *DisableParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*DisableParams) UnmarshalJSON Uses

func (v *DisableParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type EnableParams Uses

type EnableParams struct{}

EnableParams enables headless events for the target.

func Enable Uses

func Enable() *EnableParams

Enable enables headless events for the target.

See: https://chromedevtools.github.io/devtools-protocol/tot/HeadlessExperimental#method-enable

func (*EnableParams) Do Uses

func (p *EnableParams) Do(ctx context.Context) (err error)

Do executes HeadlessExperimental.enable against the provided context.

func (EnableParams) MarshalEasyJSON Uses

func (v EnableParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (EnableParams) MarshalJSON Uses

func (v EnableParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*EnableParams) UnmarshalEasyJSON Uses

func (v *EnableParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*EnableParams) UnmarshalJSON Uses

func (v *EnableParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type ScreenshotParams Uses

type ScreenshotParams struct {
    Format  ScreenshotParamsFormat `json:"format,omitempty"`  // Image compression format (defaults to png).
    Quality int64                  `json:"quality,omitempty"` // Compression quality from range [0..100] (jpeg only).
}

ScreenshotParams encoding options for a screenshot.

See: https://chromedevtools.github.io/devtools-protocol/tot/HeadlessExperimental#type-ScreenshotParams

func (ScreenshotParams) MarshalEasyJSON Uses

func (v ScreenshotParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ScreenshotParams) MarshalJSON Uses

func (v ScreenshotParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*ScreenshotParams) UnmarshalEasyJSON Uses

func (v *ScreenshotParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ScreenshotParams) UnmarshalJSON Uses

func (v *ScreenshotParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type ScreenshotParamsFormat Uses

type ScreenshotParamsFormat string

ScreenshotParamsFormat image compression format (defaults to png).

See: https://chromedevtools.github.io/devtools-protocol/tot/HeadlessExperimental#type-ScreenshotParams

const (
    ScreenshotParamsFormatJpeg ScreenshotParamsFormat = "jpeg"
    ScreenshotParamsFormatPng  ScreenshotParamsFormat = "png"
)

ScreenshotParamsFormat values.

func (ScreenshotParamsFormat) MarshalEasyJSON Uses

func (t ScreenshotParamsFormat) MarshalEasyJSON(out *jwriter.Writer)

MarshalEasyJSON satisfies easyjson.Marshaler.

func (ScreenshotParamsFormat) MarshalJSON Uses

func (t ScreenshotParamsFormat) MarshalJSON() ([]byte, error)

MarshalJSON satisfies json.Marshaler.

func (ScreenshotParamsFormat) String Uses

func (t ScreenshotParamsFormat) String() string

String returns the ScreenshotParamsFormat as string value.

func (*ScreenshotParamsFormat) UnmarshalEasyJSON Uses

func (t *ScreenshotParamsFormat) UnmarshalEasyJSON(in *jlexer.Lexer)

UnmarshalEasyJSON satisfies easyjson.Unmarshaler.

func (*ScreenshotParamsFormat) UnmarshalJSON Uses

func (t *ScreenshotParamsFormat) UnmarshalJSON(buf []byte) error

UnmarshalJSON satisfies json.Unmarshaler.

Package headlessexperimental imports 8 packages (graph) and is imported by 3 packages. Updated 2021-01-06. Refresh now. Tools for package owners.