headlessexperimental

package
v0.1.4-0...-075927d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2019 License: MIT, MIT Imports: 8 Imported by: 0

Documentation

Overview

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

Constants

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

Command names.

Variables

This section is empty.

Functions

This section is empty.

Types

type BeginFrameParams

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

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.

parameters:

func (*BeginFrameParams) Do

func (p *BeginFrameParams) Do(ctxt context.Context, h cdp.Executor) (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

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

MarshalEasyJSON supports easyjson.Marshaler interface

func (BeginFrameParams) MarshalJSON

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

MarshalJSON supports json.Marshaler interface

func (*BeginFrameParams) UnmarshalEasyJSON

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

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*BeginFrameParams) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

func (BeginFrameParams) WithFrameTimeTicks

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

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

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

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

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

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

MarshalEasyJSON supports easyjson.Marshaler interface

func (BeginFrameReturns) MarshalJSON

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

MarshalJSON supports json.Marshaler interface

func (*BeginFrameReturns) UnmarshalEasyJSON

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

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*BeginFrameReturns) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

type DisableParams

type DisableParams struct{}

DisableParams disables headless events for the target.

func Disable

func Disable() *DisableParams

Disable disables headless events for the target.

func (*DisableParams) Do

func (p *DisableParams) Do(ctxt context.Context, h cdp.Executor) (err error)

Do executes HeadlessExperimental.disable against the provided context.

func (DisableParams) MarshalEasyJSON

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

MarshalEasyJSON supports easyjson.Marshaler interface

func (DisableParams) MarshalJSON

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

MarshalJSON supports json.Marshaler interface

func (*DisableParams) UnmarshalEasyJSON

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

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*DisableParams) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

type EnableParams

type EnableParams struct{}

EnableParams enables headless events for the target.

func Enable

func Enable() *EnableParams

Enable enables headless events for the target.

func (*EnableParams) Do

func (p *EnableParams) Do(ctxt context.Context, h cdp.Executor) (err error)

Do executes HeadlessExperimental.enable against the provided context.

func (EnableParams) MarshalEasyJSON

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

MarshalEasyJSON supports easyjson.Marshaler interface

func (EnableParams) MarshalJSON

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

MarshalJSON supports json.Marshaler interface

func (*EnableParams) UnmarshalEasyJSON

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

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*EnableParams) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

type EventNeedsBeginFramesChanged

type EventNeedsBeginFramesChanged struct {
	NeedsBeginFrames bool `json:"needsBeginFrames"` // True if BeginFrames are needed, false otherwise.
}

EventNeedsBeginFramesChanged issued when the target starts or stops needing BeginFrames.

func (EventNeedsBeginFramesChanged) MarshalEasyJSON

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

MarshalEasyJSON supports easyjson.Marshaler interface

func (EventNeedsBeginFramesChanged) MarshalJSON

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

MarshalJSON supports json.Marshaler interface

func (*EventNeedsBeginFramesChanged) UnmarshalEasyJSON

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

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*EventNeedsBeginFramesChanged) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

type ScreenshotParams

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.

func (ScreenshotParams) MarshalEasyJSON

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

MarshalEasyJSON supports easyjson.Marshaler interface

func (ScreenshotParams) MarshalJSON

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

MarshalJSON supports json.Marshaler interface

func (*ScreenshotParams) UnmarshalEasyJSON

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

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ScreenshotParams) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

type ScreenshotParamsFormat

type ScreenshotParamsFormat string

ScreenshotParamsFormat image compression format (defaults to png).

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

ScreenshotParamsFormat values.

func (ScreenshotParamsFormat) MarshalEasyJSON

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

MarshalEasyJSON satisfies easyjson.Marshaler.

func (ScreenshotParamsFormat) MarshalJSON

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

MarshalJSON satisfies json.Marshaler.

func (ScreenshotParamsFormat) String

func (t ScreenshotParamsFormat) String() string

String returns the ScreenshotParamsFormat as string value.

func (*ScreenshotParamsFormat) UnmarshalEasyJSON

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

UnmarshalEasyJSON satisfies easyjson.Unmarshaler.

func (*ScreenshotParamsFormat) UnmarshalJSON

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

UnmarshalJSON satisfies json.Unmarshaler.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL