page

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2017 License: MIT Imports: 10 Imported by: 109

Documentation

Overview

Package page implements the Page domain. Actions and events related to the inspected page belong to the page domain.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(conn *rpcc.Conn) *domainClient

NewClient returns a client for the Page domain with the connection set to conn.

Types

type AddScriptToEvaluateOnLoadArgs

type AddScriptToEvaluateOnLoadArgs struct {
	ScriptSource string `json:"scriptSource"` // No description.
}

AddScriptToEvaluateOnLoadArgs represents the arguments for AddScriptToEvaluateOnLoad in the Page domain.

func NewAddScriptToEvaluateOnLoadArgs

func NewAddScriptToEvaluateOnLoadArgs(scriptSource string) *AddScriptToEvaluateOnLoadArgs

NewAddScriptToEvaluateOnLoadArgs initializes AddScriptToEvaluateOnLoadArgs with the required arguments.

type AddScriptToEvaluateOnLoadReply

type AddScriptToEvaluateOnLoadReply struct {
	Identifier ScriptIdentifier `json:"identifier"` // Identifier of the added script.
}

AddScriptToEvaluateOnLoadReply represents the return values for AddScriptToEvaluateOnLoad in the Page domain.

type AddScriptToEvaluateOnNewDocumentArgs

type AddScriptToEvaluateOnNewDocumentArgs struct {
	Source string `json:"source"` // No description.
}

AddScriptToEvaluateOnNewDocumentArgs represents the arguments for AddScriptToEvaluateOnNewDocument in the Page domain.

func NewAddScriptToEvaluateOnNewDocumentArgs

func NewAddScriptToEvaluateOnNewDocumentArgs(source string) *AddScriptToEvaluateOnNewDocumentArgs

NewAddScriptToEvaluateOnNewDocumentArgs initializes AddScriptToEvaluateOnNewDocumentArgs with the required arguments.

type AddScriptToEvaluateOnNewDocumentReply

type AddScriptToEvaluateOnNewDocumentReply struct {
	Identifier ScriptIdentifier `json:"identifier"` // Identifier of the added script.
}

AddScriptToEvaluateOnNewDocumentReply represents the return values for AddScriptToEvaluateOnNewDocument in the Page domain.

type AppManifestError

type AppManifestError struct {
	Message  string `json:"message"`  // Error message.
	Critical int    `json:"critical"` // If criticial, this is a non-recoverable parse error.
	Line     int    `json:"line"`     // Error line.
	Column   int    `json:"column"`   // Error column.
}

AppManifestError Error while paring app manifest.

Note: This type is experimental.

type CaptureScreenshotArgs

type CaptureScreenshotArgs struct {
	// Format Image compression format (defaults to png).
	//
	// Values: "jpeg", "png".
	Format  *string `json:"format,omitempty"`
	Quality *int    `json:"quality,omitempty"` // Compression quality from range [0..100] (jpeg only).
	// Clip Capture the screenshot of a given region only.
	//
	// Note: This property is experimental.
	Clip *Viewport `json:"clip,omitempty"`
	// FromSurface Capture the screenshot from the surface, rather than the view. Defaults to true.
	//
	// Note: This property is experimental.
	FromSurface *bool `json:"fromSurface,omitempty"`
}

CaptureScreenshotArgs represents the arguments for CaptureScreenshot in the Page domain.

func NewCaptureScreenshotArgs

func NewCaptureScreenshotArgs() *CaptureScreenshotArgs

NewCaptureScreenshotArgs initializes CaptureScreenshotArgs with the required arguments.

func (*CaptureScreenshotArgs) SetClip added in v0.9.1

SetClip sets the Clip optional argument. Capture the screenshot of a given region only.

Note: This property is experimental.

func (*CaptureScreenshotArgs) SetFormat

func (a *CaptureScreenshotArgs) SetFormat(format string) *CaptureScreenshotArgs

SetFormat sets the Format optional argument. Image compression format (defaults to png).

Values: "jpeg", "png".

func (*CaptureScreenshotArgs) SetFromSurface

func (a *CaptureScreenshotArgs) SetFromSurface(fromSurface bool) *CaptureScreenshotArgs

SetFromSurface sets the FromSurface optional argument. Capture the screenshot from the surface, rather than the view. Defaults to true.

Note: This property is experimental.

func (*CaptureScreenshotArgs) SetQuality

func (a *CaptureScreenshotArgs) SetQuality(quality int) *CaptureScreenshotArgs

SetQuality sets the Quality optional argument. Compression quality from range [0..100] (jpeg only).

type CaptureScreenshotReply

type CaptureScreenshotReply struct {
	Data []byte `json:"data"` // Base64-encoded image data.
}

CaptureScreenshotReply represents the return values for CaptureScreenshot in the Page domain.

type CreateIsolatedWorldArgs

type CreateIsolatedWorldArgs struct {
	FrameID             FrameID `json:"frameId"`                       // Id of the frame in which the isolated world should be created.
	WorldName           *string `json:"worldName,omitempty"`           // An optional name which is reported in the Execution Context.
	GrantUniveralAccess *bool   `json:"grantUniveralAccess,omitempty"` // Whether or not universal access should be granted to the isolated world. This is a powerful option, use with caution.
}

CreateIsolatedWorldArgs represents the arguments for CreateIsolatedWorld in the Page domain.

func NewCreateIsolatedWorldArgs

func NewCreateIsolatedWorldArgs(frameID FrameID) *CreateIsolatedWorldArgs

NewCreateIsolatedWorldArgs initializes CreateIsolatedWorldArgs with the required arguments.

func (*CreateIsolatedWorldArgs) SetGrantUniveralAccess

func (a *CreateIsolatedWorldArgs) SetGrantUniveralAccess(grantUniveralAccess bool) *CreateIsolatedWorldArgs

SetGrantUniveralAccess sets the GrantUniveralAccess optional argument. Whether or not universal access should be granted to the isolated world. This is a powerful option, use with caution.

func (*CreateIsolatedWorldArgs) SetWorldName

func (a *CreateIsolatedWorldArgs) SetWorldName(worldName string) *CreateIsolatedWorldArgs

SetWorldName sets the WorldName optional argument. An optional name which is reported in the Execution Context.

type CreateIsolatedWorldReply

type CreateIsolatedWorldReply struct {
	ExecutionContextID runtime.ExecutionContextID `json:"executionContextId"` // Execution context of the isolated world.
}

CreateIsolatedWorldReply represents the return values for CreateIsolatedWorld in the Page domain.

type DOMContentEventFiredClient

type DOMContentEventFiredClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*DOMContentEventFiredReply, error)
	rpcc.Stream
}

DOMContentEventFiredClient is a client for DOMContentEventFired events.

type DOMContentEventFiredReply

type DOMContentEventFiredReply struct {
	Timestamp network.MonotonicTime `json:"timestamp"` // No description.
}

DOMContentEventFiredReply is the reply for DOMContentEventFired events.

type DialogType

type DialogType int

DialogType Javascript dialog type.

Note: This type is experimental.

const (
	DialogTypeNotSet DialogType = iota
	DialogTypeAlert
	DialogTypeConfirm
	DialogTypePrompt
	DialogTypeBeforeunload
)

DialogType as enums.

func (DialogType) MarshalJSON

func (e DialogType) MarshalJSON() ([]byte, error)

MarshalJSON encodes enum into a string or null when not set.

func (DialogType) String

func (e DialogType) String() string

func (*DialogType) UnmarshalJSON

func (e *DialogType) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes a string value into a enum.

func (DialogType) Valid

func (e DialogType) Valid() bool

Valid returns true if enum is set.

type Frame

type Frame struct {
	ID             FrameID          `json:"id"`                 // Frame unique identifier.
	ParentID       *FrameID         `json:"parentId,omitempty"` // Parent frame identifier.
	LoaderID       network.LoaderID `json:"loaderId"`           // Identifier of the loader associated with this frame.
	Name           *string          `json:"name,omitempty"`     // Frame's name as specified in the tag.
	URL            string           `json:"url"`                // Frame document's URL.
	SecurityOrigin string           `json:"securityOrigin"`     // Frame document's security origin.
	MimeType       string           `json:"mimeType"`           // Frame document's mimeType as determined by the browser.
	// UnreachableURL If the frame failed to load, this contains the URL that could not be loaded.
	//
	// Note: This property is experimental.
	UnreachableURL *string `json:"unreachableUrl,omitempty"`
}

Frame Information about the Frame on the page.

type FrameAttachedClient

type FrameAttachedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*FrameAttachedReply, error)
	rpcc.Stream
}

FrameAttachedClient is a client for FrameAttached events. Fired when frame has been attached to its parent.

type FrameAttachedReply

type FrameAttachedReply struct {
	FrameID       FrameID `json:"frameId"`       // Id of the frame that has been attached.
	ParentFrameID FrameID `json:"parentFrameId"` // Parent frame identifier.
	// Stack JavaScript stack trace of when frame was attached, only set if frame initiated from script.
	//
	// Note: This property is experimental.
	Stack *runtime.StackTrace `json:"stack,omitempty"`
}

FrameAttachedReply is the reply for FrameAttached events.

type FrameClearedScheduledNavigationClient

type FrameClearedScheduledNavigationClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*FrameClearedScheduledNavigationReply, error)
	rpcc.Stream
}

FrameClearedScheduledNavigationClient is a client for FrameClearedScheduledNavigation events. Fired when frame no longer has a scheduled navigation.

type FrameClearedScheduledNavigationReply

type FrameClearedScheduledNavigationReply struct {
	FrameID FrameID `json:"frameId"` // Id of the frame that has cleared its scheduled navigation.
}

FrameClearedScheduledNavigationReply is the reply for FrameClearedScheduledNavigation events.

type FrameDetachedClient

type FrameDetachedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*FrameDetachedReply, error)
	rpcc.Stream
}

FrameDetachedClient is a client for FrameDetached events. Fired when frame has been detached from its parent.

type FrameDetachedReply

type FrameDetachedReply struct {
	FrameID FrameID `json:"frameId"` // Id of the frame that has been detached.
}

FrameDetachedReply is the reply for FrameDetached events.

type FrameID

type FrameID = internal.PageFrameID

FrameID Unique frame identifier.

Provided as an alias to prevent circular dependencies.

type FrameNavigatedClient

type FrameNavigatedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*FrameNavigatedReply, error)
	rpcc.Stream
}

FrameNavigatedClient is a client for FrameNavigated events. Fired once navigation of the frame has completed. Frame is now associated with the new loader.

type FrameNavigatedReply

type FrameNavigatedReply struct {
	Frame Frame `json:"frame"` // Frame object.
}

FrameNavigatedReply is the reply for FrameNavigated events.

type FrameResizedClient

type FrameResizedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*FrameResizedReply, error)
	rpcc.Stream
}

FrameResizedClient is a client for FrameResized events.

type FrameResizedReply

type FrameResizedReply struct{}

FrameResizedReply is the reply for FrameResized events.

type FrameResource

type FrameResource struct {
	URL          string                 `json:"url"`                    // Resource URL.
	Type         ResourceType           `json:"type"`                   // Type of this resource.
	MimeType     string                 `json:"mimeType"`               // Resource mimeType as determined by the browser.
	LastModified network.TimeSinceEpoch `json:"lastModified,omitempty"` // last-modified timestamp as reported by server.
	ContentSize  *float64               `json:"contentSize,omitempty"`  // Resource content size.
	Failed       *bool                  `json:"failed,omitempty"`       // True if the resource failed to load.
	Canceled     *bool                  `json:"canceled,omitempty"`     // True if the resource was canceled during loading.
}

FrameResource Information about the Resource on the page.

Note: This type is experimental.

type FrameResourceTree

type FrameResourceTree struct {
	Frame       Frame               `json:"frame"`                 // Frame information for this tree item.
	ChildFrames []FrameResourceTree `json:"childFrames,omitempty"` // Child frames.
	Resources   []FrameResource     `json:"resources"`             // Information about frame resources.
}

FrameResourceTree Information about the Frame hierarchy along with their cached resources.

Note: This type is experimental.

type FrameScheduledNavigationClient

type FrameScheduledNavigationClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*FrameScheduledNavigationReply, error)
	rpcc.Stream
}

FrameScheduledNavigationClient is a client for FrameScheduledNavigation events. Fired when frame schedules a potential navigation.

type FrameScheduledNavigationReply

type FrameScheduledNavigationReply struct {
	FrameID FrameID `json:"frameId"` // Id of the frame that has scheduled a navigation.
	Delay   float64 `json:"delay"`   // Delay (in seconds) until the navigation is scheduled to begin. The navigation is not guaranteed to start.
	// Reason The reason for the navigation.
	//
	// Values: "formSubmission", "httpHeaderRefresh", "scriptInitiated", "metaTagRefresh", "pageBlockInterstitial", "reload".
	//
	// Note: This property is experimental.
	Reason string `json:"reason"`
	// URL The destination URL for the scheduled navigation.
	//
	// Note: This property is experimental.
	URL string `json:"url"`
}

FrameScheduledNavigationReply is the reply for FrameScheduledNavigation events.

type FrameStartedLoadingClient

type FrameStartedLoadingClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*FrameStartedLoadingReply, error)
	rpcc.Stream
}

FrameStartedLoadingClient is a client for FrameStartedLoading events. Fired when frame has started loading.

type FrameStartedLoadingReply

type FrameStartedLoadingReply struct {
	FrameID FrameID `json:"frameId"` // Id of the frame that has started loading.
}

FrameStartedLoadingReply is the reply for FrameStartedLoading events.

type FrameStoppedLoadingClient

type FrameStoppedLoadingClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*FrameStoppedLoadingReply, error)
	rpcc.Stream
}

FrameStoppedLoadingClient is a client for FrameStoppedLoading events. Fired when frame has stopped loading.

type FrameStoppedLoadingReply

type FrameStoppedLoadingReply struct {
	FrameID FrameID `json:"frameId"` // Id of the frame that has stopped loading.
}

FrameStoppedLoadingReply is the reply for FrameStoppedLoading events.

type GetAppManifestReply

type GetAppManifestReply struct {
	URL    string             `json:"url"`            // Manifest location.
	Errors []AppManifestError `json:"errors"`         // No description.
	Data   *string            `json:"data,omitempty"` // Manifest content.
}

GetAppManifestReply represents the return values for GetAppManifest in the Page domain.

type GetLayoutMetricsReply

type GetLayoutMetricsReply struct {
	LayoutViewport LayoutViewport `json:"layoutViewport"` // Metrics relating to the layout viewport.
	VisualViewport VisualViewport `json:"visualViewport"` // Metrics relating to the visual viewport.
	ContentSize    dom.Rect       `json:"contentSize"`    // Size of scrollable area.
}

GetLayoutMetricsReply represents the return values for GetLayoutMetrics in the Page domain.

type GetNavigationHistoryReply

type GetNavigationHistoryReply struct {
	CurrentIndex int               `json:"currentIndex"` // Index of the current navigation history entry.
	Entries      []NavigationEntry `json:"entries"`      // Array of navigation history entries.
}

GetNavigationHistoryReply represents the return values for GetNavigationHistory in the Page domain.

type GetResourceContentArgs

type GetResourceContentArgs struct {
	FrameID FrameID `json:"frameId"` // Frame id to get resource for.
	URL     string  `json:"url"`     // URL of the resource to get content for.
}

GetResourceContentArgs represents the arguments for GetResourceContent in the Page domain.

func NewGetResourceContentArgs

func NewGetResourceContentArgs(frameID FrameID, url string) *GetResourceContentArgs

NewGetResourceContentArgs initializes GetResourceContentArgs with the required arguments.

type GetResourceContentReply

type GetResourceContentReply struct {
	Content       string `json:"content"`       // Resource content.
	Base64Encoded bool   `json:"base64Encoded"` // True, if content was served as base64.
}

GetResourceContentReply represents the return values for GetResourceContent in the Page domain.

type GetResourceTreeReply

type GetResourceTreeReply struct {
	FrameTree FrameResourceTree `json:"frameTree"` // Present frame / resource tree structure.
}

GetResourceTreeReply represents the return values for GetResourceTree in the Page domain.

type HandleJavaScriptDialogArgs

type HandleJavaScriptDialogArgs struct {
	Accept     bool    `json:"accept"`               // Whether to accept or dismiss the dialog.
	PromptText *string `json:"promptText,omitempty"` // The text to enter into the dialog prompt before accepting. Used only if this is a prompt dialog.
}

HandleJavaScriptDialogArgs represents the arguments for HandleJavaScriptDialog in the Page domain.

func NewHandleJavaScriptDialogArgs

func NewHandleJavaScriptDialogArgs(accept bool) *HandleJavaScriptDialogArgs

NewHandleJavaScriptDialogArgs initializes HandleJavaScriptDialogArgs with the required arguments.

func (*HandleJavaScriptDialogArgs) SetPromptText

func (a *HandleJavaScriptDialogArgs) SetPromptText(promptText string) *HandleJavaScriptDialogArgs

SetPromptText sets the PromptText optional argument. The text to enter into the dialog prompt before accepting. Used only if this is a prompt dialog.

type InterstitialHiddenClient

type InterstitialHiddenClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*InterstitialHiddenReply, error)
	rpcc.Stream
}

InterstitialHiddenClient is a client for InterstitialHidden events. Fired when interstitial page was hidden

type InterstitialHiddenReply

type InterstitialHiddenReply struct{}

InterstitialHiddenReply is the reply for InterstitialHidden events.

type InterstitialShownClient

type InterstitialShownClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*InterstitialShownReply, error)
	rpcc.Stream
}

InterstitialShownClient is a client for InterstitialShown events. Fired when interstitial page was shown

type InterstitialShownReply

type InterstitialShownReply struct{}

InterstitialShownReply is the reply for InterstitialShown events.

type JavascriptDialogClosedClient

type JavascriptDialogClosedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*JavascriptDialogClosedReply, error)
	rpcc.Stream
}

JavascriptDialogClosedClient is a client for JavascriptDialogClosed events. Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been closed.

type JavascriptDialogClosedReply

type JavascriptDialogClosedReply struct {
	Result    bool   `json:"result"`    // Whether dialog was confirmed.
	UserInput string `json:"userInput"` // User input in case of prompt.
}

JavascriptDialogClosedReply is the reply for JavascriptDialogClosed events.

type JavascriptDialogOpeningClient

type JavascriptDialogOpeningClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*JavascriptDialogOpeningReply, error)
	rpcc.Stream
}

JavascriptDialogOpeningClient is a client for JavascriptDialogOpening events. Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to open.

type JavascriptDialogOpeningReply

type JavascriptDialogOpeningReply struct {
	URL           string     `json:"url"`                     // Frame url.
	Message       string     `json:"message"`                 // Message that will be displayed by the dialog.
	Type          DialogType `json:"type"`                    // Dialog type.
	DefaultPrompt *string    `json:"defaultPrompt,omitempty"` // Default dialog prompt.
}

JavascriptDialogOpeningReply is the reply for JavascriptDialogOpening events.

type LayoutViewport

type LayoutViewport struct {
	PageX        int `json:"pageX"`        // Horizontal offset relative to the document (CSS pixels).
	PageY        int `json:"pageY"`        // Vertical offset relative to the document (CSS pixels).
	ClientWidth  int `json:"clientWidth"`  // Width (CSS pixels), excludes scrollbar if present.
	ClientHeight int `json:"clientHeight"` // Height (CSS pixels), excludes scrollbar if present.
}

LayoutViewport Layout viewport position and dimensions.

Note: This type is experimental.

type LifecycleEventClient added in v0.11.4

type LifecycleEventClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*LifecycleEventReply, error)
	rpcc.Stream
}

LifecycleEventClient is a client for LifecycleEvent events. Fired for top level page lifecycle events such as navigation, load, paint, etc.

type LifecycleEventReply added in v0.11.4

type LifecycleEventReply struct {
	Name      string                `json:"name"`      // No description.
	Timestamp network.MonotonicTime `json:"timestamp"` // No description.
}

LifecycleEventReply is the reply for LifecycleEvent events.

type LoadEventFiredClient

type LoadEventFiredClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*LoadEventFiredReply, error)
	rpcc.Stream
}

LoadEventFiredClient is a client for LoadEventFired events.

type LoadEventFiredReply

type LoadEventFiredReply struct {
	Timestamp network.MonotonicTime `json:"timestamp"` // No description.
}

LoadEventFiredReply is the reply for LoadEventFired events.

type NavigateArgs struct {
	URL string `json:"url"` // URL to navigate the page to.
	// Referrer Referrer URL.
	//
	// Note: This property is experimental.
	Referrer *string `json:"referrer,omitempty"`
	// TransitionType Intended transition type.
	//
	// Note: This property is experimental.
	TransitionType TransitionType `json:"transitionType,omitempty"`
}

NavigateArgs represents the arguments for Navigate in the Page domain.

func NewNavigateArgs

func NewNavigateArgs(url string) *NavigateArgs

NewNavigateArgs initializes NavigateArgs with the required arguments.

func (a *NavigateArgs) SetReferrer(referrer string) *NavigateArgs

SetReferrer sets the Referrer optional argument. Referrer URL.

Note: This property is experimental.

func (a *NavigateArgs) SetTransitionType(transitionType TransitionType) *NavigateArgs

SetTransitionType sets the TransitionType optional argument. Intended transition type.

Note: This property is experimental.

type NavigateReply struct {
	// FrameID Frame id that will be navigated.
	//
	// Note: This property is experimental.
	FrameID FrameID `json:"frameId"`
}

NavigateReply represents the return values for Navigate in the Page domain.

type NavigateToHistoryEntryArgs struct {
	EntryID int `json:"entryId"` // Unique id of the entry to navigate to.
}

NavigateToHistoryEntryArgs represents the arguments for NavigateToHistoryEntry in the Page domain.

func NewNavigateToHistoryEntryArgs

func NewNavigateToHistoryEntryArgs(entryID int) *NavigateToHistoryEntryArgs

NewNavigateToHistoryEntryArgs initializes NavigateToHistoryEntryArgs with the required arguments.

type NavigationEntry struct {
	ID             int            `json:"id"`             // Unique id of the navigation history entry.
	URL            string         `json:"url"`            // URL of the navigation history entry.
	UserTypedURL   string         `json:"userTypedURL"`   // URL that the user typed in the url bar.
	Title          string         `json:"title"`          // Title of the navigation history entry.
	TransitionType TransitionType `json:"transitionType"` // Transition type.
}

NavigationEntry Navigation history entry.

Note: This type is experimental.

type NavigationResponse int

NavigationResponse Proceed: allow the navigation; Cancel: cancel the navigation; CancelAndIgnore: cancels the navigation and makes the requester of the navigation acts like the request was never made.

Note: This type is experimental.

const (
	NavigationResponseNotSet NavigationResponse = iota
	NavigationResponseProceed
	NavigationResponseCancel
	NavigationResponseCancelAndIgnore
)

NavigationResponse as enums.

func (e NavigationResponse) MarshalJSON() ([]byte, error)

MarshalJSON encodes enum into a string or null when not set.

func (e NavigationResponse) String() string
func (e *NavigationResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes a string value into a enum.

func (e NavigationResponse) Valid() bool

Valid returns true if enum is set.

type PrintToPDFArgs

type PrintToPDFArgs struct {
	Landscape               *bool    `json:"landscape,omitempty"`               // Paper orientation. Defaults to false.
	DisplayHeaderFooter     *bool    `json:"displayHeaderFooter,omitempty"`     // Display header and footer. Defaults to false.
	PrintBackground         *bool    `json:"printBackground,omitempty"`         // Print background graphics. Defaults to false.
	Scale                   *float64 `json:"scale,omitempty"`                   // Scale of the webpage rendering. Defaults to 1.
	PaperWidth              *float64 `json:"paperWidth,omitempty"`              // Paper width in inches. Defaults to 8.5 inches.
	PaperHeight             *float64 `json:"paperHeight,omitempty"`             // Paper height in inches. Defaults to 11 inches.
	MarginTop               *float64 `json:"marginTop,omitempty"`               // Top margin in inches. Defaults to 1cm (~0.4 inches).
	MarginBottom            *float64 `json:"marginBottom,omitempty"`            // Bottom margin in inches. Defaults to 1cm (~0.4 inches).
	MarginLeft              *float64 `json:"marginLeft,omitempty"`              // Left margin in inches. Defaults to 1cm (~0.4 inches).
	MarginRight             *float64 `json:"marginRight,omitempty"`             // Right margin in inches. Defaults to 1cm (~0.4 inches).
	PageRanges              *string  `json:"pageRanges,omitempty"`              // Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.
	IgnoreInvalidPageRanges *bool    `json:"ignoreInvalidPageRanges,omitempty"` // Whether to silently ignore invalid but successfully parsed page ranges, such as '3-2'. Defaults to false.
}

PrintToPDFArgs represents the arguments for PrintToPDF in the Page domain.

func NewPrintToPDFArgs

func NewPrintToPDFArgs() *PrintToPDFArgs

NewPrintToPDFArgs initializes PrintToPDFArgs with the required arguments.

func (*PrintToPDFArgs) SetDisplayHeaderFooter

func (a *PrintToPDFArgs) SetDisplayHeaderFooter(displayHeaderFooter bool) *PrintToPDFArgs

SetDisplayHeaderFooter sets the DisplayHeaderFooter optional argument. Display header and footer. Defaults to false.

func (*PrintToPDFArgs) SetIgnoreInvalidPageRanges added in v0.9.1

func (a *PrintToPDFArgs) SetIgnoreInvalidPageRanges(ignoreInvalidPageRanges bool) *PrintToPDFArgs

SetIgnoreInvalidPageRanges sets the IgnoreInvalidPageRanges optional argument. Whether to silently ignore invalid but successfully parsed page ranges, such as '3-2'. Defaults to false.

func (*PrintToPDFArgs) SetLandscape

func (a *PrintToPDFArgs) SetLandscape(landscape bool) *PrintToPDFArgs

SetLandscape sets the Landscape optional argument. Paper orientation. Defaults to false.

func (*PrintToPDFArgs) SetMarginBottom

func (a *PrintToPDFArgs) SetMarginBottom(marginBottom float64) *PrintToPDFArgs

SetMarginBottom sets the MarginBottom optional argument. Bottom margin in inches. Defaults to 1cm (~0.4 inches).

func (*PrintToPDFArgs) SetMarginLeft

func (a *PrintToPDFArgs) SetMarginLeft(marginLeft float64) *PrintToPDFArgs

SetMarginLeft sets the MarginLeft optional argument. Left margin in inches. Defaults to 1cm (~0.4 inches).

func (*PrintToPDFArgs) SetMarginRight

func (a *PrintToPDFArgs) SetMarginRight(marginRight float64) *PrintToPDFArgs

SetMarginRight sets the MarginRight optional argument. Right margin in inches. Defaults to 1cm (~0.4 inches).

func (*PrintToPDFArgs) SetMarginTop

func (a *PrintToPDFArgs) SetMarginTop(marginTop float64) *PrintToPDFArgs

SetMarginTop sets the MarginTop optional argument. Top margin in inches. Defaults to 1cm (~0.4 inches).

func (*PrintToPDFArgs) SetPageRanges

func (a *PrintToPDFArgs) SetPageRanges(pageRanges string) *PrintToPDFArgs

SetPageRanges sets the PageRanges optional argument. Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.

func (*PrintToPDFArgs) SetPaperHeight

func (a *PrintToPDFArgs) SetPaperHeight(paperHeight float64) *PrintToPDFArgs

SetPaperHeight sets the PaperHeight optional argument. Paper height in inches. Defaults to 11 inches.

func (*PrintToPDFArgs) SetPaperWidth

func (a *PrintToPDFArgs) SetPaperWidth(paperWidth float64) *PrintToPDFArgs

SetPaperWidth sets the PaperWidth optional argument. Paper width in inches. Defaults to 8.5 inches.

func (*PrintToPDFArgs) SetPrintBackground

func (a *PrintToPDFArgs) SetPrintBackground(printBackground bool) *PrintToPDFArgs

SetPrintBackground sets the PrintBackground optional argument. Print background graphics. Defaults to false.

func (*PrintToPDFArgs) SetScale

func (a *PrintToPDFArgs) SetScale(scale float64) *PrintToPDFArgs

SetScale sets the Scale optional argument. Scale of the webpage rendering. Defaults to 1.

type PrintToPDFReply

type PrintToPDFReply struct {
	Data []byte `json:"data"` // Base64-encoded pdf data.
}

PrintToPDFReply represents the return values for PrintToPDF in the Page domain.

type ReloadArgs

type ReloadArgs struct {
	IgnoreCache            *bool   `json:"ignoreCache,omitempty"`            // If true, browser cache is ignored (as if the user pressed Shift+refresh).
	ScriptToEvaluateOnLoad *string `json:"scriptToEvaluateOnLoad,omitempty"` // If set, the script will be injected into all frames of the inspected page after reload.
}

ReloadArgs represents the arguments for Reload in the Page domain.

func NewReloadArgs

func NewReloadArgs() *ReloadArgs

NewReloadArgs initializes ReloadArgs with the required arguments.

func (*ReloadArgs) SetIgnoreCache

func (a *ReloadArgs) SetIgnoreCache(ignoreCache bool) *ReloadArgs

SetIgnoreCache sets the IgnoreCache optional argument. If true, browser cache is ignored (as if the user pressed Shift+refresh).

func (*ReloadArgs) SetScriptToEvaluateOnLoad

func (a *ReloadArgs) SetScriptToEvaluateOnLoad(scriptToEvaluateOnLoad string) *ReloadArgs

SetScriptToEvaluateOnLoad sets the ScriptToEvaluateOnLoad optional argument. If set, the script will be injected into all frames of the inspected page after reload.

type RemoveScriptToEvaluateOnLoadArgs

type RemoveScriptToEvaluateOnLoadArgs struct {
	Identifier ScriptIdentifier `json:"identifier"` // No description.
}

RemoveScriptToEvaluateOnLoadArgs represents the arguments for RemoveScriptToEvaluateOnLoad in the Page domain.

func NewRemoveScriptToEvaluateOnLoadArgs

func NewRemoveScriptToEvaluateOnLoadArgs(identifier ScriptIdentifier) *RemoveScriptToEvaluateOnLoadArgs

NewRemoveScriptToEvaluateOnLoadArgs initializes RemoveScriptToEvaluateOnLoadArgs with the required arguments.

type RemoveScriptToEvaluateOnNewDocumentArgs

type RemoveScriptToEvaluateOnNewDocumentArgs struct {
	Identifier ScriptIdentifier `json:"identifier"` // No description.
}

RemoveScriptToEvaluateOnNewDocumentArgs represents the arguments for RemoveScriptToEvaluateOnNewDocument in the Page domain.

func NewRemoveScriptToEvaluateOnNewDocumentArgs

func NewRemoveScriptToEvaluateOnNewDocumentArgs(identifier ScriptIdentifier) *RemoveScriptToEvaluateOnNewDocumentArgs

NewRemoveScriptToEvaluateOnNewDocumentArgs initializes RemoveScriptToEvaluateOnNewDocumentArgs with the required arguments.

type ResourceType

type ResourceType = internal.PageResourceType

ResourceType Resource type as it was perceived by the rendering engine.

Provided as an alias to prevent circular dependencies.

const (
	ResourceTypeNotSet ResourceType = iota
	ResourceTypeDocument
	ResourceTypeStylesheet
	ResourceTypeImage
	ResourceTypeMedia
	ResourceTypeFont
	ResourceTypeScript
	ResourceTypeTextTrack
	ResourceTypeXHR
	ResourceTypeFetch
	ResourceTypeEventSource
	ResourceTypeWebSocket
	ResourceTypeManifest
	ResourceTypeOther
)

ResourceType as enums.

type ScreencastFrameAckArgs

type ScreencastFrameAckArgs struct {
	SessionID int `json:"sessionId"` // Frame number.
}

ScreencastFrameAckArgs represents the arguments for ScreencastFrameAck in the Page domain.

func NewScreencastFrameAckArgs

func NewScreencastFrameAckArgs(sessionID int) *ScreencastFrameAckArgs

NewScreencastFrameAckArgs initializes ScreencastFrameAckArgs with the required arguments.

type ScreencastFrameClient

type ScreencastFrameClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*ScreencastFrameReply, error)
	rpcc.Stream
}

ScreencastFrameClient is a client for ScreencastFrame events. Compressed image data requested by the startScreencast.

type ScreencastFrameMetadata

type ScreencastFrameMetadata struct {
	// OffsetTop Top offset in DIP.
	//
	// Note: This property is experimental.
	OffsetTop float64 `json:"offsetTop"`
	// PageScaleFactor Page scale factor.
	//
	// Note: This property is experimental.
	PageScaleFactor float64 `json:"pageScaleFactor"`
	// DeviceWidth Device screen width in DIP.
	//
	// Note: This property is experimental.
	DeviceWidth float64 `json:"deviceWidth"`
	// DeviceHeight Device screen height in DIP.
	//
	// Note: This property is experimental.
	DeviceHeight float64 `json:"deviceHeight"`
	// ScrollOffsetX Position of horizontal scroll in CSS pixels.
	//
	// Note: This property is experimental.
	ScrollOffsetX float64 `json:"scrollOffsetX"`
	// ScrollOffsetY Position of vertical scroll in CSS pixels.
	//
	// Note: This property is experimental.
	ScrollOffsetY float64 `json:"scrollOffsetY"`
	// Timestamp Frame swap timestamp.
	//
	// Note: This property is experimental.
	Timestamp network.TimeSinceEpoch `json:"timestamp,omitempty"`
}

ScreencastFrameMetadata Screencast frame metadata.

Note: This type is experimental.

type ScreencastFrameReply

type ScreencastFrameReply struct {
	Data      []byte                  `json:"data"`      // Base64-encoded compressed image.
	Metadata  ScreencastFrameMetadata `json:"metadata"`  // Screencast frame metadata.
	SessionID int                     `json:"sessionId"` // Frame number.
}

ScreencastFrameReply is the reply for ScreencastFrame events.

type ScreencastVisibilityChangedClient

type ScreencastVisibilityChangedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*ScreencastVisibilityChangedReply, error)
	rpcc.Stream
}

ScreencastVisibilityChangedClient is a client for ScreencastVisibilityChanged events. Fired when the page with currently enabled screencast was shown or hidden .

type ScreencastVisibilityChangedReply

type ScreencastVisibilityChangedReply struct {
	Visible bool `json:"visible"` // True if the page is visible.
}

ScreencastVisibilityChangedReply is the reply for ScreencastVisibilityChanged events.

type ScriptIdentifier

type ScriptIdentifier string

ScriptIdentifier Unique script identifier.

Note: This type is experimental.

type SearchInResourceArgs

type SearchInResourceArgs struct {
	FrameID       FrameID `json:"frameId"`                 // Frame id for resource to search in.
	URL           string  `json:"url"`                     // URL of the resource to search in.
	Query         string  `json:"query"`                   // String to search for.
	CaseSensitive *bool   `json:"caseSensitive,omitempty"` // If true, search is case sensitive.
	IsRegex       *bool   `json:"isRegex,omitempty"`       // If true, treats string parameter as regex.
}

SearchInResourceArgs represents the arguments for SearchInResource in the Page domain.

func NewSearchInResourceArgs

func NewSearchInResourceArgs(frameID FrameID, url string, query string) *SearchInResourceArgs

NewSearchInResourceArgs initializes SearchInResourceArgs with the required arguments.

func (*SearchInResourceArgs) SetCaseSensitive

func (a *SearchInResourceArgs) SetCaseSensitive(caseSensitive bool) *SearchInResourceArgs

SetCaseSensitive sets the CaseSensitive optional argument. If true, search is case sensitive.

func (*SearchInResourceArgs) SetIsRegex

func (a *SearchInResourceArgs) SetIsRegex(isRegex bool) *SearchInResourceArgs

SetIsRegex sets the IsRegex optional argument. If true, treats string parameter as regex.

type SearchInResourceReply

type SearchInResourceReply struct {
	Result []debugger.SearchMatch `json:"result"` // List of search matches.
}

SearchInResourceReply represents the return values for SearchInResource in the Page domain.

type SetAdBlockingEnabledArgs added in v0.9.1

type SetAdBlockingEnabledArgs struct {
	Enabled bool `json:"enabled"` // Whether to block ads.
}

SetAdBlockingEnabledArgs represents the arguments for SetAdBlockingEnabled in the Page domain.

func NewSetAdBlockingEnabledArgs added in v0.9.1

func NewSetAdBlockingEnabledArgs(enabled bool) *SetAdBlockingEnabledArgs

NewSetAdBlockingEnabledArgs initializes SetAdBlockingEnabledArgs with the required arguments.

type SetAutoAttachToCreatedPagesArgs

type SetAutoAttachToCreatedPagesArgs struct {
	AutoAttach bool `json:"autoAttach"` // If true, browser will open a new inspector window for every page created from this one.
}

SetAutoAttachToCreatedPagesArgs represents the arguments for SetAutoAttachToCreatedPages in the Page domain.

func NewSetAutoAttachToCreatedPagesArgs

func NewSetAutoAttachToCreatedPagesArgs(autoAttach bool) *SetAutoAttachToCreatedPagesArgs

NewSetAutoAttachToCreatedPagesArgs initializes SetAutoAttachToCreatedPagesArgs with the required arguments.

type SetDocumentContentArgs

type SetDocumentContentArgs struct {
	FrameID FrameID `json:"frameId"` // Frame id to set HTML for.
	HTML    string  `json:"html"`    // HTML content to set.
}

SetDocumentContentArgs represents the arguments for SetDocumentContent in the Page domain.

func NewSetDocumentContentArgs

func NewSetDocumentContentArgs(frameID FrameID, html string) *SetDocumentContentArgs

NewSetDocumentContentArgs initializes SetDocumentContentArgs with the required arguments.

type SetDownloadBehaviorArgs added in v0.11.4

type SetDownloadBehaviorArgs struct {
	// Behavior Whether to allow all or deny all download requests, or use default Chrome behavior if available (otherwise deny).
	//
	// Values: "deny", "allow", "default".
	Behavior     string  `json:"behavior"`
	DownloadPath *string `json:"downloadPath,omitempty"` // The default path to save downloaded files to. This is required if behavior is set to 'allow'
}

SetDownloadBehaviorArgs represents the arguments for SetDownloadBehavior in the Page domain.

func NewSetDownloadBehaviorArgs added in v0.11.4

func NewSetDownloadBehaviorArgs(behavior string) *SetDownloadBehaviorArgs

NewSetDownloadBehaviorArgs initializes SetDownloadBehaviorArgs with the required arguments.

func (*SetDownloadBehaviorArgs) SetDownloadPath added in v0.11.4

func (a *SetDownloadBehaviorArgs) SetDownloadPath(downloadPath string) *SetDownloadBehaviorArgs

SetDownloadPath sets the DownloadPath optional argument. The default path to save downloaded files to. This is required if behavior is set to 'allow'

type StartScreencastArgs

type StartScreencastArgs struct {
	// Format Image compression format.
	//
	// Values: "jpeg", "png".
	Format        *string `json:"format,omitempty"`
	Quality       *int    `json:"quality,omitempty"`       // Compression quality from range [0..100].
	MaxWidth      *int    `json:"maxWidth,omitempty"`      // Maximum screenshot width.
	MaxHeight     *int    `json:"maxHeight,omitempty"`     // Maximum screenshot height.
	EveryNthFrame *int    `json:"everyNthFrame,omitempty"` // Send every n-th frame.
}

StartScreencastArgs represents the arguments for StartScreencast in the Page domain.

func NewStartScreencastArgs

func NewStartScreencastArgs() *StartScreencastArgs

NewStartScreencastArgs initializes StartScreencastArgs with the required arguments.

func (*StartScreencastArgs) SetEveryNthFrame

func (a *StartScreencastArgs) SetEveryNthFrame(everyNthFrame int) *StartScreencastArgs

SetEveryNthFrame sets the EveryNthFrame optional argument. Send every n-th frame.

func (*StartScreencastArgs) SetFormat

func (a *StartScreencastArgs) SetFormat(format string) *StartScreencastArgs

SetFormat sets the Format optional argument. Image compression format.

Values: "jpeg", "png".

func (*StartScreencastArgs) SetMaxHeight

func (a *StartScreencastArgs) SetMaxHeight(maxHeight int) *StartScreencastArgs

SetMaxHeight sets the MaxHeight optional argument. Maximum screenshot height.

func (*StartScreencastArgs) SetMaxWidth

func (a *StartScreencastArgs) SetMaxWidth(maxWidth int) *StartScreencastArgs

SetMaxWidth sets the MaxWidth optional argument. Maximum screenshot width.

func (*StartScreencastArgs) SetQuality

func (a *StartScreencastArgs) SetQuality(quality int) *StartScreencastArgs

SetQuality sets the Quality optional argument. Compression quality from range [0..100].

type TransitionType

type TransitionType int

TransitionType Transition type.

Note: This type is experimental.

const (
	TransitionTypeNotSet TransitionType = iota
	TransitionTypeLink
	TransitionTypeTyped
	TransitionTypeAutoBookmark
	TransitionTypeAutoSubframe
	TransitionTypeManualSubframe
	TransitionTypeGenerated
	TransitionTypeAutoToplevel
	TransitionTypeFormSubmit
	TransitionTypeReload
	TransitionTypeKeyword
	TransitionTypeKeywordGenerated
	TransitionTypeOther
)

TransitionType as enums.

func (TransitionType) MarshalJSON

func (e TransitionType) MarshalJSON() ([]byte, error)

MarshalJSON encodes enum into a string or null when not set.

func (TransitionType) String

func (e TransitionType) String() string

func (*TransitionType) UnmarshalJSON

func (e *TransitionType) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes a string value into a enum.

func (TransitionType) Valid

func (e TransitionType) Valid() bool

Valid returns true if enum is set.

type Viewport added in v0.9.1

type Viewport struct {
	X      float64 `json:"x"`      // X offset in CSS pixels.
	Y      float64 `json:"y"`      // Y offset in CSS pixels
	Width  float64 `json:"width"`  // Rectangle width in CSS pixels
	Height float64 `json:"height"` // Rectangle height in CSS pixels
	Scale  float64 `json:"scale"`  // Page scale factor.
}

Viewport Viewport for capturing screenshot.

Note: This type is experimental.

type VisualViewport

type VisualViewport struct {
	OffsetX      float64 `json:"offsetX"`      // Horizontal offset relative to the layout viewport (CSS pixels).
	OffsetY      float64 `json:"offsetY"`      // Vertical offset relative to the layout viewport (CSS pixels).
	PageX        float64 `json:"pageX"`        // Horizontal offset relative to the document (CSS pixels).
	PageY        float64 `json:"pageY"`        // Vertical offset relative to the document (CSS pixels).
	ClientWidth  float64 `json:"clientWidth"`  // Width (CSS pixels), excludes scrollbar if present.
	ClientHeight float64 `json:"clientHeight"` // Height (CSS pixels), excludes scrollbar if present.
	Scale        float64 `json:"scale"`        // Scale relative to the ideal viewport (size at width=device-width).
}

VisualViewport Visual viewport position, dimensions, and scale.

Note: This type is experimental.

Jump to

Keyboard shortcuts

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