gcdapi

package
v1.0.15 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2020 License: MIT Imports: 2 Imported by: 13

Documentation

Index

Constants

View Source
const CHROME_CHANNEL = "stable"

Chrome Channel information

View Source
const CHROME_VERSION = "83.0.4103.116"

Chrome Version information

Variables

This section is empty.

Functions

This section is empty.

Types

type Accessibility

type Accessibility struct {
	// contains filtered or unexported fields
}

func NewAccessibility

func NewAccessibility(target gcdmessage.ChromeTargeter) *Accessibility

func (*Accessibility) Disable added in v1.0.2

func (c *Accessibility) Disable() (*gcdmessage.ChromeResponse, error)

Disables the accessibility domain.

func (*Accessibility) Enable added in v1.0.2

func (c *Accessibility) Enable() (*gcdmessage.ChromeResponse, error)

Enables the accessibility domain which causes `AXNodeId`s to remain consistent between method calls. This turns on accessibility for the page, which can impact performance until accessibility is disabled.

func (*Accessibility) GetFullAXTree

func (c *Accessibility) GetFullAXTree() ([]*AccessibilityAXNode, error)

GetFullAXTree - Fetches the entire accessibility tree Returns - nodes -

func (*Accessibility) GetPartialAXTree

func (c *Accessibility) GetPartialAXTree(nodeId int, backendNodeId int, objectId string, fetchRelatives bool) ([]*AccessibilityAXNode, error)

GetPartialAXTree - Fetches the accessibility node and partial accessibility tree for this DOM node, if it exists. nodeId - Identifier of the node to get the partial accessibility tree for. backendNodeId - Identifier of the backend node to get the partial accessibility tree for. objectId - JavaScript object id of the node wrapper to get the partial accessibility tree for. fetchRelatives - Whether to fetch this nodes ancestors, siblings and children. Defaults to true. Returns - nodes - The `Accessibility.AXNode` for this DOM node, if it exists, plus its ancestors, siblings and children, if requested.

func (*Accessibility) GetPartialAXTreeWithParams

func (c *Accessibility) GetPartialAXTreeWithParams(v *AccessibilityGetPartialAXTreeParams) ([]*AccessibilityAXNode, error)

GetPartialAXTreeWithParams - Fetches the accessibility node and partial accessibility tree for this DOM node, if it exists. Returns - nodes - The `Accessibility.AXNode` for this DOM node, if it exists, plus its ancestors, siblings and children, if requested.

type AccessibilityAXNode

type AccessibilityAXNode struct {
	NodeId           string                     `json:"nodeId"`                     // Unique identifier for this node.
	Ignored          bool                       `json:"ignored"`                    // Whether this node is ignored for accessibility
	IgnoredReasons   []*AccessibilityAXProperty `json:"ignoredReasons,omitempty"`   // Collection of reasons why this node is hidden.
	Role             *AccessibilityAXValue      `json:"role,omitempty"`             // This `Node`'s role, whether explicit or implicit.
	Name             *AccessibilityAXValue      `json:"name,omitempty"`             // The accessible name for this `Node`.
	Description      *AccessibilityAXValue      `json:"description,omitempty"`      // The accessible description for this `Node`.
	Value            *AccessibilityAXValue      `json:"value,omitempty"`            // The value for this `Node`.
	Properties       []*AccessibilityAXProperty `json:"properties,omitempty"`       // All other properties
	ChildIds         []string                   `json:"childIds,omitempty"`         // IDs for each of this node's child nodes.
	BackendDOMNodeId int                        `json:"backendDOMNodeId,omitempty"` // The backend ID for the associated DOM node, if any.
}

A node in the accessibility tree.

type AccessibilityAXProperty

type AccessibilityAXProperty struct {
	Name  string                `json:"name"`  // The name of this property. enum values: busy, disabled, editable, focusable, focused, hidden, hiddenRoot, invalid, keyshortcuts, settable, roledescription, live, atomic, relevant, root, autocomplete, hasPopup, level, multiselectable, orientation, multiline, readonly, required, valuemin, valuemax, valuetext, checked, expanded, modal, pressed, selected, activedescendant, controls, describedby, details, errormessage, flowto, labelledby, owns
	Value *AccessibilityAXValue `json:"value"` // The value of this property.
}

No Description.

type AccessibilityAXRelatedNode

type AccessibilityAXRelatedNode struct {
	BackendDOMNodeId int    `json:"backendDOMNodeId"` // The BackendNodeId of the related DOM node.
	Idref            string `json:"idref,omitempty"`  // The IDRef value provided, if any.
	Text             string `json:"text,omitempty"`   // The text alternative of this node in the current context.
}

No Description.

type AccessibilityAXValue

type AccessibilityAXValue struct {
	Type         string                        `json:"type"`                   // The type of this value. enum values: boolean, tristate, booleanOrUndefined, idref, idrefList, integer, node, nodeList, number, string, computedString, token, tokenList, domRelation, role, internalRole, valueUndefined
	Value        interface{}                   `json:"value,omitempty"`        // The computed value of this property.
	RelatedNodes []*AccessibilityAXRelatedNode `json:"relatedNodes,omitempty"` // One or more related nodes, if applicable.
	Sources      []*AccessibilityAXValueSource `json:"sources,omitempty"`      // The sources which contributed to the computation of this property.
}

A single computed AX property.

type AccessibilityAXValueSource

type AccessibilityAXValueSource struct {
	Type              string                `json:"type"`                        // What type of source this is. enum values: attribute, implicit, style, contents, placeholder, relatedElement
	Value             *AccessibilityAXValue `json:"value,omitempty"`             // The value of this property source.
	Attribute         string                `json:"attribute,omitempty"`         // The name of the relevant attribute, if any.
	AttributeValue    *AccessibilityAXValue `json:"attributeValue,omitempty"`    // The value of the relevant attribute, if any.
	Superseded        bool                  `json:"superseded,omitempty"`        // Whether this source is superseded by a higher priority source.
	NativeSource      string                `json:"nativeSource,omitempty"`      // The native markup source for this value, e.g. a <label> element. enum values: figcaption, label, labelfor, labelwrapped, legend, tablecaption, title, other
	NativeSourceValue *AccessibilityAXValue `json:"nativeSourceValue,omitempty"` // The value, such as a node or node list, of the native source.
	Invalid           bool                  `json:"invalid,omitempty"`           // Whether the value for this property is invalid.
	InvalidReason     string                `json:"invalidReason,omitempty"`     // Reason for the value being invalid, if it is.
}

A single source for a computed AX property.

type AccessibilityGetPartialAXTreeParams

type AccessibilityGetPartialAXTreeParams struct {
	// Identifier of the node to get the partial accessibility tree for.
	NodeId int `json:"nodeId,omitempty"`
	// Identifier of the backend node to get the partial accessibility tree for.
	BackendNodeId int `json:"backendNodeId,omitempty"`
	// JavaScript object id of the node wrapper to get the partial accessibility tree for.
	ObjectId string `json:"objectId,omitempty"`
	// Whether to fetch this nodes ancestors, siblings and children. Defaults to true.
	FetchRelatives bool `json:"fetchRelatives,omitempty"`
}

type Animation

type Animation struct {
	// contains filtered or unexported fields
}

func NewAnimation

func NewAnimation(target gcdmessage.ChromeTargeter) *Animation

func (*Animation) Disable

func (c *Animation) Disable() (*gcdmessage.ChromeResponse, error)

Disables animation domain notifications.

func (*Animation) Enable

func (c *Animation) Enable() (*gcdmessage.ChromeResponse, error)

Enables animation domain notifications.

func (*Animation) GetCurrentTime

func (c *Animation) GetCurrentTime(id string) (float64, error)

GetCurrentTime - Returns the current time of the an animation. id - Id of animation. Returns - currentTime - Current time of the page.

func (*Animation) GetCurrentTimeWithParams

func (c *Animation) GetCurrentTimeWithParams(v *AnimationGetCurrentTimeParams) (float64, error)

GetCurrentTimeWithParams - Returns the current time of the an animation. Returns - currentTime - Current time of the page.

func (*Animation) GetPlaybackRate

func (c *Animation) GetPlaybackRate() (float64, error)

GetPlaybackRate - Gets the playback rate of the document timeline. Returns - playbackRate - Playback rate for animations on page.

func (*Animation) ReleaseAnimations

func (c *Animation) ReleaseAnimations(animations []string) (*gcdmessage.ChromeResponse, error)

ReleaseAnimations - Releases a set of animations to no longer be manipulated. animations - List of animation ids to seek.

func (*Animation) ReleaseAnimationsWithParams

func (c *Animation) ReleaseAnimationsWithParams(v *AnimationReleaseAnimationsParams) (*gcdmessage.ChromeResponse, error)

ReleaseAnimationsWithParams - Releases a set of animations to no longer be manipulated.

func (*Animation) ResolveAnimation

func (c *Animation) ResolveAnimation(animationId string) (*RuntimeRemoteObject, error)

ResolveAnimation - Gets the remote object of the Animation. animationId - Animation id. Returns - remoteObject - Corresponding remote object.

func (*Animation) ResolveAnimationWithParams

func (c *Animation) ResolveAnimationWithParams(v *AnimationResolveAnimationParams) (*RuntimeRemoteObject, error)

ResolveAnimationWithParams - Gets the remote object of the Animation. Returns - remoteObject - Corresponding remote object.

func (*Animation) SeekAnimations

func (c *Animation) SeekAnimations(animations []string, currentTime float64) (*gcdmessage.ChromeResponse, error)

SeekAnimations - Seek a set of animations to a particular time within each animation. animations - List of animation ids to seek. currentTime - Set the current time of each animation.

func (*Animation) SeekAnimationsWithParams

func (c *Animation) SeekAnimationsWithParams(v *AnimationSeekAnimationsParams) (*gcdmessage.ChromeResponse, error)

SeekAnimationsWithParams - Seek a set of animations to a particular time within each animation.

func (*Animation) SetPaused

func (c *Animation) SetPaused(animations []string, paused bool) (*gcdmessage.ChromeResponse, error)

SetPaused - Sets the paused state of a set of animations. animations - Animations to set the pause state of. paused - Paused state to set to.

func (*Animation) SetPausedWithParams

func (c *Animation) SetPausedWithParams(v *AnimationSetPausedParams) (*gcdmessage.ChromeResponse, error)

SetPausedWithParams - Sets the paused state of a set of animations.

func (*Animation) SetPlaybackRate

func (c *Animation) SetPlaybackRate(playbackRate float64) (*gcdmessage.ChromeResponse, error)

SetPlaybackRate - Sets the playback rate of the document timeline. playbackRate - Playback rate for animations on page

func (*Animation) SetPlaybackRateWithParams

func (c *Animation) SetPlaybackRateWithParams(v *AnimationSetPlaybackRateParams) (*gcdmessage.ChromeResponse, error)

SetPlaybackRateWithParams - Sets the playback rate of the document timeline.

func (*Animation) SetTiming

func (c *Animation) SetTiming(animationId string, duration float64, delay float64) (*gcdmessage.ChromeResponse, error)

SetTiming - Sets the timing of an animation node. animationId - Animation id. duration - Duration of the animation. delay - Delay of the animation.

func (*Animation) SetTimingWithParams

func (c *Animation) SetTimingWithParams(v *AnimationSetTimingParams) (*gcdmessage.ChromeResponse, error)

SetTimingWithParams - Sets the timing of an animation node.

type AnimationAnimation

type AnimationAnimation struct {
	Id           string                    `json:"id"`               // `Animation`'s id.
	Name         string                    `json:"name"`             // `Animation`'s name.
	PausedState  bool                      `json:"pausedState"`      // `Animation`'s internal paused state.
	PlayState    string                    `json:"playState"`        // `Animation`'s play state.
	PlaybackRate float64                   `json:"playbackRate"`     // `Animation`'s playback rate.
	StartTime    float64                   `json:"startTime"`        // `Animation`'s start time.
	CurrentTime  float64                   `json:"currentTime"`      // `Animation`'s current time.
	Type         string                    `json:"type"`             // Animation type of `Animation`.
	Source       *AnimationAnimationEffect `json:"source,omitempty"` // `Animation`'s source animation node.
	CssId        string                    `json:"cssId,omitempty"`  // A unique ID for `Animation` representing the sources that triggered this CSS animation/transition.
}

Animation instance.

type AnimationAnimationCanceledEvent

type AnimationAnimationCanceledEvent struct {
	Method string `json:"method"`
	Params struct {
		Id string `json:"id"` // Id of the animation that was cancelled.
	} `json:"Params,omitempty"`
}

Event for when an animation has been cancelled.

type AnimationAnimationCreatedEvent

type AnimationAnimationCreatedEvent struct {
	Method string `json:"method"`
	Params struct {
		Id string `json:"id"` // Id of the animation that was created.
	} `json:"Params,omitempty"`
}

Event for each animation that has been created.

type AnimationAnimationEffect

type AnimationAnimationEffect struct {
	Delay          float64                 `json:"delay"`                   // `AnimationEffect`'s delay.
	EndDelay       float64                 `json:"endDelay"`                // `AnimationEffect`'s end delay.
	IterationStart float64                 `json:"iterationStart"`          // `AnimationEffect`'s iteration start.
	Iterations     float64                 `json:"iterations"`              // `AnimationEffect`'s iterations.
	Duration       float64                 `json:"duration"`                // `AnimationEffect`'s iteration duration.
	Direction      string                  `json:"direction"`               // `AnimationEffect`'s playback direction.
	Fill           string                  `json:"fill"`                    // `AnimationEffect`'s fill mode.
	BackendNodeId  int                     `json:"backendNodeId,omitempty"` // `AnimationEffect`'s target node.
	KeyframesRule  *AnimationKeyframesRule `json:"keyframesRule,omitempty"` // `AnimationEffect`'s keyframes.
	Easing         string                  `json:"easing"`                  // `AnimationEffect`'s timing function.
}

AnimationEffect instance

type AnimationAnimationStartedEvent

type AnimationAnimationStartedEvent struct {
	Method string `json:"method"`
	Params struct {
		Animation *AnimationAnimation `json:"animation"` // Animation that was started.
	} `json:"Params,omitempty"`
}

Event for animation that has been started.

type AnimationGetCurrentTimeParams

type AnimationGetCurrentTimeParams struct {
	// Id of animation.
	Id string `json:"id"`
}

type AnimationKeyframeStyle

type AnimationKeyframeStyle struct {
	Offset string `json:"offset"` // Keyframe's time offset.
	Easing string `json:"easing"` // `AnimationEffect`'s timing function.
}

Keyframe Style

type AnimationKeyframesRule

type AnimationKeyframesRule struct {
	Name      string                    `json:"name,omitempty"` // CSS keyframed animation's name.
	Keyframes []*AnimationKeyframeStyle `json:"keyframes"`      // List of animation keyframes.
}

Keyframes Rule

type AnimationReleaseAnimationsParams

type AnimationReleaseAnimationsParams struct {
	// List of animation ids to seek.
	Animations []string `json:"animations"`
}

type AnimationResolveAnimationParams

type AnimationResolveAnimationParams struct {
	// Animation id.
	AnimationId string `json:"animationId"`
}

type AnimationSeekAnimationsParams

type AnimationSeekAnimationsParams struct {
	// List of animation ids to seek.
	Animations []string `json:"animations"`
	// Set the current time of each animation.
	CurrentTime float64 `json:"currentTime"`
}

type AnimationSetPausedParams

type AnimationSetPausedParams struct {
	// Animations to set the pause state of.
	Animations []string `json:"animations"`
	// Paused state to set to.
	Paused bool `json:"paused"`
}

type AnimationSetPlaybackRateParams

type AnimationSetPlaybackRateParams struct {
	// Playback rate for animations on page
	PlaybackRate float64 `json:"playbackRate"`
}

type AnimationSetTimingParams

type AnimationSetTimingParams struct {
	// Animation id.
	AnimationId string `json:"animationId"`
	// Duration of the animation.
	Duration float64 `json:"duration"`
	// Delay of the animation.
	Delay float64 `json:"delay"`
}

type ApplicationCache

type ApplicationCache struct {
	// contains filtered or unexported fields
}

func NewApplicationCache

func NewApplicationCache(target gcdmessage.ChromeTargeter) *ApplicationCache

func (*ApplicationCache) Enable

Enables application cache domain notifications.

func (*ApplicationCache) GetApplicationCacheForFrame

func (c *ApplicationCache) GetApplicationCacheForFrame(frameId string) (*ApplicationCacheApplicationCache, error)

GetApplicationCacheForFrame - Returns relevant application cache data for the document in given frame. frameId - Identifier of the frame containing document whose application cache is retrieved. Returns - applicationCache - Relevant application cache data for the document in given frame.

func (*ApplicationCache) GetApplicationCacheForFrameWithParams

GetApplicationCacheForFrameWithParams - Returns relevant application cache data for the document in given frame. Returns - applicationCache - Relevant application cache data for the document in given frame.

func (*ApplicationCache) GetFramesWithManifests

func (c *ApplicationCache) GetFramesWithManifests() ([]*ApplicationCacheFrameWithManifest, error)

GetFramesWithManifests - Returns array of frame identifiers with manifest urls for each frame containing a document associated with some application cache. Returns - frameIds - Array of frame identifiers with manifest urls for each frame containing a document associated with some application cache.

func (*ApplicationCache) GetManifestForFrame

func (c *ApplicationCache) GetManifestForFrame(frameId string) (string, error)

GetManifestForFrame - Returns manifest URL for document in the given frame. frameId - Identifier of the frame containing document whose manifest is retrieved. Returns - manifestURL - Manifest URL for document in the given frame.

func (*ApplicationCache) GetManifestForFrameWithParams

func (c *ApplicationCache) GetManifestForFrameWithParams(v *ApplicationCacheGetManifestForFrameParams) (string, error)

GetManifestForFrameWithParams - Returns manifest URL for document in the given frame. Returns - manifestURL - Manifest URL for document in the given frame.

type ApplicationCacheApplicationCache

type ApplicationCacheApplicationCache struct {
	ManifestURL  string                                      `json:"manifestURL"`  // Manifest URL.
	Size         float64                                     `json:"size"`         // Application cache size.
	CreationTime float64                                     `json:"creationTime"` // Application cache creation time.
	UpdateTime   float64                                     `json:"updateTime"`   // Application cache update time.
	Resources    []*ApplicationCacheApplicationCacheResource `json:"resources"`    // Application cache resources.
}

Detailed application cache information.

type ApplicationCacheApplicationCacheResource

type ApplicationCacheApplicationCacheResource struct {
	Url  string `json:"url"`  // Resource url.
	Size int    `json:"size"` // Resource size.
	Type string `json:"type"` // Resource type.
}

Detailed application cache resource information.

type ApplicationCacheApplicationCacheStatusUpdatedEvent

type ApplicationCacheApplicationCacheStatusUpdatedEvent struct {
	Method string `json:"method"`
	Params struct {
		FrameId     string `json:"frameId"`     // Identifier of the frame containing document whose application cache updated status.
		ManifestURL string `json:"manifestURL"` // Manifest URL.
		Status      int    `json:"status"`      // Updated application cache status.
	} `json:"Params,omitempty"`
}

type ApplicationCacheFrameWithManifest

type ApplicationCacheFrameWithManifest struct {
	FrameId     string `json:"frameId"`     // Frame identifier.
	ManifestURL string `json:"manifestURL"` // Manifest URL.
	Status      int    `json:"status"`      // Application cache status.
}

Frame identifier - manifest URL pair.

type ApplicationCacheGetApplicationCacheForFrameParams

type ApplicationCacheGetApplicationCacheForFrameParams struct {
	// Identifier of the frame containing document whose application cache is retrieved.
	FrameId string `json:"frameId"`
}

type ApplicationCacheGetManifestForFrameParams

type ApplicationCacheGetManifestForFrameParams struct {
	// Identifier of the frame containing document whose manifest is retrieved.
	FrameId string `json:"frameId"`
}

type ApplicationCacheNetworkStateUpdatedEvent

type ApplicationCacheNetworkStateUpdatedEvent struct {
	Method string `json:"method"`
	Params struct {
		IsNowOnline bool `json:"isNowOnline"` //
	} `json:"Params,omitempty"`
}

type Audits

type Audits struct {
	// contains filtered or unexported fields
}

func NewAudits

func NewAudits(target gcdmessage.ChromeTargeter) *Audits

func (*Audits) Disable added in v1.0.9

func (c *Audits) Disable() (*gcdmessage.ChromeResponse, error)

Disables issues domain, prevents further issues from being reported to the client.

func (*Audits) Enable added in v1.0.9

func (c *Audits) Enable() (*gcdmessage.ChromeResponse, error)

Enables issues domain, sends the issues collected so far to the client by means of the `issueAdded` event.

func (*Audits) GetEncodedResponse

func (c *Audits) GetEncodedResponse(requestId string, encoding string, quality float64, sizeOnly bool) (string, int, int, error)

GetEncodedResponse - Returns the response body and size if it were re-encoded with the specified settings. Only applies to images. requestId - Identifier of the network request to get content for. encoding - The encoding to use. quality - The quality of the encoding (0-1). (defaults to 1) sizeOnly - Whether to only return the size information (defaults to false). Returns - body - The encoded body as a base64 string. Omitted if sizeOnly is true. originalSize - Size before re-encoding. encodedSize - Size after re-encoding.

func (*Audits) GetEncodedResponseWithParams

func (c *Audits) GetEncodedResponseWithParams(v *AuditsGetEncodedResponseParams) (string, int, int, error)

GetEncodedResponseWithParams - Returns the response body and size if it were re-encoded with the specified settings. Only applies to images. Returns - body - The encoded body as a base64 string. Omitted if sizeOnly is true. originalSize - Size before re-encoding. encodedSize - Size after re-encoding.

type AuditsAffectedCookie added in v1.0.9

type AuditsAffectedCookie struct {
	Name   string `json:"name"`   // The following three properties uniquely identify a cookie
	Path   string `json:"path"`   //
	Domain string `json:"domain"` //
}

Information about a cookie that is affected by an inspector issue.

type AuditsAffectedFrame added in v1.0.10

type AuditsAffectedFrame struct {
	FrameId string `json:"frameId"` //
}

Information about the frame affected by an inspector issue.

type AuditsAffectedRequest added in v1.0.9

type AuditsAffectedRequest struct {
	RequestId string `json:"requestId"`     // The unique request id.
	Url       string `json:"url,omitempty"` //
}

Information about a request that is affected by an inspector issue.

type AuditsBlockedByResponseIssueDetails added in v1.0.12

type AuditsBlockedByResponseIssueDetails struct {
	Request *AuditsAffectedRequest `json:"request"`         //
	Frame   *AuditsAffectedFrame   `json:"frame,omitempty"` //
	Reason  string                 `json:"reason"`          //  enum values: CoepFrameResourceNeedsCoepHeader, CoopSandboxedIFrameCannotNavigateToCoopPage, CorpNotSameOrigin, CorpNotSameOriginAfterDefaultedToSameOriginByCoep, CorpNotSameSite
}

Details for a request that has been blocked with the BLOCKED_BY_RESPONSE code. Currently only used for COEP/COOP, but may be extended to include some CSP errors in the future.

type AuditsContentSecurityPolicyIssueDetails added in v1.0.13

type AuditsContentSecurityPolicyIssueDetails struct {
	BlockedURL                         string               `json:"blockedURL,omitempty"`               // The url not included in allowed sources.
	ViolatedDirective                  string               `json:"violatedDirective"`                  // Specific directive that is violated, causing the CSP issue.
	ContentSecurityPolicyViolationType string               `json:"contentSecurityPolicyViolationType"` //  enum values: kInlineViolation, kEvalViolation, kURLViolation, kTrustedTypesSinkViolation, kTrustedTypesPolicyViolation
	FrameAncestor                      *AuditsAffectedFrame `json:"frameAncestor,omitempty"`            //
}

No Description.

type AuditsGetEncodedResponseParams

type AuditsGetEncodedResponseParams struct {
	// Identifier of the network request to get content for.
	RequestId string `json:"requestId"`
	// The encoding to use.
	Encoding string `json:"encoding"`
	// The quality of the encoding (0-1). (defaults to 1)
	Quality float64 `json:"quality,omitempty"`
	// Whether to only return the size information (defaults to false).
	SizeOnly bool `json:"sizeOnly,omitempty"`
}

type AuditsHeavyAdIssueDetails added in v1.0.13

type AuditsHeavyAdIssueDetails struct {
	Resolution string               `json:"resolution"` // The resolution status, either blocking the content or warning. enum values: HeavyAdBlocked, HeavyAdWarning
	Reason     string               `json:"reason"`     // The reason the ad was blocked, total network or cpu or peak cpu. enum values: NetworkTotalLimit, CpuTotalLimit, CpuPeakLimit
	Frame      *AuditsAffectedFrame `json:"frame"`      // The frame that was blocked.
}

No Description.

type AuditsInspectorIssue added in v1.0.9

type AuditsInspectorIssue struct {
	Code    string                       `json:"code"`    //  enum values: SameSiteCookieIssue, MixedContentIssue, BlockedByResponseIssue, HeavyAdIssue, ContentSecurityPolicyIssue
	Details *AuditsInspectorIssueDetails `json:"details"` //
}

An inspector issue reported from the back-end.

type AuditsInspectorIssueDetails added in v1.0.9

type AuditsInspectorIssueDetails struct {
	SameSiteCookieIssueDetails        *AuditsSameSiteCookieIssueDetails        `json:"sameSiteCookieIssueDetails,omitempty"`        //
	MixedContentIssueDetails          *AuditsMixedContentIssueDetails          `json:"mixedContentIssueDetails,omitempty"`          //
	BlockedByResponseIssueDetails     *AuditsBlockedByResponseIssueDetails     `json:"blockedByResponseIssueDetails,omitempty"`     //
	HeavyAdIssueDetails               *AuditsHeavyAdIssueDetails               `json:"heavyAdIssueDetails,omitempty"`               //
	ContentSecurityPolicyIssueDetails *AuditsContentSecurityPolicyIssueDetails `json:"contentSecurityPolicyIssueDetails,omitempty"` //
}

This struct holds a list of optional fields with additional information specific to the kind of issue. When adding a new issue code, please also add a new optional field to this type.

type AuditsIssueAddedEvent added in v1.0.9

type AuditsIssueAddedEvent struct {
	Method string `json:"method"`
	Params struct {
		Issue *AuditsInspectorIssue `json:"issue"` //
	} `json:"Params,omitempty"`
}

type AuditsMixedContentIssueDetails added in v1.0.10

type AuditsMixedContentIssueDetails struct {
	ResourceType     string                 `json:"resourceType,omitempty"` // The type of resource causing the mixed content issue (css, js, iframe, form,...). Marked as optional because it is mapped to from blink::mojom::RequestContextType, which will be replaced by network::mojom::RequestDestination enum values: Audio, Beacon, CSPReport, Download, EventSource, Favicon, Font, Form, Frame, Image, Import, Manifest, Ping, PluginData, PluginResource, Prefetch, Resource, Script, ServiceWorker, SharedWorker, Stylesheet, Track, Video, Worker, XMLHttpRequest, XSLT
	ResolutionStatus string                 `json:"resolutionStatus"`       // The way the mixed content issue is being resolved. enum values: MixedContentBlocked, MixedContentAutomaticallyUpgraded, MixedContentWarning
	InsecureURL      string                 `json:"insecureURL"`            // The unsafe http url causing the mixed content issue.
	MainResourceURL  string                 `json:"mainResourceURL"`        // The url responsible for the call to an unsafe url.
	Request          *AuditsAffectedRequest `json:"request,omitempty"`      // The mixed content request. Does not always exist (e.g. for unsafe form submission urls).
	Frame            *AuditsAffectedFrame   `json:"frame,omitempty"`        // Optional because not every mixed content issue is necessarily linked to a frame.
}

No Description.

type AuditsSameSiteCookieIssueDetails added in v1.0.9

type AuditsSameSiteCookieIssueDetails struct {
	Cookie                 *AuditsAffectedCookie  `json:"cookie"`                   //
	CookieWarningReasons   []string               `json:"cookieWarningReasons"`     //  enum values: WarnSameSiteUnspecifiedCrossSiteContext, WarnSameSiteNoneInsecure, WarnSameSiteUnspecifiedLaxAllowUnsafe, WarnSameSiteStrictLaxDowngradeStrict, WarnSameSiteStrictCrossDowngradeStrict, WarnSameSiteStrictCrossDowngradeLax, WarnSameSiteLaxCrossDowngradeStrict, WarnSameSiteLaxCrossDowngradeLax
	CookieExclusionReasons []string               `json:"cookieExclusionReasons"`   //  enum values: ExcludeSameSiteUnspecifiedTreatedAsLax, ExcludeSameSiteNoneInsecure
	Operation              string                 `json:"operation"`                // Optionally identifies the site-for-cookies and the cookie url, which may be used by the front-end as additional context. enum values: SetCookie, ReadCookie
	SiteForCookies         string                 `json:"siteForCookies,omitempty"` //
	CookieUrl              string                 `json:"cookieUrl,omitempty"`      //
	Request                *AuditsAffectedRequest `json:"request,omitempty"`        //
}

This information is currently necessary, as the front-end has a difficult time finding a specific cookie. With this, we can convey specific error information without the cookie.

type BackgroundService added in v1.0.3

type BackgroundService struct {
	// contains filtered or unexported fields
}

func NewBackgroundService added in v1.0.3

func NewBackgroundService(target gcdmessage.ChromeTargeter) *BackgroundService

func (*BackgroundService) ClearEvents added in v1.0.3

func (c *BackgroundService) ClearEvents(service string) (*gcdmessage.ChromeResponse, error)

ClearEvents - Clears all stored data for the service. service - enum values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler, periodicBackgroundSync

func (*BackgroundService) ClearEventsWithParams added in v1.0.3

ClearEventsWithParams - Clears all stored data for the service.

func (*BackgroundService) SetRecording added in v1.0.3

func (c *BackgroundService) SetRecording(shouldRecord bool, service string) (*gcdmessage.ChromeResponse, error)

SetRecording - Set the recording state for the service. shouldRecord - service - enum values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler, periodicBackgroundSync

func (*BackgroundService) SetRecordingWithParams added in v1.0.3

SetRecordingWithParams - Set the recording state for the service.

func (*BackgroundService) StartObserving added in v1.0.3

func (c *BackgroundService) StartObserving(service string) (*gcdmessage.ChromeResponse, error)

StartObserving - Enables event updates for the service. service - enum values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler, periodicBackgroundSync

func (*BackgroundService) StartObservingWithParams added in v1.0.3

StartObservingWithParams - Enables event updates for the service.

func (*BackgroundService) StopObserving added in v1.0.3

func (c *BackgroundService) StopObserving(service string) (*gcdmessage.ChromeResponse, error)

StopObserving - Disables event updates for the service. service - enum values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler, periodicBackgroundSync

func (*BackgroundService) StopObservingWithParams added in v1.0.3

StopObservingWithParams - Disables event updates for the service.

type BackgroundServiceBackgroundServiceEvent added in v1.0.3

type BackgroundServiceBackgroundServiceEvent struct {
	Timestamp                   float64                           `json:"timestamp"`                   // Timestamp of the event (in seconds).
	Origin                      string                            `json:"origin"`                      // The origin this event belongs to.
	ServiceWorkerRegistrationId string                            `json:"serviceWorkerRegistrationId"` // The Service Worker ID that initiated the event.
	Service                     string                            `json:"service"`                     // The Background Service this event belongs to. enum values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler, periodicBackgroundSync
	EventName                   string                            `json:"eventName"`                   // A description of the event.
	InstanceId                  string                            `json:"instanceId"`                  // An identifier that groups related events together.
	EventMetadata               []*BackgroundServiceEventMetadata `json:"eventMetadata"`               // A list of event-specific information.
}

No Description.

type BackgroundServiceBackgroundServiceEventReceivedEvent added in v1.0.3

type BackgroundServiceBackgroundServiceEventReceivedEvent struct {
	Method string `json:"method"`
	Params struct {
		BackgroundServiceEvent *BackgroundServiceBackgroundServiceEvent `json:"backgroundServiceEvent"` //
	} `json:"Params,omitempty"`
}

Called with all existing backgroundServiceEvents when enabled, and all new events afterwards if enabled and recording.

type BackgroundServiceClearEventsParams added in v1.0.3

type BackgroundServiceClearEventsParams struct {
	//  enum values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler, periodicBackgroundSync
	Service string `json:"service"`
}

type BackgroundServiceEventMetadata added in v1.0.3

type BackgroundServiceEventMetadata struct {
	Key   string `json:"key"`   //
	Value string `json:"value"` //
}

A key-value pair for additional event information to pass along.

type BackgroundServiceRecordingStateChangedEvent added in v1.0.3

type BackgroundServiceRecordingStateChangedEvent struct {
	Method string `json:"method"`
	Params struct {
		IsRecording bool   `json:"isRecording"` //
		Service     string `json:"service"`     //  enum values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler, periodicBackgroundSync
	} `json:"Params,omitempty"`
}

Called when the recording state for the service has been updated.

type BackgroundServiceSetRecordingParams added in v1.0.3

type BackgroundServiceSetRecordingParams struct {
	//
	ShouldRecord bool `json:"shouldRecord"`
	//  enum values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler, periodicBackgroundSync
	Service string `json:"service"`
}

type BackgroundServiceStartObservingParams added in v1.0.3

type BackgroundServiceStartObservingParams struct {
	//  enum values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler, periodicBackgroundSync
	Service string `json:"service"`
}

type BackgroundServiceStopObservingParams added in v1.0.3

type BackgroundServiceStopObservingParams struct {
	//  enum values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler, periodicBackgroundSync
	Service string `json:"service"`
}

type Browser

type Browser struct {
	// contains filtered or unexported fields
}

func NewBrowser

func NewBrowser(target gcdmessage.ChromeTargeter) *Browser

func (*Browser) Close

func (c *Browser) Close() (*gcdmessage.ChromeResponse, error)

Close browser gracefully.

func (*Browser) Crash

func (c *Browser) Crash() (*gcdmessage.ChromeResponse, error)

Crashes browser on the main thread.

func (*Browser) CrashGpuProcess added in v1.0.3

func (c *Browser) CrashGpuProcess() (*gcdmessage.ChromeResponse, error)

Crashes GPU process.

func (*Browser) GetBrowserCommandLine

func (c *Browser) GetBrowserCommandLine() ([]string, error)

GetBrowserCommandLine - Returns the command line switches for the browser process if, and only if --enable-automation is on the commandline. Returns - arguments - Commandline parameters

func (*Browser) GetHistogram

func (c *Browser) GetHistogram(name string, delta bool) (*BrowserHistogram, error)

GetHistogram - Get a Chrome histogram by name. name - Requested histogram name. delta - If true, retrieve delta since last call. Returns - histogram - Histogram.

func (*Browser) GetHistogramWithParams

func (c *Browser) GetHistogramWithParams(v *BrowserGetHistogramParams) (*BrowserHistogram, error)

GetHistogramWithParams - Get a Chrome histogram by name. Returns - histogram - Histogram.

func (*Browser) GetHistograms

func (c *Browser) GetHistograms(query string, delta bool) ([]*BrowserHistogram, error)

GetHistograms - Get Chrome histograms. query - Requested substring in name. Only histograms which have query as a substring in their name are extracted. An empty or absent query returns all histograms. delta - If true, retrieve delta since last call. Returns - histograms - Histograms.

func (*Browser) GetHistogramsWithParams

func (c *Browser) GetHistogramsWithParams(v *BrowserGetHistogramsParams) ([]*BrowserHistogram, error)

GetHistogramsWithParams - Get Chrome histograms. Returns - histograms - Histograms.

func (*Browser) GetVersion

func (c *Browser) GetVersion() (string, string, string, string, string, error)

GetVersion - Returns version information. Returns - protocolVersion - Protocol version. product - Product name. revision - Product revision. userAgent - User-Agent. jsVersion - V8 version.

func (*Browser) GetWindowBounds

func (c *Browser) GetWindowBounds(windowId int) (*BrowserBounds, error)

GetWindowBounds - Get position and size of the browser window. windowId - Browser window id. Returns - bounds - Bounds information of the window. When window state is 'minimized', the restored window position and size are returned.

func (*Browser) GetWindowBoundsWithParams

func (c *Browser) GetWindowBoundsWithParams(v *BrowserGetWindowBoundsParams) (*BrowserBounds, error)

GetWindowBoundsWithParams - Get position and size of the browser window. Returns - bounds - Bounds information of the window. When window state is 'minimized', the restored window position and size are returned.

func (*Browser) GetWindowForTarget

func (c *Browser) GetWindowForTarget(targetId string) (int, *BrowserBounds, error)

GetWindowForTarget - Get the browser window that contains the devtools target. targetId - Devtools agent host id. If called as a part of the session, associated targetId is used. Returns - windowId - Browser window id. bounds - Bounds information of the window. When window state is 'minimized', the restored window position and size are returned.

func (*Browser) GetWindowForTargetWithParams

func (c *Browser) GetWindowForTargetWithParams(v *BrowserGetWindowForTargetParams) (int, *BrowserBounds, error)

GetWindowForTargetWithParams - Get the browser window that contains the devtools target. Returns - windowId - Browser window id. bounds - Bounds information of the window. When window state is 'minimized', the restored window position and size are returned.

func (*Browser) GrantPermissions

func (c *Browser) GrantPermissions(permissions []string, origin string, browserContextId string) (*gcdmessage.ChromeResponse, error)

GrantPermissions - Grant specific permissions to the given origin and reject all others. permissions - enum values: accessibilityEvents, audioCapture, backgroundSync, backgroundFetch, clipboardReadWrite, clipboardSanitizedWrite, durableStorage, flash, geolocation, midi, midiSysex, nfc, notifications, paymentHandler, periodicBackgroundSync, protectedMediaIdentifier, sensors, videoCapture, idleDetection, wakeLockScreen, wakeLockSystem origin - Origin the permission applies to, all origins if not specified. browserContextId - BrowserContext to override permissions. When omitted, default browser context is used.

func (*Browser) GrantPermissionsWithParams

func (c *Browser) GrantPermissionsWithParams(v *BrowserGrantPermissionsParams) (*gcdmessage.ChromeResponse, error)

GrantPermissionsWithParams - Grant specific permissions to the given origin and reject all others.

func (*Browser) ResetPermissions

func (c *Browser) ResetPermissions(browserContextId string) (*gcdmessage.ChromeResponse, error)

ResetPermissions - Reset all permission management for all origins. browserContextId - BrowserContext to reset permissions. When omitted, default browser context is used.

func (*Browser) ResetPermissionsWithParams

func (c *Browser) ResetPermissionsWithParams(v *BrowserResetPermissionsParams) (*gcdmessage.ChromeResponse, error)

ResetPermissionsWithParams - Reset all permission management for all origins.

func (*Browser) SetDockTile added in v1.0.3

func (c *Browser) SetDockTile(badgeLabel string, image string) (*gcdmessage.ChromeResponse, error)

SetDockTile - Set dock tile details, platform-specific. badgeLabel - image - Png encoded image.

func (*Browser) SetDockTileWithParams added in v1.0.3

func (c *Browser) SetDockTileWithParams(v *BrowserSetDockTileParams) (*gcdmessage.ChromeResponse, error)

SetDockTileWithParams - Set dock tile details, platform-specific.

func (*Browser) SetDownloadBehavior added in v1.0.9

func (c *Browser) SetDownloadBehavior(behavior string, browserContextId string, downloadPath string) (*gcdmessage.ChromeResponse, error)

SetDownloadBehavior - Set the behavior when downloading a file. behavior - Whether to allow all or deny all download requests, or use default Chrome behavior if available (otherwise deny). |allowAndName| allows download and names files according to their dowmload guids. browserContextId - BrowserContext to set download behavior. When omitted, default browser context is used. downloadPath - The default path to save downloaded files to. This is requred if behavior is set to 'allow' or 'allowAndName'.

func (*Browser) SetDownloadBehaviorWithParams added in v1.0.9

func (c *Browser) SetDownloadBehaviorWithParams(v *BrowserSetDownloadBehaviorParams) (*gcdmessage.ChromeResponse, error)

SetDownloadBehaviorWithParams - Set the behavior when downloading a file.

func (*Browser) SetPermission added in v1.0.9

func (c *Browser) SetPermission(permission *BrowserPermissionDescriptor, setting string, origin string, browserContextId string) (*gcdmessage.ChromeResponse, error)

SetPermission - Set permission settings for given origin. permission - Descriptor of permission to override. setting - Setting of the permission. enum values: granted, denied, prompt origin - Origin the permission applies to, all origins if not specified. browserContextId - Context to override. When omitted, default browser context is used.

func (*Browser) SetPermissionWithParams added in v1.0.9

func (c *Browser) SetPermissionWithParams(v *BrowserSetPermissionParams) (*gcdmessage.ChromeResponse, error)

SetPermissionWithParams - Set permission settings for given origin.

func (*Browser) SetWindowBounds

func (c *Browser) SetWindowBounds(windowId int, bounds *BrowserBounds) (*gcdmessage.ChromeResponse, error)

SetWindowBounds - Set position and/or size of the browser window. windowId - Browser window id. bounds - New window bounds. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'. Leaves unspecified fields unchanged.

func (*Browser) SetWindowBoundsWithParams

func (c *Browser) SetWindowBoundsWithParams(v *BrowserSetWindowBoundsParams) (*gcdmessage.ChromeResponse, error)

SetWindowBoundsWithParams - Set position and/or size of the browser window.

type BrowserBounds

type BrowserBounds struct {
	Left        int    `json:"left,omitempty"`        // The offset from the left edge of the screen to the window in pixels.
	Top         int    `json:"top,omitempty"`         // The offset from the top edge of the screen to the window in pixels.
	Width       int    `json:"width,omitempty"`       // The window width in pixels.
	Height      int    `json:"height,omitempty"`      // The window height in pixels.
	WindowState string `json:"windowState,omitempty"` // The window state. Default to normal. enum values: normal, minimized, maximized, fullscreen
}

Browser window bounds information

type BrowserBucket

type BrowserBucket struct {
	Low   int `json:"low"`   // Minimum value (inclusive).
	High  int `json:"high"`  // Maximum value (exclusive).
	Count int `json:"count"` // Number of samples.
}

Chrome histogram bucket.

type BrowserGetHistogramParams

type BrowserGetHistogramParams struct {
	// Requested histogram name.
	Name string `json:"name"`
	// If true, retrieve delta since last call.
	Delta bool `json:"delta,omitempty"`
}

type BrowserGetHistogramsParams

type BrowserGetHistogramsParams struct {
	// Requested substring in name. Only histograms which have query as a substring in their name are extracted. An empty or absent query returns all histograms.
	Query string `json:"query,omitempty"`
	// If true, retrieve delta since last call.
	Delta bool `json:"delta,omitempty"`
}

type BrowserGetWindowBoundsParams

type BrowserGetWindowBoundsParams struct {
	// Browser window id.
	WindowId int `json:"windowId"`
}

type BrowserGetWindowForTargetParams

type BrowserGetWindowForTargetParams struct {
	// Devtools agent host id. If called as a part of the session, associated targetId is used.
	TargetId string `json:"targetId,omitempty"`
}

type BrowserGrantPermissionsParams

type BrowserGrantPermissionsParams struct {
	//  enum values: accessibilityEvents, audioCapture, backgroundSync, backgroundFetch, clipboardReadWrite, clipboardSanitizedWrite, durableStorage, flash, geolocation, midi, midiSysex, nfc, notifications, paymentHandler, periodicBackgroundSync, protectedMediaIdentifier, sensors, videoCapture, idleDetection, wakeLockScreen, wakeLockSystem
	Permissions []string `json:"permissions"`
	// Origin the permission applies to, all origins if not specified.
	Origin string `json:"origin,omitempty"`
	// BrowserContext to override permissions. When omitted, default browser context is used.
	BrowserContextId string `json:"browserContextId,omitempty"`
}

type BrowserHistogram

type BrowserHistogram struct {
	Name    string           `json:"name"`    // Name.
	Sum     int              `json:"sum"`     // Sum of sample values.
	Count   int              `json:"count"`   // Total number of samples.
	Buckets []*BrowserBucket `json:"buckets"` // Buckets.
}

Chrome histogram.

type BrowserPermissionDescriptor added in v1.0.9

type BrowserPermissionDescriptor struct {
	Name                     string `json:"name"`                               // Name of permission. See https://cs.chromium.org/chromium/src/third_party/blink/renderer/modules/permissions/permission_descriptor.idl for valid permission names.
	Sysex                    bool   `json:"sysex,omitempty"`                    // For "midi" permission, may also specify sysex control.
	UserVisibleOnly          bool   `json:"userVisibleOnly,omitempty"`          // For "push" permission, may specify userVisibleOnly. Note that userVisibleOnly = true is the only currently supported type.
	Type                     string `json:"type,omitempty"`                     // For "wake-lock" permission, must specify type as either "screen" or "system".
	AllowWithoutSanitization bool   `json:"allowWithoutSanitization,omitempty"` // For "clipboard" permission, may specify allowWithoutSanitization.
}

Definition of PermissionDescriptor defined in the Permissions API: https://w3c.github.io/permissions/#dictdef-permissiondescriptor.

type BrowserResetPermissionsParams

type BrowserResetPermissionsParams struct {
	// BrowserContext to reset permissions. When omitted, default browser context is used.
	BrowserContextId string `json:"browserContextId,omitempty"`
}

type BrowserSetDockTileParams added in v1.0.3

type BrowserSetDockTileParams struct {
	//
	BadgeLabel string `json:"badgeLabel,omitempty"`
	// Png encoded image.
	Image string `json:"image,omitempty"`
}

type BrowserSetDownloadBehaviorParams added in v1.0.9

type BrowserSetDownloadBehaviorParams struct {
	// Whether to allow all or deny all download requests, or use default Chrome behavior if available (otherwise deny). |allowAndName| allows download and names files according to their dowmload guids.
	Behavior string `json:"behavior"`
	// BrowserContext to set download behavior. When omitted, default browser context is used.
	BrowserContextId string `json:"browserContextId,omitempty"`
	// The default path to save downloaded files to. This is requred if behavior is set to 'allow' or 'allowAndName'.
	DownloadPath string `json:"downloadPath,omitempty"`
}

type BrowserSetPermissionParams added in v1.0.9

type BrowserSetPermissionParams struct {
	// Descriptor of permission to override.
	Permission *BrowserPermissionDescriptor `json:"permission"`
	// Setting of the permission. enum values: granted, denied, prompt
	Setting string `json:"setting"`
	// Origin the permission applies to, all origins if not specified.
	Origin string `json:"origin,omitempty"`
	// Context to override. When omitted, default browser context is used.
	BrowserContextId string `json:"browserContextId,omitempty"`
}

type BrowserSetWindowBoundsParams

type BrowserSetWindowBoundsParams struct {
	// Browser window id.
	WindowId int `json:"windowId"`
	// New window bounds. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'. Leaves unspecified fields unchanged.
	Bounds *BrowserBounds `json:"bounds"`
}

type CSS

type CSS struct {
	// contains filtered or unexported fields
}

func NewCSS

func NewCSS(target gcdmessage.ChromeTargeter) *CSS

func (*CSS) AddRule

func (c *CSS) AddRule(styleSheetId string, ruleText string, location *CSSSourceRange) (*CSSCSSRule, error)

AddRule - Inserts a new rule with the given `ruleText` in a stylesheet with given `styleSheetId`, at the position specified by `location`. styleSheetId - The css style sheet identifier where a new rule should be inserted. ruleText - The text of a new rule. location - Text position of a new rule in the target style sheet. Returns - rule - The newly created rule.

func (*CSS) AddRuleWithParams

func (c *CSS) AddRuleWithParams(v *CSSAddRuleParams) (*CSSCSSRule, error)

AddRuleWithParams - Inserts a new rule with the given `ruleText` in a stylesheet with given `styleSheetId`, at the position specified by `location`. Returns - rule - The newly created rule.

func (*CSS) CollectClassNames

func (c *CSS) CollectClassNames(styleSheetId string) ([]string, error)

CollectClassNames - Returns all class names from specified stylesheet. styleSheetId - Returns - classNames - Class name list.

func (*CSS) CollectClassNamesWithParams

func (c *CSS) CollectClassNamesWithParams(v *CSSCollectClassNamesParams) ([]string, error)

CollectClassNamesWithParams - Returns all class names from specified stylesheet. Returns - classNames - Class name list.

func (*CSS) CreateStyleSheet

func (c *CSS) CreateStyleSheet(frameId string) (string, error)

CreateStyleSheet - Creates a new special "via-inspector" stylesheet in the frame with given `frameId`. frameId - Identifier of the frame where "via-inspector" stylesheet should be created. Returns - styleSheetId - Identifier of the created "via-inspector" stylesheet.

func (*CSS) CreateStyleSheetWithParams

func (c *CSS) CreateStyleSheetWithParams(v *CSSCreateStyleSheetParams) (string, error)

CreateStyleSheetWithParams - Creates a new special "via-inspector" stylesheet in the frame with given `frameId`. Returns - styleSheetId - Identifier of the created "via-inspector" stylesheet.

func (*CSS) Disable

func (c *CSS) Disable() (*gcdmessage.ChromeResponse, error)

Disables the CSS agent for the given page.

func (*CSS) Enable

func (c *CSS) Enable() (*gcdmessage.ChromeResponse, error)

Enables the CSS agent for the given page. Clients should not assume that the CSS agent has been enabled until the result of this command is received.

func (*CSS) ForcePseudoState

func (c *CSS) ForcePseudoState(nodeId int, forcedPseudoClasses []string) (*gcdmessage.ChromeResponse, error)

ForcePseudoState - Ensures that the given node will have specified pseudo-classes whenever its style is computed by the browser. nodeId - The element id for which to force the pseudo state. forcedPseudoClasses - Element pseudo classes to force when computing the element's style.

func (*CSS) ForcePseudoStateWithParams

func (c *CSS) ForcePseudoStateWithParams(v *CSSForcePseudoStateParams) (*gcdmessage.ChromeResponse, error)

ForcePseudoStateWithParams - Ensures that the given node will have specified pseudo-classes whenever its style is computed by the browser.

func (*CSS) GetBackgroundColors

func (c *CSS) GetBackgroundColors(nodeId int) ([]string, string, string, error)

GetBackgroundColors - nodeId - Id of the node to get background colors for. Returns - backgroundColors - The range of background colors behind this element, if it contains any visible text. If no visible text is present, this will be undefined. In the case of a flat background color, this will consist of simply that color. In the case of a gradient, this will consist of each of the color stops. For anything more complicated, this will be an empty array. Images will be ignored (as if the image had failed to load). computedFontSize - The computed font size for this node, as a CSS computed value string (e.g. '12px'). computedFontWeight - The computed font weight for this node, as a CSS computed value string (e.g. 'normal' or '100').

func (*CSS) GetBackgroundColorsWithParams

func (c *CSS) GetBackgroundColorsWithParams(v *CSSGetBackgroundColorsParams) ([]string, string, string, error)

GetBackgroundColorsWithParams - Returns - backgroundColors - The range of background colors behind this element, if it contains any visible text. If no visible text is present, this will be undefined. In the case of a flat background color, this will consist of simply that color. In the case of a gradient, this will consist of each of the color stops. For anything more complicated, this will be an empty array. Images will be ignored (as if the image had failed to load). computedFontSize - The computed font size for this node, as a CSS computed value string (e.g. '12px'). computedFontWeight - The computed font weight for this node, as a CSS computed value string (e.g. 'normal' or '100').

func (*CSS) GetComputedStyleForNode

func (c *CSS) GetComputedStyleForNode(nodeId int) ([]*CSSCSSComputedStyleProperty, error)

GetComputedStyleForNode - Returns the computed style for a DOM node identified by `nodeId`. nodeId - Returns - computedStyle - Computed style for the specified DOM node.

func (*CSS) GetComputedStyleForNodeWithParams

func (c *CSS) GetComputedStyleForNodeWithParams(v *CSSGetComputedStyleForNodeParams) ([]*CSSCSSComputedStyleProperty, error)

GetComputedStyleForNodeWithParams - Returns the computed style for a DOM node identified by `nodeId`. Returns - computedStyle - Computed style for the specified DOM node.

func (*CSS) GetInlineStylesForNode

func (c *CSS) GetInlineStylesForNode(nodeId int) (*CSSCSSStyle, *CSSCSSStyle, error)

GetInlineStylesForNode - Returns the styles defined inline (explicitly in the "style" attribute and implicitly, using DOM attributes) for a DOM node identified by `nodeId`. nodeId - Returns - inlineStyle - Inline style for the specified DOM node. attributesStyle - Attribute-defined element style (e.g. resulting from "width=20 height=100%").

func (*CSS) GetInlineStylesForNodeWithParams

func (c *CSS) GetInlineStylesForNodeWithParams(v *CSSGetInlineStylesForNodeParams) (*CSSCSSStyle, *CSSCSSStyle, error)

GetInlineStylesForNodeWithParams - Returns the styles defined inline (explicitly in the "style" attribute and implicitly, using DOM attributes) for a DOM node identified by `nodeId`. Returns - inlineStyle - Inline style for the specified DOM node. attributesStyle - Attribute-defined element style (e.g. resulting from "width=20 height=100%").

func (*CSS) GetMatchedStylesForNode

func (c *CSS) GetMatchedStylesForNode(nodeId int) (*CSSCSSStyle, *CSSCSSStyle, []*CSSRuleMatch, []*CSSPseudoElementMatches, []*CSSInheritedStyleEntry, []*CSSCSSKeyframesRule, error)

GetMatchedStylesForNode - Returns requested styles for a DOM node identified by `nodeId`. nodeId - Returns - inlineStyle - Inline style for the specified DOM node. attributesStyle - Attribute-defined element style (e.g. resulting from "width=20 height=100%"). matchedCSSRules - CSS rules matching this node, from all applicable stylesheets. pseudoElements - Pseudo style matches for this node. inherited - A chain of inherited styles (from the immediate node parent up to the DOM tree root). cssKeyframesRules - A list of CSS keyframed animations matching this node.

func (*CSS) GetMatchedStylesForNodeWithParams

GetMatchedStylesForNodeWithParams - Returns requested styles for a DOM node identified by `nodeId`. Returns - inlineStyle - Inline style for the specified DOM node. attributesStyle - Attribute-defined element style (e.g. resulting from "width=20 height=100%"). matchedCSSRules - CSS rules matching this node, from all applicable stylesheets. pseudoElements - Pseudo style matches for this node. inherited - A chain of inherited styles (from the immediate node parent up to the DOM tree root). cssKeyframesRules - A list of CSS keyframed animations matching this node.

func (*CSS) GetMediaQueries

func (c *CSS) GetMediaQueries() ([]*CSSCSSMedia, error)

GetMediaQueries - Returns all media queries parsed by the rendering engine. Returns - medias -

func (*CSS) GetPlatformFontsForNode

func (c *CSS) GetPlatformFontsForNode(nodeId int) ([]*CSSPlatformFontUsage, error)

GetPlatformFontsForNode - Requests information about platform fonts which we used to render child TextNodes in the given node. nodeId - Returns - fonts - Usage statistics for every employed platform font.

func (*CSS) GetPlatformFontsForNodeWithParams

func (c *CSS) GetPlatformFontsForNodeWithParams(v *CSSGetPlatformFontsForNodeParams) ([]*CSSPlatformFontUsage, error)

GetPlatformFontsForNodeWithParams - Requests information about platform fonts which we used to render child TextNodes in the given node. Returns - fonts - Usage statistics for every employed platform font.

func (*CSS) GetStyleSheetText

func (c *CSS) GetStyleSheetText(styleSheetId string) (string, error)

GetStyleSheetText - Returns the current textual content for a stylesheet. styleSheetId - Returns - text - The stylesheet text.

func (*CSS) GetStyleSheetTextWithParams

func (c *CSS) GetStyleSheetTextWithParams(v *CSSGetStyleSheetTextParams) (string, error)

GetStyleSheetTextWithParams - Returns the current textual content for a stylesheet. Returns - text - The stylesheet text.

func (*CSS) SetEffectivePropertyValueForNode

func (c *CSS) SetEffectivePropertyValueForNode(nodeId int, propertyName string, value string) (*gcdmessage.ChromeResponse, error)

SetEffectivePropertyValueForNode - Find a rule with the given active property for the given node and set the new value for this property nodeId - The element id for which to set property. propertyName - value -

func (*CSS) SetEffectivePropertyValueForNodeWithParams

func (c *CSS) SetEffectivePropertyValueForNodeWithParams(v *CSSSetEffectivePropertyValueForNodeParams) (*gcdmessage.ChromeResponse, error)

SetEffectivePropertyValueForNodeWithParams - Find a rule with the given active property for the given node and set the new value for this property

func (*CSS) SetKeyframeKey

func (c *CSS) SetKeyframeKey(styleSheetId string, theRange *CSSSourceRange, keyText string) (*CSSValue, error)

SetKeyframeKey - Modifies the keyframe rule key text. styleSheetId - range - keyText - Returns - keyText - The resulting key text after modification.

func (*CSS) SetKeyframeKeyWithParams

func (c *CSS) SetKeyframeKeyWithParams(v *CSSSetKeyframeKeyParams) (*CSSValue, error)

SetKeyframeKeyWithParams - Modifies the keyframe rule key text. Returns - keyText - The resulting key text after modification.

func (*CSS) SetLocalFontsEnabled added in v1.0.13

func (c *CSS) SetLocalFontsEnabled(enabled bool) (*gcdmessage.ChromeResponse, error)

SetLocalFontsEnabled - Enables/disables rendering of local CSS fonts (enabled by default). enabled - Whether rendering of local fonts is enabled.

func (*CSS) SetLocalFontsEnabledWithParams added in v1.0.13

func (c *CSS) SetLocalFontsEnabledWithParams(v *CSSSetLocalFontsEnabledParams) (*gcdmessage.ChromeResponse, error)

SetLocalFontsEnabledWithParams - Enables/disables rendering of local CSS fonts (enabled by default).

func (*CSS) SetMediaText

func (c *CSS) SetMediaText(styleSheetId string, theRange *CSSSourceRange, text string) (*CSSCSSMedia, error)

SetMediaText - Modifies the rule selector. styleSheetId - range - text - Returns - media - The resulting CSS media rule after modification.

func (*CSS) SetMediaTextWithParams

func (c *CSS) SetMediaTextWithParams(v *CSSSetMediaTextParams) (*CSSCSSMedia, error)

SetMediaTextWithParams - Modifies the rule selector. Returns - media - The resulting CSS media rule after modification.

func (*CSS) SetRuleSelector

func (c *CSS) SetRuleSelector(styleSheetId string, theRange *CSSSourceRange, selector string) (*CSSSelectorList, error)

SetRuleSelector - Modifies the rule selector. styleSheetId - range - selector - Returns - selectorList - The resulting selector list after modification.

func (*CSS) SetRuleSelectorWithParams

func (c *CSS) SetRuleSelectorWithParams(v *CSSSetRuleSelectorParams) (*CSSSelectorList, error)

SetRuleSelectorWithParams - Modifies the rule selector. Returns - selectorList - The resulting selector list after modification.

func (*CSS) SetStyleSheetText

func (c *CSS) SetStyleSheetText(styleSheetId string, text string) (string, error)

SetStyleSheetText - Sets the new stylesheet text. styleSheetId - text - Returns - sourceMapURL - URL of source map associated with script (if any).

func (*CSS) SetStyleSheetTextWithParams

func (c *CSS) SetStyleSheetTextWithParams(v *CSSSetStyleSheetTextParams) (string, error)

SetStyleSheetTextWithParams - Sets the new stylesheet text. Returns - sourceMapURL - URL of source map associated with script (if any).

func (*CSS) SetStyleTexts

func (c *CSS) SetStyleTexts(edits []*CSSStyleDeclarationEdit) ([]*CSSCSSStyle, error)

SetStyleTexts - Applies specified style edits one after another in the given order. edits - Returns - styles - The resulting styles after modification.

func (*CSS) SetStyleTextsWithParams

func (c *CSS) SetStyleTextsWithParams(v *CSSSetStyleTextsParams) ([]*CSSCSSStyle, error)

SetStyleTextsWithParams - Applies specified style edits one after another in the given order. Returns - styles - The resulting styles after modification.

func (*CSS) StartRuleUsageTracking

func (c *CSS) StartRuleUsageTracking() (*gcdmessage.ChromeResponse, error)

Enables the selector recording.

func (*CSS) StopRuleUsageTracking

func (c *CSS) StopRuleUsageTracking() ([]*CSSRuleUsage, error)

StopRuleUsageTracking - Stop tracking rule usage and return the list of rules that were used since last call to `takeCoverageDelta` (or since start of coverage instrumentation) Returns - ruleUsage -

func (*CSS) TakeCoverageDelta

func (c *CSS) TakeCoverageDelta() ([]*CSSRuleUsage, float64, error)

TakeCoverageDelta - Obtain list of rules that became used since last call to this method (or since start of coverage instrumentation) Returns - coverage - timestamp - Monotonically increasing time, in seconds.

type CSSAddRuleParams

type CSSAddRuleParams struct {
	// The css style sheet identifier where a new rule should be inserted.
	StyleSheetId string `json:"styleSheetId"`
	// The text of a new rule.
	RuleText string `json:"ruleText"`
	// Text position of a new rule in the target style sheet.
	Location *CSSSourceRange `json:"location"`
}

type CSSCSSComputedStyleProperty

type CSSCSSComputedStyleProperty struct {
	Name  string `json:"name"`  // Computed style property name.
	Value string `json:"value"` // Computed style property value.
}

No Description.

type CSSCSSKeyframeRule

type CSSCSSKeyframeRule struct {
	StyleSheetId string       `json:"styleSheetId,omitempty"` // The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.
	Origin       string       `json:"origin"`                 // Parent stylesheet's origin. enum values: injected, user-agent, inspector, regular
	KeyText      *CSSValue    `json:"keyText"`                // Associated key text.
	Style        *CSSCSSStyle `json:"style"`                  // Associated style declaration.
}

CSS keyframe rule representation.

type CSSCSSKeyframesRule

type CSSCSSKeyframesRule struct {
	AnimationName *CSSValue             `json:"animationName"` // Animation name.
	Keyframes     []*CSSCSSKeyframeRule `json:"keyframes"`     // List of keyframes.
}

CSS keyframes rule representation.

type CSSCSSMedia

type CSSCSSMedia struct {
	Text         string           `json:"text"`                   // Media query text.
	Source       string           `json:"source"`                 // Source of the media query: "mediaRule" if specified by a @media rule, "importRule" if specified by an @import rule, "linkedSheet" if specified by a "media" attribute in a linked stylesheet's LINK tag, "inlineSheet" if specified by a "media" attribute in an inline stylesheet's STYLE tag.
	SourceURL    string           `json:"sourceURL,omitempty"`    // URL of the document containing the media query description.
	Range        *CSSSourceRange  `json:"range,omitempty"`        // The associated rule (@media or @import) header range in the enclosing stylesheet (if available).
	StyleSheetId string           `json:"styleSheetId,omitempty"` // Identifier of the stylesheet containing this object (if exists).
	MediaList    []*CSSMediaQuery `json:"mediaList,omitempty"`    // Array of media queries.
}

CSS media rule descriptor.

type CSSCSSProperty

type CSSCSSProperty struct {
	Name      string          `json:"name"`                // The property name.
	Value     string          `json:"value"`               // The property value.
	Important bool            `json:"important,omitempty"` // Whether the property has "!important" annotation (implies `false` if absent).
	Implicit  bool            `json:"implicit,omitempty"`  // Whether the property is implicit (implies `false` if absent).
	Text      string          `json:"text,omitempty"`      // The full property text as specified in the style.
	ParsedOk  bool            `json:"parsedOk,omitempty"`  // Whether the property is understood by the browser (implies `true` if absent).
	Disabled  bool            `json:"disabled,omitempty"`  // Whether the property is disabled by the user (present for source-based properties only).
	Range     *CSSSourceRange `json:"range,omitempty"`     // The entire property range in the enclosing style declaration (if available).
}

CSS property declaration data.

type CSSCSSRule

type CSSCSSRule struct {
	StyleSheetId string           `json:"styleSheetId,omitempty"` // The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.
	SelectorList *CSSSelectorList `json:"selectorList"`           // Rule selector data.
	Origin       string           `json:"origin"`                 // Parent stylesheet's origin. enum values: injected, user-agent, inspector, regular
	Style        *CSSCSSStyle     `json:"style"`                  // Associated style declaration.
	Media        []*CSSCSSMedia   `json:"media,omitempty"`        // Media list array (for rules involving media queries). The array enumerates media queries starting with the innermost one, going outwards.
}

CSS rule representation.

type CSSCSSStyle

type CSSCSSStyle struct {
	StyleSheetId     string               `json:"styleSheetId,omitempty"` // The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.
	CssProperties    []*CSSCSSProperty    `json:"cssProperties"`          // CSS properties in the style.
	ShorthandEntries []*CSSShorthandEntry `json:"shorthandEntries"`       // Computed values for all shorthands found in the style.
	CssText          string               `json:"cssText,omitempty"`      // Style declaration text (if available).
	Range            *CSSSourceRange      `json:"range,omitempty"`        // Style declaration range in the enclosing stylesheet (if available).
}

CSS style representation.

type CSSCSSStyleSheetHeader

type CSSCSSStyleSheetHeader struct {
	StyleSheetId string  `json:"styleSheetId"`           // The stylesheet identifier.
	FrameId      string  `json:"frameId"`                // Owner frame identifier.
	SourceURL    string  `json:"sourceURL"`              // Stylesheet resource URL.
	SourceMapURL string  `json:"sourceMapURL,omitempty"` // URL of source map associated with the stylesheet (if any).
	Origin       string  `json:"origin"`                 // Stylesheet origin. enum values: injected, user-agent, inspector, regular
	Title        string  `json:"title"`                  // Stylesheet title.
	OwnerNode    int     `json:"ownerNode,omitempty"`    // The backend id for the owner node of the stylesheet.
	Disabled     bool    `json:"disabled"`               // Denotes whether the stylesheet is disabled.
	HasSourceURL bool    `json:"hasSourceURL,omitempty"` // Whether the sourceURL field value comes from the sourceURL comment.
	IsInline     bool    `json:"isInline"`               // Whether this stylesheet is created for STYLE tag by parser. This flag is not set for document.written STYLE tags.
	IsMutable    bool    `json:"isMutable"`              // Whether this stylesheet is mutable. Inline stylesheets become mutable after they have been modified via CSSOM API. <link> element's stylesheets are never mutable. Constructed stylesheets (new CSSStyleSheet()) are mutable immediately after creation.
	StartLine    float64 `json:"startLine"`              // Line offset of the stylesheet within the resource (zero based).
	StartColumn  float64 `json:"startColumn"`            // Column offset of the stylesheet within the resource (zero based).
	Length       float64 `json:"length"`                 // Size of the content (in characters).
	EndLine      float64 `json:"endLine"`                // Line offset of the end of the stylesheet within the resource (zero based).
	EndColumn    float64 `json:"endColumn"`              // Column offset of the end of the stylesheet within the resource (zero based).
}

CSS stylesheet metainformation.

type CSSCollectClassNamesParams

type CSSCollectClassNamesParams struct {
	//
	StyleSheetId string `json:"styleSheetId"`
}

type CSSCreateStyleSheetParams

type CSSCreateStyleSheetParams struct {
	// Identifier of the frame where "via-inspector" stylesheet should be created.
	FrameId string `json:"frameId"`
}

type CSSFontFace

type CSSFontFace struct {
	FontFamily         string `json:"fontFamily"`         // The font-family.
	FontStyle          string `json:"fontStyle"`          // The font-style.
	FontVariant        string `json:"fontVariant"`        // The font-variant.
	FontWeight         string `json:"fontWeight"`         // The font-weight.
	FontStretch        string `json:"fontStretch"`        // The font-stretch.
	UnicodeRange       string `json:"unicodeRange"`       // The unicode-range.
	Src                string `json:"src"`                // The src.
	PlatformFontFamily string `json:"platformFontFamily"` // The resolved platform font family
}

Properties of a web font: https://www.w3.org/TR/2008/REC-CSS2-20080411/fonts.html#font-descriptions

type CSSFontsUpdatedEvent

type CSSFontsUpdatedEvent struct {
	Method string `json:"method"`
	Params struct {
		Font *CSSFontFace `json:"font,omitempty"` // The web font that has loaded.
	} `json:"Params,omitempty"`
}

Fires whenever a web font is updated. A non-empty font parameter indicates a successfully loaded web font

type CSSForcePseudoStateParams

type CSSForcePseudoStateParams struct {
	// The element id for which to force the pseudo state.
	NodeId int `json:"nodeId"`
	// Element pseudo classes to force when computing the element's style.
	ForcedPseudoClasses []string `json:"forcedPseudoClasses"`
}

type CSSGetBackgroundColorsParams

type CSSGetBackgroundColorsParams struct {
	// Id of the node to get background colors for.
	NodeId int `json:"nodeId"`
}

type CSSGetComputedStyleForNodeParams

type CSSGetComputedStyleForNodeParams struct {
	//
	NodeId int `json:"nodeId"`
}

type CSSGetInlineStylesForNodeParams

type CSSGetInlineStylesForNodeParams struct {
	//
	NodeId int `json:"nodeId"`
}

type CSSGetMatchedStylesForNodeParams

type CSSGetMatchedStylesForNodeParams struct {
	//
	NodeId int `json:"nodeId"`
}

type CSSGetPlatformFontsForNodeParams

type CSSGetPlatformFontsForNodeParams struct {
	//
	NodeId int `json:"nodeId"`
}

type CSSGetStyleSheetTextParams

type CSSGetStyleSheetTextParams struct {
	//
	StyleSheetId string `json:"styleSheetId"`
}

type CSSInheritedStyleEntry

type CSSInheritedStyleEntry struct {
	InlineStyle     *CSSCSSStyle    `json:"inlineStyle,omitempty"` // The ancestor node's inline style, if any, in the style inheritance chain.
	MatchedCSSRules []*CSSRuleMatch `json:"matchedCSSRules"`       // Matches of CSS rules matching the ancestor node in the style inheritance chain.
}

Inherited CSS rule collection from ancestor node.

type CSSMediaQuery

type CSSMediaQuery struct {
	Expressions []*CSSMediaQueryExpression `json:"expressions"` // Array of media query expressions.
	Active      bool                       `json:"active"`      // Whether the media query condition is satisfied.
}

Media query descriptor.

type CSSMediaQueryExpression

type CSSMediaQueryExpression struct {
	Value          float64         `json:"value"`                    // Media query expression value.
	Unit           string          `json:"unit"`                     // Media query expression units.
	Feature        string          `json:"feature"`                  // Media query expression feature.
	ValueRange     *CSSSourceRange `json:"valueRange,omitempty"`     // The associated range of the value text in the enclosing stylesheet (if available).
	ComputedLength float64         `json:"computedLength,omitempty"` // Computed length of media query expression (if applicable).
}

Media query expression descriptor.

type CSSPlatformFontUsage

type CSSPlatformFontUsage struct {
	FamilyName   string  `json:"familyName"`   // Font's family name reported by platform.
	IsCustomFont bool    `json:"isCustomFont"` // Indicates if the font was downloaded or resolved locally.
	GlyphCount   float64 `json:"glyphCount"`   // Amount of glyphs that were rendered with this font.
}

Information about amount of glyphs that were rendered with given font.

type CSSPseudoElementMatches

type CSSPseudoElementMatches struct {
	PseudoType string          `json:"pseudoType"` // Pseudo element type. enum values: first-line, first-letter, before, after, marker, backdrop, selection, first-line-inherited, scrollbar, scrollbar-thumb, scrollbar-button, scrollbar-track, scrollbar-track-piece, scrollbar-corner, resizer, input-list-button
	Matches    []*CSSRuleMatch `json:"matches"`    // Matches of CSS rules applicable to the pseudo style.
}

CSS rule collection for a single pseudo style.

type CSSRuleMatch

type CSSRuleMatch struct {
	Rule              *CSSCSSRule `json:"rule"`              // CSS rule in the match.
	MatchingSelectors []int       `json:"matchingSelectors"` // Matching selector indices in the rule's selectorList selectors (0-based).
}

Match data for a CSS rule.

type CSSRuleUsage

type CSSRuleUsage struct {
	StyleSheetId string  `json:"styleSheetId"` // The css style sheet identifier (absent for user agent stylesheet and user-specified stylesheet rules) this rule came from.
	StartOffset  float64 `json:"startOffset"`  // Offset of the start of the rule (including selector) from the beginning of the stylesheet.
	EndOffset    float64 `json:"endOffset"`    // Offset of the end of the rule body from the beginning of the stylesheet.
	Used         bool    `json:"used"`         // Indicates whether the rule was actually used by some element in the page.
}

CSS coverage information.

type CSSSelectorList

type CSSSelectorList struct {
	Selectors []*CSSValue `json:"selectors"` // Selectors in the list.
	Text      string      `json:"text"`      // Rule selector text.
}

Selector list data.

type CSSSetEffectivePropertyValueForNodeParams

type CSSSetEffectivePropertyValueForNodeParams struct {
	// The element id for which to set property.
	NodeId int `json:"nodeId"`
	//
	PropertyName string `json:"propertyName"`
	//
	Value string `json:"value"`
}

type CSSSetKeyframeKeyParams

type CSSSetKeyframeKeyParams struct {
	//
	StyleSheetId string `json:"styleSheetId"`
	//
	TheRange *CSSSourceRange `json:"range"`
	//
	KeyText string `json:"keyText"`
}

type CSSSetLocalFontsEnabledParams added in v1.0.13

type CSSSetLocalFontsEnabledParams struct {
	// Whether rendering of local fonts is enabled.
	Enabled bool `json:"enabled"`
}

type CSSSetMediaTextParams

type CSSSetMediaTextParams struct {
	//
	StyleSheetId string `json:"styleSheetId"`
	//
	TheRange *CSSSourceRange `json:"range"`
	//
	Text string `json:"text"`
}

type CSSSetRuleSelectorParams

type CSSSetRuleSelectorParams struct {
	//
	StyleSheetId string `json:"styleSheetId"`
	//
	TheRange *CSSSourceRange `json:"range"`
	//
	Selector string `json:"selector"`
}

type CSSSetStyleSheetTextParams

type CSSSetStyleSheetTextParams struct {
	//
	StyleSheetId string `json:"styleSheetId"`
	//
	Text string `json:"text"`
}

type CSSSetStyleTextsParams

type CSSSetStyleTextsParams struct {
	//
	Edits []*CSSStyleDeclarationEdit `json:"edits"`
}

type CSSShorthandEntry

type CSSShorthandEntry struct {
	Name      string `json:"name"`                // Shorthand name.
	Value     string `json:"value"`               // Shorthand value.
	Important bool   `json:"important,omitempty"` // Whether the property has "!important" annotation (implies `false` if absent).
}

No Description.

type CSSSourceRange

type CSSSourceRange struct {
	StartLine   int `json:"startLine"`   // Start line of range.
	StartColumn int `json:"startColumn"` // Start column of range (inclusive).
	EndLine     int `json:"endLine"`     // End line of range
	EndColumn   int `json:"endColumn"`   // End column of range (exclusive).
}

Text range within a resource. All numbers are zero-based.

type CSSStyleDeclarationEdit

type CSSStyleDeclarationEdit struct {
	StyleSheetId string          `json:"styleSheetId"` // The css style sheet identifier.
	Range        *CSSSourceRange `json:"range"`        // The range of the style text in the enclosing stylesheet.
	Text         string          `json:"text"`         // New style text.
}

A descriptor of operation to mutate style declaration text.

type CSSStyleSheetAddedEvent

type CSSStyleSheetAddedEvent struct {
	Method string `json:"method"`
	Params struct {
		Header *CSSCSSStyleSheetHeader `json:"header"` // Added stylesheet metainfo.
	} `json:"Params,omitempty"`
}

Fired whenever an active document stylesheet is added.

type CSSStyleSheetChangedEvent

type CSSStyleSheetChangedEvent struct {
	Method string `json:"method"`
	Params struct {
		StyleSheetId string `json:"styleSheetId"` //
	} `json:"Params,omitempty"`
}

Fired whenever a stylesheet is changed as a result of the client operation.

type CSSStyleSheetRemovedEvent

type CSSStyleSheetRemovedEvent struct {
	Method string `json:"method"`
	Params struct {
		StyleSheetId string `json:"styleSheetId"` // Identifier of the removed stylesheet.
	} `json:"Params,omitempty"`
}

Fired whenever an active document stylesheet is removed.

type CSSValue

type CSSValue struct {
	Text  string          `json:"text"`            // Value text.
	Range *CSSSourceRange `json:"range,omitempty"` // Value range in the underlying resource (if available).
}

Data for a simple selector (these are delimited by commas in a selector list).

type CacheStorage

type CacheStorage struct {
	// contains filtered or unexported fields
}

func NewCacheStorage

func NewCacheStorage(target gcdmessage.ChromeTargeter) *CacheStorage

func (*CacheStorage) DeleteCache

func (c *CacheStorage) DeleteCache(cacheId string) (*gcdmessage.ChromeResponse, error)

DeleteCache - Deletes a cache. cacheId - Id of cache for deletion.

func (*CacheStorage) DeleteCacheWithParams

DeleteCacheWithParams - Deletes a cache.

func (*CacheStorage) DeleteEntry

func (c *CacheStorage) DeleteEntry(cacheId string, request string) (*gcdmessage.ChromeResponse, error)

DeleteEntry - Deletes a cache entry. cacheId - Id of cache where the entry will be deleted. request - URL spec of the request.

func (*CacheStorage) DeleteEntryWithParams

DeleteEntryWithParams - Deletes a cache entry.

func (*CacheStorage) RequestCacheNames

func (c *CacheStorage) RequestCacheNames(securityOrigin string) ([]*CacheStorageCache, error)

RequestCacheNames - Requests cache names. securityOrigin - Security origin. Returns - caches - Caches for the security origin.

func (*CacheStorage) RequestCacheNamesWithParams

func (c *CacheStorage) RequestCacheNamesWithParams(v *CacheStorageRequestCacheNamesParams) ([]*CacheStorageCache, error)

RequestCacheNamesWithParams - Requests cache names. Returns - caches - Caches for the security origin.

func (*CacheStorage) RequestCachedResponse

func (c *CacheStorage) RequestCachedResponse(cacheId string, requestURL string, requestHeaders []*CacheStorageHeader) (*CacheStorageCachedResponse, error)

RequestCachedResponse - Fetches cache entry. cacheId - Id of cache that contains the entry. requestURL - URL spec of the request. requestHeaders - headers of the request. Returns - response - Response read from the cache.

func (*CacheStorage) RequestCachedResponseWithParams

func (c *CacheStorage) RequestCachedResponseWithParams(v *CacheStorageRequestCachedResponseParams) (*CacheStorageCachedResponse, error)

RequestCachedResponseWithParams - Fetches cache entry. Returns - response - Response read from the cache.

func (*CacheStorage) RequestEntries

func (c *CacheStorage) RequestEntries(cacheId string, skipCount int, pageSize int, pathFilter string) ([]*CacheStorageDataEntry, float64, error)

RequestEntries - Requests data from cache. cacheId - ID of cache to get entries from. skipCount - Number of records to skip. pageSize - Number of records to fetch. pathFilter - If present, only return the entries containing this substring in the path Returns - cacheDataEntries - Array of object store data entries. returnCount - Count of returned entries from this storage. If pathFilter is empty, it is the count of all entries from this storage.

func (*CacheStorage) RequestEntriesWithParams

func (c *CacheStorage) RequestEntriesWithParams(v *CacheStorageRequestEntriesParams) ([]*CacheStorageDataEntry, float64, error)

RequestEntriesWithParams - Requests data from cache. Returns - cacheDataEntries - Array of object store data entries. returnCount - Count of returned entries from this storage. If pathFilter is empty, it is the count of all entries from this storage.

type CacheStorageCache

type CacheStorageCache struct {
	CacheId        string `json:"cacheId"`        // An opaque unique id of the cache.
	SecurityOrigin string `json:"securityOrigin"` // Security origin of the cache.
	CacheName      string `json:"cacheName"`      // The name of the cache.
}

Cache identifier.

type CacheStorageCachedResponse

type CacheStorageCachedResponse struct {
	Body string `json:"body"` // Entry content, base64-encoded.
}

Cached response

type CacheStorageDataEntry

type CacheStorageDataEntry struct {
	RequestURL         string                `json:"requestURL"`         // Request URL.
	RequestMethod      string                `json:"requestMethod"`      // Request method.
	RequestHeaders     []*CacheStorageHeader `json:"requestHeaders"`     // Request headers
	ResponseTime       float64               `json:"responseTime"`       // Number of seconds since epoch.
	ResponseStatus     int                   `json:"responseStatus"`     // HTTP response status code.
	ResponseStatusText string                `json:"responseStatusText"` // HTTP response status text.
	ResponseType       string                `json:"responseType"`       // HTTP response type enum values: basic, cors, default, error, opaqueResponse, opaqueRedirect
	ResponseHeaders    []*CacheStorageHeader `json:"responseHeaders"`    // Response headers
}

Data entry.

type CacheStorageDeleteCacheParams

type CacheStorageDeleteCacheParams struct {
	// Id of cache for deletion.
	CacheId string `json:"cacheId"`
}

type CacheStorageDeleteEntryParams

type CacheStorageDeleteEntryParams struct {
	// Id of cache where the entry will be deleted.
	CacheId string `json:"cacheId"`
	// URL spec of the request.
	Request string `json:"request"`
}

type CacheStorageHeader

type CacheStorageHeader struct {
	Name  string `json:"name"`  //
	Value string `json:"value"` //
}

No Description.

type CacheStorageRequestCacheNamesParams

type CacheStorageRequestCacheNamesParams struct {
	// Security origin.
	SecurityOrigin string `json:"securityOrigin"`
}

type CacheStorageRequestCachedResponseParams

type CacheStorageRequestCachedResponseParams struct {
	// Id of cache that contains the entry.
	CacheId string `json:"cacheId"`
	// URL spec of the request.
	RequestURL string `json:"requestURL"`
	// headers of the request.
	RequestHeaders []*CacheStorageHeader `json:"requestHeaders"`
}

type CacheStorageRequestEntriesParams

type CacheStorageRequestEntriesParams struct {
	// ID of cache to get entries from.
	CacheId string `json:"cacheId"`
	// Number of records to skip.
	SkipCount int `json:"skipCount,omitempty"`
	// Number of records to fetch.
	PageSize int `json:"pageSize,omitempty"`
	// If present, only return the entries containing this substring in the path
	PathFilter string `json:"pathFilter,omitempty"`
}

type Cast added in v1.0.3

type Cast struct {
	// contains filtered or unexported fields
}

func NewCast added in v1.0.3

func NewCast(target gcdmessage.ChromeTargeter) *Cast

func (*Cast) Disable added in v1.0.3

func (c *Cast) Disable() (*gcdmessage.ChromeResponse, error)

Stops observing for sinks and issues.

func (*Cast) Enable added in v1.0.3

func (c *Cast) Enable(presentationUrl string) (*gcdmessage.ChromeResponse, error)

Enable - Starts observing for sinks that can be used for tab mirroring, and if set, sinks compatible with |presentationUrl| as well. When sinks are found, a |sinksUpdated| event is fired. Also starts observing for issue messages. When an issue is added or removed, an |issueUpdated| event is fired. presentationUrl -

func (*Cast) EnableWithParams added in v1.0.3

func (c *Cast) EnableWithParams(v *CastEnableParams) (*gcdmessage.ChromeResponse, error)

EnableWithParams - Starts observing for sinks that can be used for tab mirroring, and if set, sinks compatible with |presentationUrl| as well. When sinks are found, a |sinksUpdated| event is fired. Also starts observing for issue messages. When an issue is added or removed, an |issueUpdated| event is fired.

func (*Cast) SetSinkToUse added in v1.0.3

func (c *Cast) SetSinkToUse(sinkName string) (*gcdmessage.ChromeResponse, error)

SetSinkToUse - Sets a sink to be used when the web page requests the browser to choose a sink via Presentation API, Remote Playback API, or Cast SDK. sinkName -

func (*Cast) SetSinkToUseWithParams added in v1.0.3

func (c *Cast) SetSinkToUseWithParams(v *CastSetSinkToUseParams) (*gcdmessage.ChromeResponse, error)

SetSinkToUseWithParams - Sets a sink to be used when the web page requests the browser to choose a sink via Presentation API, Remote Playback API, or Cast SDK.

func (*Cast) StartTabMirroring added in v1.0.3

func (c *Cast) StartTabMirroring(sinkName string) (*gcdmessage.ChromeResponse, error)

StartTabMirroring - Starts mirroring the tab to the sink. sinkName -

func (*Cast) StartTabMirroringWithParams added in v1.0.3

func (c *Cast) StartTabMirroringWithParams(v *CastStartTabMirroringParams) (*gcdmessage.ChromeResponse, error)

StartTabMirroringWithParams - Starts mirroring the tab to the sink.

func (*Cast) StopCasting added in v1.0.3

func (c *Cast) StopCasting(sinkName string) (*gcdmessage.ChromeResponse, error)

StopCasting - Stops the active Cast session on the sink. sinkName -

func (*Cast) StopCastingWithParams added in v1.0.3

func (c *Cast) StopCastingWithParams(v *CastStopCastingParams) (*gcdmessage.ChromeResponse, error)

StopCastingWithParams - Stops the active Cast session on the sink.

type CastEnableParams added in v1.0.3

type CastEnableParams struct {
	//
	PresentationUrl string `json:"presentationUrl,omitempty"`
}

type CastIssueUpdatedEvent added in v1.0.3

type CastIssueUpdatedEvent struct {
	Method string `json:"method"`
	Params struct {
		IssueMessage string `json:"issueMessage"` //
	} `json:"Params,omitempty"`
}

This is fired whenever the outstanding issue/error message changes. |issueMessage| is empty if there is no issue.

type CastSetSinkToUseParams added in v1.0.3

type CastSetSinkToUseParams struct {
	//
	SinkName string `json:"sinkName"`
}

type CastSink added in v1.0.7

type CastSink struct {
	Name    string `json:"name"`              //
	Id      string `json:"id"`                //
	Session string `json:"session,omitempty"` // Text describing the current session. Present only if there is an active session on the sink.
}

No Description.

type CastSinksUpdatedEvent added in v1.0.3

type CastSinksUpdatedEvent struct {
	Method string `json:"method"`
	Params struct {
		Sinks []*CastSink `json:"sinks"` //
	} `json:"Params,omitempty"`
}

This is fired whenever the list of available sinks changes. A sink is a device or a software surface that you can cast to.

type CastStartTabMirroringParams added in v1.0.3

type CastStartTabMirroringParams struct {
	//
	SinkName string `json:"sinkName"`
}

type CastStopCastingParams added in v1.0.3

type CastStopCastingParams struct {
	//
	SinkName string `json:"sinkName"`
}

type Console

type Console struct {
	// contains filtered or unexported fields
}

func NewConsole

func NewConsole(target gcdmessage.ChromeTargeter) *Console

func (*Console) ClearMessages

func (c *Console) ClearMessages() (*gcdmessage.ChromeResponse, error)

Does nothing.

func (*Console) Disable

func (c *Console) Disable() (*gcdmessage.ChromeResponse, error)

Disables console domain, prevents further console messages from being reported to the client.

func (*Console) Enable

func (c *Console) Enable() (*gcdmessage.ChromeResponse, error)

Enables console domain, sends the messages collected so far to the client by means of the `messageAdded` notification.

type ConsoleConsoleMessage

type ConsoleConsoleMessage struct {
	Source string `json:"source"`           // Message source.
	Level  string `json:"level"`            // Message severity.
	Text   string `json:"text"`             // Message text.
	Url    string `json:"url,omitempty"`    // URL of the message origin.
	Line   int    `json:"line,omitempty"`   // Line number in the resource that generated this message (1-based).
	Column int    `json:"column,omitempty"` // Column number in the resource that generated this message (1-based).
}

Console message.

type ConsoleMessageAddedEvent

type ConsoleMessageAddedEvent struct {
	Method string `json:"method"`
	Params struct {
		Message *ConsoleConsoleMessage `json:"message"` // Console message that has been added.
	} `json:"Params,omitempty"`
}

Issued when new console message is added.

type DOM

type DOM struct {
	// contains filtered or unexported fields
}

func NewDOM

func NewDOM(target gcdmessage.ChromeTargeter) *DOM

func (*DOM) CollectClassNamesFromSubtree

func (c *DOM) CollectClassNamesFromSubtree(nodeId int) ([]string, error)

CollectClassNamesFromSubtree - Collects class names for the node with given id and all of it's child nodes. nodeId - Id of the node to collect class names. Returns - classNames - Class name list.

func (*DOM) CollectClassNamesFromSubtreeWithParams

func (c *DOM) CollectClassNamesFromSubtreeWithParams(v *DOMCollectClassNamesFromSubtreeParams) ([]string, error)

CollectClassNamesFromSubtreeWithParams - Collects class names for the node with given id and all of it's child nodes. Returns - classNames - Class name list.

func (*DOM) CopyTo

func (c *DOM) CopyTo(nodeId int, targetNodeId int, insertBeforeNodeId int) (int, error)

CopyTo - Creates a deep copy of the specified node and places it into the target container before the given anchor. nodeId - Id of the node to copy. targetNodeId - Id of the element to drop the copy into. insertBeforeNodeId - Drop the copy before this node (if absent, the copy becomes the last child of `targetNodeId`). Returns - nodeId - Id of the node clone.

func (*DOM) CopyToWithParams

func (c *DOM) CopyToWithParams(v *DOMCopyToParams) (int, error)

CopyToWithParams - Creates a deep copy of the specified node and places it into the target container before the given anchor. Returns - nodeId - Id of the node clone.

func (*DOM) DescribeNode

func (c *DOM) DescribeNode(nodeId int, backendNodeId int, objectId string, depth int, pierce bool) (*DOMNode, error)

DescribeNode - Describes node given its id, does not require domain to be enabled. Does not start tracking any objects, can be used for automation. nodeId - Identifier of the node. backendNodeId - Identifier of the backend node. objectId - JavaScript object id of the node wrapper. depth - The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0. pierce - Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false). Returns - node - Node description.

func (*DOM) DescribeNodeWithParams

func (c *DOM) DescribeNodeWithParams(v *DOMDescribeNodeParams) (*DOMNode, error)

DescribeNodeWithParams - Describes node given its id, does not require domain to be enabled. Does not start tracking any objects, can be used for automation. Returns - node - Node description.

func (*DOM) Disable

func (c *DOM) Disable() (*gcdmessage.ChromeResponse, error)

Disables DOM agent for the given page.

func (*DOM) DiscardSearchResults

func (c *DOM) DiscardSearchResults(searchId string) (*gcdmessage.ChromeResponse, error)

DiscardSearchResults - Discards search results from the session with the given id. `getSearchResults` should no longer be called for that search. searchId - Unique search session identifier.

func (*DOM) DiscardSearchResultsWithParams

func (c *DOM) DiscardSearchResultsWithParams(v *DOMDiscardSearchResultsParams) (*gcdmessage.ChromeResponse, error)

DiscardSearchResultsWithParams - Discards search results from the session with the given id. `getSearchResults` should no longer be called for that search.

func (*DOM) Enable

func (c *DOM) Enable() (*gcdmessage.ChromeResponse, error)

Enables DOM agent for the given page.

func (*DOM) Focus

func (c *DOM) Focus(nodeId int, backendNodeId int, objectId string) (*gcdmessage.ChromeResponse, error)

Focus - Focuses the given element. nodeId - Identifier of the node. backendNodeId - Identifier of the backend node. objectId - JavaScript object id of the node wrapper.

func (*DOM) FocusWithParams

func (c *DOM) FocusWithParams(v *DOMFocusParams) (*gcdmessage.ChromeResponse, error)

FocusWithParams - Focuses the given element.

func (*DOM) GetAttributes

func (c *DOM) GetAttributes(nodeId int) ([]string, error)

GetAttributes - Returns attributes for the specified node. nodeId - Id of the node to retrieve attibutes for. Returns - attributes - An interleaved array of node attribute names and values.

func (*DOM) GetAttributesWithParams

func (c *DOM) GetAttributesWithParams(v *DOMGetAttributesParams) ([]string, error)

GetAttributesWithParams - Returns attributes for the specified node. Returns - attributes - An interleaved array of node attribute names and values.

func (*DOM) GetBoxModel

func (c *DOM) GetBoxModel(nodeId int, backendNodeId int, objectId string) (*DOMBoxModel, error)

GetBoxModel - Returns boxes for the given node. nodeId - Identifier of the node. backendNodeId - Identifier of the backend node. objectId - JavaScript object id of the node wrapper. Returns - model - Box model for the node.

func (*DOM) GetBoxModelWithParams

func (c *DOM) GetBoxModelWithParams(v *DOMGetBoxModelParams) (*DOMBoxModel, error)

GetBoxModelWithParams - Returns boxes for the given node. Returns - model - Box model for the node.

func (*DOM) GetContentQuads

func (c *DOM) GetContentQuads(nodeId int, backendNodeId int, objectId string) ([]float64, error)

GetContentQuads - Returns quads that describe node position on the page. This method might return multiple quads for inline nodes. nodeId - Identifier of the node. backendNodeId - Identifier of the backend node. objectId - JavaScript object id of the node wrapper. Returns - quads - Quads that describe node layout relative to viewport.

func (*DOM) GetContentQuadsWithParams

func (c *DOM) GetContentQuadsWithParams(v *DOMGetContentQuadsParams) ([]float64, error)

GetContentQuadsWithParams - Returns quads that describe node position on the page. This method might return multiple quads for inline nodes. Returns - quads - Quads that describe node layout relative to viewport.

func (*DOM) GetDocument

func (c *DOM) GetDocument(depth int, pierce bool) (*DOMNode, error)

GetDocument - Returns the root DOM node (and optionally the subtree) to the caller. depth - The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0. pierce - Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false). Returns - root - Resulting node.

func (*DOM) GetDocumentWithParams

func (c *DOM) GetDocumentWithParams(v *DOMGetDocumentParams) (*DOMNode, error)

GetDocumentWithParams - Returns the root DOM node (and optionally the subtree) to the caller. Returns - root - Resulting node.

func (*DOM) GetFileInfo added in v1.0.3

func (c *DOM) GetFileInfo(objectId string) (string, error)

GetFileInfo - Returns file information for the given File wrapper. objectId - JavaScript object id of the node wrapper. Returns - path -

func (*DOM) GetFileInfoWithParams added in v1.0.3

func (c *DOM) GetFileInfoWithParams(v *DOMGetFileInfoParams) (string, error)

GetFileInfoWithParams - Returns file information for the given File wrapper. Returns - path -

func (*DOM) GetFlattenedDocument

func (c *DOM) GetFlattenedDocument(depth int, pierce bool) ([]*DOMNode, error)

GetFlattenedDocument - Returns the root DOM node (and optionally the subtree) to the caller. depth - The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0. pierce - Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false). Returns - nodes - Resulting node.

func (*DOM) GetFlattenedDocumentWithParams

func (c *DOM) GetFlattenedDocumentWithParams(v *DOMGetFlattenedDocumentParams) ([]*DOMNode, error)

GetFlattenedDocumentWithParams - Returns the root DOM node (and optionally the subtree) to the caller. Returns - nodes - Resulting node.

func (*DOM) GetFrameOwner

func (c *DOM) GetFrameOwner(frameId string) (int, int, error)

GetFrameOwner - Returns iframe node that owns iframe with the given domain. frameId - Returns - backendNodeId - Resulting node. nodeId - Id of the node at given coordinates, only when enabled and requested document.

func (*DOM) GetFrameOwnerWithParams

func (c *DOM) GetFrameOwnerWithParams(v *DOMGetFrameOwnerParams) (int, int, error)

GetFrameOwnerWithParams - Returns iframe node that owns iframe with the given domain. Returns - backendNodeId - Resulting node. nodeId - Id of the node at given coordinates, only when enabled and requested document.

func (*DOM) GetNodeForLocation

func (c *DOM) GetNodeForLocation(x int, y int, includeUserAgentShadowDOM bool, ignorePointerEventsNone bool) (int, string, int, error)

GetNodeForLocation - Returns node id at given location. Depending on whether DOM domain is enabled, nodeId is either returned or not. x - X coordinate. y - Y coordinate. includeUserAgentShadowDOM - False to skip to the nearest non-UA shadow root ancestor (default: false). ignorePointerEventsNone - Whether to ignore pointer-events: none on elements and hit test them. Returns - backendNodeId - Resulting node. frameId - Frame this node belongs to. nodeId - Id of the node at given coordinates, only when enabled and requested document.

func (*DOM) GetNodeForLocationWithParams

func (c *DOM) GetNodeForLocationWithParams(v *DOMGetNodeForLocationParams) (int, string, int, error)

GetNodeForLocationWithParams - Returns node id at given location. Depending on whether DOM domain is enabled, nodeId is either returned or not. Returns - backendNodeId - Resulting node. frameId - Frame this node belongs to. nodeId - Id of the node at given coordinates, only when enabled and requested document.

func (*DOM) GetNodeStackTraces added in v1.0.9

func (c *DOM) GetNodeStackTraces(nodeId int) (*RuntimeStackTrace, error)

GetNodeStackTraces - Gets stack traces associated with a Node. As of now, only provides stack trace for Node creation. nodeId - Id of the node to get stack traces for. Returns - creation - Creation stack trace, if available.

func (*DOM) GetNodeStackTracesWithParams added in v1.0.9

func (c *DOM) GetNodeStackTracesWithParams(v *DOMGetNodeStackTracesParams) (*RuntimeStackTrace, error)

GetNodeStackTracesWithParams - Gets stack traces associated with a Node. As of now, only provides stack trace for Node creation. Returns - creation - Creation stack trace, if available.

func (*DOM) GetOuterHTML

func (c *DOM) GetOuterHTML(nodeId int, backendNodeId int, objectId string) (string, error)

GetOuterHTML - Returns node's HTML markup. nodeId - Identifier of the node. backendNodeId - Identifier of the backend node. objectId - JavaScript object id of the node wrapper. Returns - outerHTML - Outer HTML markup.

func (*DOM) GetOuterHTMLWithParams

func (c *DOM) GetOuterHTMLWithParams(v *DOMGetOuterHTMLParams) (string, error)

GetOuterHTMLWithParams - Returns node's HTML markup. Returns - outerHTML - Outer HTML markup.

func (*DOM) GetRelayoutBoundary

func (c *DOM) GetRelayoutBoundary(nodeId int) (int, error)

GetRelayoutBoundary - Returns the id of the nearest ancestor that is a relayout boundary. nodeId - Id of the node. Returns - nodeId - Relayout boundary node id for the given node.

func (*DOM) GetRelayoutBoundaryWithParams

func (c *DOM) GetRelayoutBoundaryWithParams(v *DOMGetRelayoutBoundaryParams) (int, error)

GetRelayoutBoundaryWithParams - Returns the id of the nearest ancestor that is a relayout boundary. Returns - nodeId - Relayout boundary node id for the given node.

func (*DOM) GetSearchResults

func (c *DOM) GetSearchResults(searchId string, fromIndex int, toIndex int) ([]int, error)

GetSearchResults - Returns search results from given `fromIndex` to given `toIndex` from the search with the given identifier. searchId - Unique search session identifier. fromIndex - Start index of the search result to be returned. toIndex - End index of the search result to be returned. Returns - nodeIds - Ids of the search result nodes.

func (*DOM) GetSearchResultsWithParams

func (c *DOM) GetSearchResultsWithParams(v *DOMGetSearchResultsParams) ([]int, error)

GetSearchResultsWithParams - Returns search results from given `fromIndex` to given `toIndex` from the search with the given identifier. Returns - nodeIds - Ids of the search result nodes.

func (*DOM) HideHighlight

func (c *DOM) HideHighlight() (*gcdmessage.ChromeResponse, error)

Hides any highlight.

func (*DOM) HighlightNode

func (c *DOM) HighlightNode() (*gcdmessage.ChromeResponse, error)

Highlights DOM node.

func (*DOM) HighlightRect

func (c *DOM) HighlightRect() (*gcdmessage.ChromeResponse, error)

Highlights given rectangle.

func (*DOM) MarkUndoableState

func (c *DOM) MarkUndoableState() (*gcdmessage.ChromeResponse, error)

Marks last undoable state.

func (*DOM) MoveTo

func (c *DOM) MoveTo(nodeId int, targetNodeId int, insertBeforeNodeId int) (int, error)

MoveTo - Moves node into the new container, places it before the given anchor. nodeId - Id of the node to move. targetNodeId - Id of the element to drop the moved node into. insertBeforeNodeId - Drop node before this one (if absent, the moved node becomes the last child of `targetNodeId`). Returns - nodeId - New id of the moved node.

func (*DOM) MoveToWithParams

func (c *DOM) MoveToWithParams(v *DOMMoveToParams) (int, error)

MoveToWithParams - Moves node into the new container, places it before the given anchor. Returns - nodeId - New id of the moved node.

func (*DOM) PerformSearch

func (c *DOM) PerformSearch(query string, includeUserAgentShadowDOM bool) (string, int, error)

PerformSearch - Searches for a given string in the DOM tree. Use `getSearchResults` to access search results or `cancelSearch` to end this search session. query - Plain text or query selector or XPath search query. includeUserAgentShadowDOM - True to search in user agent shadow DOM. Returns - searchId - Unique search session identifier. resultCount - Number of search results.

func (*DOM) PerformSearchWithParams

func (c *DOM) PerformSearchWithParams(v *DOMPerformSearchParams) (string, int, error)

PerformSearchWithParams - Searches for a given string in the DOM tree. Use `getSearchResults` to access search results or `cancelSearch` to end this search session. Returns - searchId - Unique search session identifier. resultCount - Number of search results.

func (*DOM) PushNodeByPathToFrontend

func (c *DOM) PushNodeByPathToFrontend(path string) (int, error)

PushNodeByPathToFrontend - Requests that the node is sent to the caller given its path. // FIXME, use XPath path - Path to node in the proprietary format. Returns - nodeId - Id of the node for given path.

func (*DOM) PushNodeByPathToFrontendWithParams

func (c *DOM) PushNodeByPathToFrontendWithParams(v *DOMPushNodeByPathToFrontendParams) (int, error)

PushNodeByPathToFrontendWithParams - Requests that the node is sent to the caller given its path. // FIXME, use XPath Returns - nodeId - Id of the node for given path.

func (*DOM) PushNodesByBackendIdsToFrontend

func (c *DOM) PushNodesByBackendIdsToFrontend(backendNodeIds []int) ([]int, error)

PushNodesByBackendIdsToFrontend - Requests that a batch of nodes is sent to the caller given their backend node ids. backendNodeIds - The array of backend node ids. Returns - nodeIds - The array of ids of pushed nodes that correspond to the backend ids specified in backendNodeIds.

func (*DOM) PushNodesByBackendIdsToFrontendWithParams

func (c *DOM) PushNodesByBackendIdsToFrontendWithParams(v *DOMPushNodesByBackendIdsToFrontendParams) ([]int, error)

PushNodesByBackendIdsToFrontendWithParams - Requests that a batch of nodes is sent to the caller given their backend node ids. Returns - nodeIds - The array of ids of pushed nodes that correspond to the backend ids specified in backendNodeIds.

func (*DOM) QuerySelector

func (c *DOM) QuerySelector(nodeId int, selector string) (int, error)

QuerySelector - Executes `querySelector` on a given node. nodeId - Id of the node to query upon. selector - Selector string. Returns - nodeId - Query selector result.

func (*DOM) QuerySelectorAll

func (c *DOM) QuerySelectorAll(nodeId int, selector string) ([]int, error)

QuerySelectorAll - Executes `querySelectorAll` on a given node. nodeId - Id of the node to query upon. selector - Selector string. Returns - nodeIds - Query selector result.

func (*DOM) QuerySelectorAllWithParams

func (c *DOM) QuerySelectorAllWithParams(v *DOMQuerySelectorAllParams) ([]int, error)

QuerySelectorAllWithParams - Executes `querySelectorAll` on a given node. Returns - nodeIds - Query selector result.

func (*DOM) QuerySelectorWithParams

func (c *DOM) QuerySelectorWithParams(v *DOMQuerySelectorParams) (int, error)

QuerySelectorWithParams - Executes `querySelector` on a given node. Returns - nodeId - Query selector result.

func (*DOM) Redo

func (c *DOM) Redo() (*gcdmessage.ChromeResponse, error)

Re-does the last undone action.

func (*DOM) RemoveAttribute

func (c *DOM) RemoveAttribute(nodeId int, name string) (*gcdmessage.ChromeResponse, error)

RemoveAttribute - Removes attribute with given name from an element with given id. nodeId - Id of the element to remove attribute from. name - Name of the attribute to remove.

func (*DOM) RemoveAttributeWithParams

func (c *DOM) RemoveAttributeWithParams(v *DOMRemoveAttributeParams) (*gcdmessage.ChromeResponse, error)

RemoveAttributeWithParams - Removes attribute with given name from an element with given id.

func (*DOM) RemoveNode

func (c *DOM) RemoveNode(nodeId int) (*gcdmessage.ChromeResponse, error)

RemoveNode - Removes node with given id. nodeId - Id of the node to remove.

func (*DOM) RemoveNodeWithParams

func (c *DOM) RemoveNodeWithParams(v *DOMRemoveNodeParams) (*gcdmessage.ChromeResponse, error)

RemoveNodeWithParams - Removes node with given id.

func (*DOM) RequestChildNodes

func (c *DOM) RequestChildNodes(nodeId int, depth int, pierce bool) (*gcdmessage.ChromeResponse, error)

RequestChildNodes - Requests that children of the node with given id are returned to the caller in form of `setChildNodes` events where not only immediate children are retrieved, but all children down to the specified depth. nodeId - Id of the node to get children for. depth - The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0. pierce - Whether or not iframes and shadow roots should be traversed when returning the sub-tree (default is false).

func (*DOM) RequestChildNodesWithParams

func (c *DOM) RequestChildNodesWithParams(v *DOMRequestChildNodesParams) (*gcdmessage.ChromeResponse, error)

RequestChildNodesWithParams - Requests that children of the node with given id are returned to the caller in form of `setChildNodes` events where not only immediate children are retrieved, but all children down to the specified depth.

func (*DOM) RequestNode

func (c *DOM) RequestNode(objectId string) (int, error)

RequestNode - Requests that the node is sent to the caller given the JavaScript node object reference. All nodes that form the path from the node to the root are also sent to the client as a series of `setChildNodes` notifications. objectId - JavaScript object id to convert into node. Returns - nodeId - Node id for given object.

func (*DOM) RequestNodeWithParams

func (c *DOM) RequestNodeWithParams(v *DOMRequestNodeParams) (int, error)

RequestNodeWithParams - Requests that the node is sent to the caller given the JavaScript node object reference. All nodes that form the path from the node to the root are also sent to the client as a series of `setChildNodes` notifications. Returns - nodeId - Node id for given object.

func (*DOM) ResolveNode

func (c *DOM) ResolveNode(nodeId int, backendNodeId int, objectGroup string, executionContextId int) (*RuntimeRemoteObject, error)

ResolveNode - Resolves the JavaScript node object for a given NodeId or BackendNodeId. nodeId - Id of the node to resolve. backendNodeId - Backend identifier of the node to resolve. objectGroup - Symbolic group name that can be used to release multiple objects. executionContextId - Execution context in which to resolve the node. Returns - object - JavaScript object wrapper for given node.

func (*DOM) ResolveNodeWithParams

func (c *DOM) ResolveNodeWithParams(v *DOMResolveNodeParams) (*RuntimeRemoteObject, error)

ResolveNodeWithParams - Resolves the JavaScript node object for a given NodeId or BackendNodeId. Returns - object - JavaScript object wrapper for given node.

func (*DOM) ScrollIntoViewIfNeeded added in v1.0.9

func (c *DOM) ScrollIntoViewIfNeeded(nodeId int, backendNodeId int, objectId string, rect *DOMRect) (*gcdmessage.ChromeResponse, error)

ScrollIntoViewIfNeeded - Scrolls the specified rect of the given node into view if not already visible. Note: exactly one between nodeId, backendNodeId and objectId should be passed to identify the node. nodeId - Identifier of the node. backendNodeId - Identifier of the backend node. objectId - JavaScript object id of the node wrapper. rect - The rect to be scrolled into view, relative to the node's border box, in CSS pixels. When omitted, center of the node will be used, similar to Element.scrollIntoView.

func (*DOM) ScrollIntoViewIfNeededWithParams added in v1.0.9

func (c *DOM) ScrollIntoViewIfNeededWithParams(v *DOMScrollIntoViewIfNeededParams) (*gcdmessage.ChromeResponse, error)

ScrollIntoViewIfNeededWithParams - Scrolls the specified rect of the given node into view if not already visible. Note: exactly one between nodeId, backendNodeId and objectId should be passed to identify the node.

func (*DOM) SetAttributeValue

func (c *DOM) SetAttributeValue(nodeId int, name string, value string) (*gcdmessage.ChromeResponse, error)

SetAttributeValue - Sets attribute for an element with given id. nodeId - Id of the element to set attribute for. name - Attribute name. value - Attribute value.

func (*DOM) SetAttributeValueWithParams

func (c *DOM) SetAttributeValueWithParams(v *DOMSetAttributeValueParams) (*gcdmessage.ChromeResponse, error)

SetAttributeValueWithParams - Sets attribute for an element with given id.

func (*DOM) SetAttributesAsText

func (c *DOM) SetAttributesAsText(nodeId int, text string, name string) (*gcdmessage.ChromeResponse, error)

SetAttributesAsText - Sets attributes on element with given id. This method is useful when user edits some existing attribute value and types in several attribute name/value pairs. nodeId - Id of the element to set attributes for. text - Text with a number of attributes. Will parse this text using HTML parser. name - Attribute name to replace with new attributes derived from text in case text parsed successfully.

func (*DOM) SetAttributesAsTextWithParams

func (c *DOM) SetAttributesAsTextWithParams(v *DOMSetAttributesAsTextParams) (*gcdmessage.ChromeResponse, error)

SetAttributesAsTextWithParams - Sets attributes on element with given id. This method is useful when user edits some existing attribute value and types in several attribute name/value pairs.

func (*DOM) SetFileInputFiles

func (c *DOM) SetFileInputFiles(files []string, nodeId int, backendNodeId int, objectId string) (*gcdmessage.ChromeResponse, error)

SetFileInputFiles - Sets files for the given file input element. files - Array of file paths to set. nodeId - Identifier of the node. backendNodeId - Identifier of the backend node. objectId - JavaScript object id of the node wrapper.

func (*DOM) SetFileInputFilesWithParams

func (c *DOM) SetFileInputFilesWithParams(v *DOMSetFileInputFilesParams) (*gcdmessage.ChromeResponse, error)

SetFileInputFilesWithParams - Sets files for the given file input element.

func (*DOM) SetInspectedNode

func (c *DOM) SetInspectedNode(nodeId int) (*gcdmessage.ChromeResponse, error)

SetInspectedNode - Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). nodeId - DOM node id to be accessible by means of $x command line API.

func (*DOM) SetInspectedNodeWithParams

func (c *DOM) SetInspectedNodeWithParams(v *DOMSetInspectedNodeParams) (*gcdmessage.ChromeResponse, error)

SetInspectedNodeWithParams - Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).

func (*DOM) SetNodeName

func (c *DOM) SetNodeName(nodeId int, name string) (int, error)

SetNodeName - Sets node name for a node with given id. nodeId - Id of the node to set name for. name - New node's name. Returns - nodeId - New node's id.

func (*DOM) SetNodeNameWithParams

func (c *DOM) SetNodeNameWithParams(v *DOMSetNodeNameParams) (int, error)

SetNodeNameWithParams - Sets node name for a node with given id. Returns - nodeId - New node's id.

func (*DOM) SetNodeStackTracesEnabled added in v1.0.9

func (c *DOM) SetNodeStackTracesEnabled(enable bool) (*gcdmessage.ChromeResponse, error)

SetNodeStackTracesEnabled - Sets if stack traces should be captured for Nodes. See `Node.getNodeStackTraces`. Default is disabled. enable - Enable or disable.

func (*DOM) SetNodeStackTracesEnabledWithParams added in v1.0.9

func (c *DOM) SetNodeStackTracesEnabledWithParams(v *DOMSetNodeStackTracesEnabledParams) (*gcdmessage.ChromeResponse, error)

SetNodeStackTracesEnabledWithParams - Sets if stack traces should be captured for Nodes. See `Node.getNodeStackTraces`. Default is disabled.

func (*DOM) SetNodeValue

func (c *DOM) SetNodeValue(nodeId int, value string) (*gcdmessage.ChromeResponse, error)

SetNodeValue - Sets node value for a node with given id. nodeId - Id of the node to set value for. value - New node's value.

func (*DOM) SetNodeValueWithParams

func (c *DOM) SetNodeValueWithParams(v *DOMSetNodeValueParams) (*gcdmessage.ChromeResponse, error)

SetNodeValueWithParams - Sets node value for a node with given id.

func (*DOM) SetOuterHTML

func (c *DOM) SetOuterHTML(nodeId int, outerHTML string) (*gcdmessage.ChromeResponse, error)

SetOuterHTML - Sets node HTML markup, returns new node id. nodeId - Id of the node to set markup for. outerHTML - Outer HTML markup to set.

func (*DOM) SetOuterHTMLWithParams

func (c *DOM) SetOuterHTMLWithParams(v *DOMSetOuterHTMLParams) (*gcdmessage.ChromeResponse, error)

SetOuterHTMLWithParams - Sets node HTML markup, returns new node id.

func (*DOM) Undo

func (c *DOM) Undo() (*gcdmessage.ChromeResponse, error)

Undoes the last performed action.

type DOMAttributeModifiedEvent

type DOMAttributeModifiedEvent struct {
	Method string `json:"method"`
	Params struct {
		NodeId int    `json:"nodeId"` // Id of the node that has changed.
		Name   string `json:"name"`   // Attribute name.
		Value  string `json:"value"`  // Attribute value.
	} `json:"Params,omitempty"`
}

Fired when `Element`'s attribute is modified.

type DOMAttributeRemovedEvent

type DOMAttributeRemovedEvent struct {
	Method string `json:"method"`
	Params struct {
		NodeId int    `json:"nodeId"` // Id of the node that has changed.
		Name   string `json:"name"`   // A ttribute name.
	} `json:"Params,omitempty"`
}

Fired when `Element`'s attribute is removed.

type DOMBackendNode

type DOMBackendNode struct {
	NodeType      int    `json:"nodeType"`      // `Node`'s nodeType.
	NodeName      string `json:"nodeName"`      // `Node`'s nodeName.
	BackendNodeId int    `json:"backendNodeId"` //
}

Backend node with a friendly name.

type DOMBoxModel

type DOMBoxModel struct {
	Content      []float64            `json:"content"`                // Content box
	Padding      []float64            `json:"padding"`                // Padding box
	Border       []float64            `json:"border"`                 // Border box
	Margin       []float64            `json:"margin"`                 // Margin box
	Width        int                  `json:"width"`                  // Node width
	Height       int                  `json:"height"`                 // Node height
	ShapeOutside *DOMShapeOutsideInfo `json:"shapeOutside,omitempty"` // Shape outside coordinates
}

Box model.

type DOMCharacterDataModifiedEvent

type DOMCharacterDataModifiedEvent struct {
	Method string `json:"method"`
	Params struct {
		NodeId        int    `json:"nodeId"`        // Id of the node that has changed.
		CharacterData string `json:"characterData"` // New text value.
	} `json:"Params,omitempty"`
}

Mirrors `DOMCharacterDataModified` event.

type DOMChildNodeCountUpdatedEvent

type DOMChildNodeCountUpdatedEvent struct {
	Method string `json:"method"`
	Params struct {
		NodeId         int `json:"nodeId"`         // Id of the node that has changed.
		ChildNodeCount int `json:"childNodeCount"` // New node count.
	} `json:"Params,omitempty"`
}

Fired when `Container`'s child node count has changed.

type DOMChildNodeInsertedEvent

type DOMChildNodeInsertedEvent struct {
	Method string `json:"method"`
	Params struct {
		ParentNodeId   int      `json:"parentNodeId"`   // Id of the node that has changed.
		PreviousNodeId int      `json:"previousNodeId"` // If of the previous siblint.
		Node           *DOMNode `json:"node"`           // Inserted node data.
	} `json:"Params,omitempty"`
}

Mirrors `DOMNodeInserted` event.

type DOMChildNodeRemovedEvent

type DOMChildNodeRemovedEvent struct {
	Method string `json:"method"`
	Params struct {
		ParentNodeId int `json:"parentNodeId"` // Parent id.
		NodeId       int `json:"nodeId"`       // Id of the node that has been removed.
	} `json:"Params,omitempty"`
}

Mirrors `DOMNodeRemoved` event.

type DOMCollectClassNamesFromSubtreeParams

type DOMCollectClassNamesFromSubtreeParams struct {
	// Id of the node to collect class names.
	NodeId int `json:"nodeId"`
}

type DOMCopyToParams

type DOMCopyToParams struct {
	// Id of the node to copy.
	NodeId int `json:"nodeId"`
	// Id of the element to drop the copy into.
	TargetNodeId int `json:"targetNodeId"`
	// Drop the copy before this node (if absent, the copy becomes the last child of `targetNodeId`).
	InsertBeforeNodeId int `json:"insertBeforeNodeId,omitempty"`
}

type DOMDebugger

type DOMDebugger struct {
	// contains filtered or unexported fields
}

func NewDOMDebugger

func NewDOMDebugger(target gcdmessage.ChromeTargeter) *DOMDebugger

func (*DOMDebugger) GetEventListeners

func (c *DOMDebugger) GetEventListeners(objectId string, depth int, pierce bool) ([]*DOMDebuggerEventListener, error)

GetEventListeners - Returns event listeners of the given object. objectId - Identifier of the object to return listeners for. depth - The maximum depth at which Node children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0. pierce - Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false). Reports listeners for all contexts if pierce is enabled. Returns - listeners - Array of relevant listeners.

func (*DOMDebugger) GetEventListenersWithParams

func (c *DOMDebugger) GetEventListenersWithParams(v *DOMDebuggerGetEventListenersParams) ([]*DOMDebuggerEventListener, error)

GetEventListenersWithParams - Returns event listeners of the given object. Returns - listeners - Array of relevant listeners.

func (*DOMDebugger) RemoveDOMBreakpoint

func (c *DOMDebugger) RemoveDOMBreakpoint(nodeId int, theType string) (*gcdmessage.ChromeResponse, error)

RemoveDOMBreakpoint - Removes DOM breakpoint that was set using `setDOMBreakpoint`. nodeId - Identifier of the node to remove breakpoint from. type - Type of the breakpoint to remove. enum values: subtree-modified, attribute-modified, node-removed

func (*DOMDebugger) RemoveDOMBreakpointWithParams

func (c *DOMDebugger) RemoveDOMBreakpointWithParams(v *DOMDebuggerRemoveDOMBreakpointParams) (*gcdmessage.ChromeResponse, error)

RemoveDOMBreakpointWithParams - Removes DOM breakpoint that was set using `setDOMBreakpoint`.

func (*DOMDebugger) RemoveEventListenerBreakpoint

func (c *DOMDebugger) RemoveEventListenerBreakpoint(eventName string, targetName string) (*gcdmessage.ChromeResponse, error)

RemoveEventListenerBreakpoint - Removes breakpoint on particular DOM event. eventName - Event name. targetName - EventTarget interface name.

func (*DOMDebugger) RemoveEventListenerBreakpointWithParams

func (c *DOMDebugger) RemoveEventListenerBreakpointWithParams(v *DOMDebuggerRemoveEventListenerBreakpointParams) (*gcdmessage.ChromeResponse, error)

RemoveEventListenerBreakpointWithParams - Removes breakpoint on particular DOM event.

func (*DOMDebugger) RemoveInstrumentationBreakpoint

func (c *DOMDebugger) RemoveInstrumentationBreakpoint(eventName string) (*gcdmessage.ChromeResponse, error)

RemoveInstrumentationBreakpoint - Removes breakpoint on particular native event. eventName - Instrumentation name to stop on.

func (*DOMDebugger) RemoveInstrumentationBreakpointWithParams

func (c *DOMDebugger) RemoveInstrumentationBreakpointWithParams(v *DOMDebuggerRemoveInstrumentationBreakpointParams) (*gcdmessage.ChromeResponse, error)

RemoveInstrumentationBreakpointWithParams - Removes breakpoint on particular native event.

func (*DOMDebugger) RemoveXHRBreakpoint

func (c *DOMDebugger) RemoveXHRBreakpoint(url string) (*gcdmessage.ChromeResponse, error)

RemoveXHRBreakpoint - Removes breakpoint from XMLHttpRequest. url - Resource URL substring.

func (*DOMDebugger) RemoveXHRBreakpointWithParams

func (c *DOMDebugger) RemoveXHRBreakpointWithParams(v *DOMDebuggerRemoveXHRBreakpointParams) (*gcdmessage.ChromeResponse, error)

RemoveXHRBreakpointWithParams - Removes breakpoint from XMLHttpRequest.

func (*DOMDebugger) SetDOMBreakpoint

func (c *DOMDebugger) SetDOMBreakpoint(nodeId int, theType string) (*gcdmessage.ChromeResponse, error)

SetDOMBreakpoint - Sets breakpoint on particular operation with DOM. nodeId - Identifier of the node to set breakpoint on. type - Type of the operation to stop upon. enum values: subtree-modified, attribute-modified, node-removed

func (*DOMDebugger) SetDOMBreakpointWithParams

func (c *DOMDebugger) SetDOMBreakpointWithParams(v *DOMDebuggerSetDOMBreakpointParams) (*gcdmessage.ChromeResponse, error)

SetDOMBreakpointWithParams - Sets breakpoint on particular operation with DOM.

func (*DOMDebugger) SetEventListenerBreakpoint

func (c *DOMDebugger) SetEventListenerBreakpoint(eventName string, targetName string) (*gcdmessage.ChromeResponse, error)

SetEventListenerBreakpoint - Sets breakpoint on particular DOM event. eventName - DOM Event name to stop on (any DOM event will do). targetName - EventTarget interface name to stop on. If equal to `"*"` or not provided, will stop on any EventTarget.

func (*DOMDebugger) SetEventListenerBreakpointWithParams

func (c *DOMDebugger) SetEventListenerBreakpointWithParams(v *DOMDebuggerSetEventListenerBreakpointParams) (*gcdmessage.ChromeResponse, error)

SetEventListenerBreakpointWithParams - Sets breakpoint on particular DOM event.

func (*DOMDebugger) SetInstrumentationBreakpoint

func (c *DOMDebugger) SetInstrumentationBreakpoint(eventName string) (*gcdmessage.ChromeResponse, error)

SetInstrumentationBreakpoint - Sets breakpoint on particular native event. eventName - Instrumentation name to stop on.

func (*DOMDebugger) SetInstrumentationBreakpointWithParams

func (c *DOMDebugger) SetInstrumentationBreakpointWithParams(v *DOMDebuggerSetInstrumentationBreakpointParams) (*gcdmessage.ChromeResponse, error)

SetInstrumentationBreakpointWithParams - Sets breakpoint on particular native event.

func (*DOMDebugger) SetXHRBreakpoint

func (c *DOMDebugger) SetXHRBreakpoint(url string) (*gcdmessage.ChromeResponse, error)

SetXHRBreakpoint - Sets breakpoint on XMLHttpRequest. url - Resource URL substring. All XHRs having this substring in the URL will get stopped upon.

func (*DOMDebugger) SetXHRBreakpointWithParams

func (c *DOMDebugger) SetXHRBreakpointWithParams(v *DOMDebuggerSetXHRBreakpointParams) (*gcdmessage.ChromeResponse, error)

SetXHRBreakpointWithParams - Sets breakpoint on XMLHttpRequest.

type DOMDebuggerEventListener

type DOMDebuggerEventListener struct {
	Type            string               `json:"type"`                      // `EventListener`'s type.
	UseCapture      bool                 `json:"useCapture"`                // `EventListener`'s useCapture.
	Passive         bool                 `json:"passive"`                   // `EventListener`'s passive flag.
	Once            bool                 `json:"once"`                      // `EventListener`'s once flag.
	ScriptId        string               `json:"scriptId"`                  // Script id of the handler code.
	LineNumber      int                  `json:"lineNumber"`                // Line number in the script (0-based).
	ColumnNumber    int                  `json:"columnNumber"`              // Column number in the script (0-based).
	Handler         *RuntimeRemoteObject `json:"handler,omitempty"`         // Event handler function value.
	OriginalHandler *RuntimeRemoteObject `json:"originalHandler,omitempty"` // Event original handler function value.
	BackendNodeId   int                  `json:"backendNodeId,omitempty"`   // Node the listener is added to (if any).
}

Object event listener.

type DOMDebuggerGetEventListenersParams

type DOMDebuggerGetEventListenersParams struct {
	// Identifier of the object to return listeners for.
	ObjectId string `json:"objectId"`
	// The maximum depth at which Node children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
	Depth int `json:"depth,omitempty"`
	// Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false). Reports listeners for all contexts if pierce is enabled.
	Pierce bool `json:"pierce,omitempty"`
}

type DOMDebuggerRemoveDOMBreakpointParams

type DOMDebuggerRemoveDOMBreakpointParams struct {
	// Identifier of the node to remove breakpoint from.
	NodeId int `json:"nodeId"`
	// Type of the breakpoint to remove. enum values: subtree-modified, attribute-modified, node-removed
	TheType string `json:"type"`
}

type DOMDebuggerRemoveEventListenerBreakpointParams

type DOMDebuggerRemoveEventListenerBreakpointParams struct {
	// Event name.
	EventName string `json:"eventName"`
	// EventTarget interface name.
	TargetName string `json:"targetName,omitempty"`
}

type DOMDebuggerRemoveInstrumentationBreakpointParams

type DOMDebuggerRemoveInstrumentationBreakpointParams struct {
	// Instrumentation name to stop on.
	EventName string `json:"eventName"`
}

type DOMDebuggerRemoveXHRBreakpointParams

type DOMDebuggerRemoveXHRBreakpointParams struct {
	// Resource URL substring.
	Url string `json:"url"`
}

type DOMDebuggerSetDOMBreakpointParams

type DOMDebuggerSetDOMBreakpointParams struct {
	// Identifier of the node to set breakpoint on.
	NodeId int `json:"nodeId"`
	// Type of the operation to stop upon. enum values: subtree-modified, attribute-modified, node-removed
	TheType string `json:"type"`
}

type DOMDebuggerSetEventListenerBreakpointParams

type DOMDebuggerSetEventListenerBreakpointParams struct {
	// DOM Event name to stop on (any DOM event will do).
	EventName string `json:"eventName"`
	// EventTarget interface name to stop on. If equal to `"*"` or not provided, will stop on any EventTarget.
	TargetName string `json:"targetName,omitempty"`
}

type DOMDebuggerSetInstrumentationBreakpointParams

type DOMDebuggerSetInstrumentationBreakpointParams struct {
	// Instrumentation name to stop on.
	EventName string `json:"eventName"`
}

type DOMDebuggerSetXHRBreakpointParams

type DOMDebuggerSetXHRBreakpointParams struct {
	// Resource URL substring. All XHRs having this substring in the URL will get stopped upon.
	Url string `json:"url"`
}

type DOMDescribeNodeParams

type DOMDescribeNodeParams struct {
	// Identifier of the node.
	NodeId int `json:"nodeId,omitempty"`
	// Identifier of the backend node.
	BackendNodeId int `json:"backendNodeId,omitempty"`
	// JavaScript object id of the node wrapper.
	ObjectId string `json:"objectId,omitempty"`
	// The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
	Depth int `json:"depth,omitempty"`
	// Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).
	Pierce bool `json:"pierce,omitempty"`
}

type DOMDiscardSearchResultsParams

type DOMDiscardSearchResultsParams struct {
	// Unique search session identifier.
	SearchId string `json:"searchId"`
}

type DOMDistributedNodesUpdatedEvent

type DOMDistributedNodesUpdatedEvent struct {
	Method string `json:"method"`
	Params struct {
		InsertionPointId int               `json:"insertionPointId"` // Insertion point where distrubuted nodes were updated.
		DistributedNodes []*DOMBackendNode `json:"distributedNodes"` // Distributed nodes for given insertion point.
	} `json:"Params,omitempty"`
}

Called when distrubution is changed.

type DOMFocusParams

type DOMFocusParams struct {
	// Identifier of the node.
	NodeId int `json:"nodeId,omitempty"`
	// Identifier of the backend node.
	BackendNodeId int `json:"backendNodeId,omitempty"`
	// JavaScript object id of the node wrapper.
	ObjectId string `json:"objectId,omitempty"`
}

type DOMGetAttributesParams

type DOMGetAttributesParams struct {
	// Id of the node to retrieve attibutes for.
	NodeId int `json:"nodeId"`
}

type DOMGetBoxModelParams

type DOMGetBoxModelParams struct {
	// Identifier of the node.
	NodeId int `json:"nodeId,omitempty"`
	// Identifier of the backend node.
	BackendNodeId int `json:"backendNodeId,omitempty"`
	// JavaScript object id of the node wrapper.
	ObjectId string `json:"objectId,omitempty"`
}

type DOMGetContentQuadsParams

type DOMGetContentQuadsParams struct {
	// Identifier of the node.
	NodeId int `json:"nodeId,omitempty"`
	// Identifier of the backend node.
	BackendNodeId int `json:"backendNodeId,omitempty"`
	// JavaScript object id of the node wrapper.
	ObjectId string `json:"objectId,omitempty"`
}

type DOMGetDocumentParams

type DOMGetDocumentParams struct {
	// The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
	Depth int `json:"depth,omitempty"`
	// Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).
	Pierce bool `json:"pierce,omitempty"`
}

type DOMGetFileInfoParams added in v1.0.3

type DOMGetFileInfoParams struct {
	// JavaScript object id of the node wrapper.
	ObjectId string `json:"objectId"`
}

type DOMGetFlattenedDocumentParams

type DOMGetFlattenedDocumentParams struct {
	// The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
	Depth int `json:"depth,omitempty"`
	// Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).
	Pierce bool `json:"pierce,omitempty"`
}

type DOMGetFrameOwnerParams

type DOMGetFrameOwnerParams struct {
	//
	FrameId string `json:"frameId"`
}

type DOMGetNodeForLocationParams

type DOMGetNodeForLocationParams struct {
	// X coordinate.
	X int `json:"x"`
	// Y coordinate.
	Y int `json:"y"`
	// False to skip to the nearest non-UA shadow root ancestor (default: false).
	IncludeUserAgentShadowDOM bool `json:"includeUserAgentShadowDOM,omitempty"`
	// Whether to ignore pointer-events: none on elements and hit test them.
	IgnorePointerEventsNone bool `json:"ignorePointerEventsNone,omitempty"`
}

type DOMGetNodeStackTracesParams added in v1.0.9

type DOMGetNodeStackTracesParams struct {
	// Id of the node to get stack traces for.
	NodeId int `json:"nodeId"`
}

type DOMGetOuterHTMLParams

type DOMGetOuterHTMLParams struct {
	// Identifier of the node.
	NodeId int `json:"nodeId,omitempty"`
	// Identifier of the backend node.
	BackendNodeId int `json:"backendNodeId,omitempty"`
	// JavaScript object id of the node wrapper.
	ObjectId string `json:"objectId,omitempty"`
}

type DOMGetRelayoutBoundaryParams

type DOMGetRelayoutBoundaryParams struct {
	// Id of the node.
	NodeId int `json:"nodeId"`
}

type DOMGetSearchResultsParams

type DOMGetSearchResultsParams struct {
	// Unique search session identifier.
	SearchId string `json:"searchId"`
	// Start index of the search result to be returned.
	FromIndex int `json:"fromIndex"`
	// End index of the search result to be returned.
	ToIndex int `json:"toIndex"`
}

type DOMInlineStyleInvalidatedEvent

type DOMInlineStyleInvalidatedEvent struct {
	Method string `json:"method"`
	Params struct {
		NodeIds []int `json:"nodeIds"` // Ids of the nodes for which the inline styles have been invalidated.
	} `json:"Params,omitempty"`
}

Fired when `Element`'s inline style is modified via a CSS property modification.

type DOMMoveToParams

type DOMMoveToParams struct {
	// Id of the node to move.
	NodeId int `json:"nodeId"`
	// Id of the element to drop the moved node into.
	TargetNodeId int `json:"targetNodeId"`
	// Drop node before this one (if absent, the moved node becomes the last child of `targetNodeId`).
	InsertBeforeNodeId int `json:"insertBeforeNodeId,omitempty"`
}

type DOMNode

type DOMNode struct {
	NodeId           int               `json:"nodeId"`                     // Node identifier that is passed into the rest of the DOM messages as the `nodeId`. Backend will only push node with given `id` once. It is aware of all requested nodes and will only fire DOM events for nodes known to the client.
	ParentId         int               `json:"parentId,omitempty"`         // The id of the parent node if any.
	BackendNodeId    int               `json:"backendNodeId"`              // The BackendNodeId for this node.
	NodeType         int               `json:"nodeType"`                   // `Node`'s nodeType.
	NodeName         string            `json:"nodeName"`                   // `Node`'s nodeName.
	LocalName        string            `json:"localName"`                  // `Node`'s localName.
	NodeValue        string            `json:"nodeValue"`                  // `Node`'s nodeValue.
	ChildNodeCount   int               `json:"childNodeCount,omitempty"`   // Child count for `Container` nodes.
	Children         []*DOMNode        `json:"children,omitempty"`         // Child nodes of this node when requested with children.
	Attributes       []string          `json:"attributes,omitempty"`       // Attributes of the `Element` node in the form of flat array `[name1, value1, name2, value2]`.
	DocumentURL      string            `json:"documentURL,omitempty"`      // Document URL that `Document` or `FrameOwner` node points to.
	BaseURL          string            `json:"baseURL,omitempty"`          // Base URL that `Document` or `FrameOwner` node uses for URL completion.
	PublicId         string            `json:"publicId,omitempty"`         // `DocumentType`'s publicId.
	SystemId         string            `json:"systemId,omitempty"`         // `DocumentType`'s systemId.
	InternalSubset   string            `json:"internalSubset,omitempty"`   // `DocumentType`'s internalSubset.
	XmlVersion       string            `json:"xmlVersion,omitempty"`       // `Document`'s XML version in case of XML documents.
	Name             string            `json:"name,omitempty"`             // `Attr`'s name.
	Value            string            `json:"value,omitempty"`            // `Attr`'s value.
	PseudoType       string            `json:"pseudoType,omitempty"`       // Pseudo element type for this node. enum values: first-line, first-letter, before, after, marker, backdrop, selection, first-line-inherited, scrollbar, scrollbar-thumb, scrollbar-button, scrollbar-track, scrollbar-track-piece, scrollbar-corner, resizer, input-list-button
	ShadowRootType   string            `json:"shadowRootType,omitempty"`   // Shadow root type. enum values: user-agent, open, closed
	FrameId          string            `json:"frameId,omitempty"`          // Frame ID for frame owner elements.
	ContentDocument  *DOMNode          `json:"contentDocument,omitempty"`  // Content document for frame owner elements.
	ShadowRoots      []*DOMNode        `json:"shadowRoots,omitempty"`      // Shadow root list for given element host.
	TemplateContent  *DOMNode          `json:"templateContent,omitempty"`  // Content document fragment for template elements.
	PseudoElements   []*DOMNode        `json:"pseudoElements,omitempty"`   // Pseudo elements associated with this node.
	ImportedDocument *DOMNode          `json:"importedDocument,omitempty"` // Import document for the HTMLImport links.
	DistributedNodes []*DOMBackendNode `json:"distributedNodes,omitempty"` // Distributed nodes for given insertion point.
	IsSVG            bool              `json:"isSVG,omitempty"`            // Whether the node is SVG.
}

DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes. DOMNode is a base node mirror type.

type DOMPerformSearchParams

type DOMPerformSearchParams struct {
	// Plain text or query selector or XPath search query.
	Query string `json:"query"`
	// True to search in user agent shadow DOM.
	IncludeUserAgentShadowDOM bool `json:"includeUserAgentShadowDOM,omitempty"`
}

type DOMPseudoElementAddedEvent

type DOMPseudoElementAddedEvent struct {
	Method string `json:"method"`
	Params struct {
		ParentId      int      `json:"parentId"`      // Pseudo element's parent element id.
		PseudoElement *DOMNode `json:"pseudoElement"` // The added pseudo element.
	} `json:"Params,omitempty"`
}

Called when a pseudo element is added to an element.

type DOMPseudoElementRemovedEvent

type DOMPseudoElementRemovedEvent struct {
	Method string `json:"method"`
	Params struct {
		ParentId        int `json:"parentId"`        // Pseudo element's parent element id.
		PseudoElementId int `json:"pseudoElementId"` // The removed pseudo element id.
	} `json:"Params,omitempty"`
}

Called when a pseudo element is removed from an element.

type DOMPushNodeByPathToFrontendParams

type DOMPushNodeByPathToFrontendParams struct {
	// Path to node in the proprietary format.
	Path string `json:"path"`
}

type DOMPushNodesByBackendIdsToFrontendParams

type DOMPushNodesByBackendIdsToFrontendParams struct {
	// The array of backend node ids.
	BackendNodeIds []int `json:"backendNodeIds"`
}

type DOMQuerySelectorAllParams

type DOMQuerySelectorAllParams struct {
	// Id of the node to query upon.
	NodeId int `json:"nodeId"`
	// Selector string.
	Selector string `json:"selector"`
}

type DOMQuerySelectorParams

type DOMQuerySelectorParams struct {
	// Id of the node to query upon.
	NodeId int `json:"nodeId"`
	// Selector string.
	Selector string `json:"selector"`
}

type DOMRGBA

type DOMRGBA struct {
	R int     `json:"r"`           // The red component, in the [0-255] range.
	G int     `json:"g"`           // The green component, in the [0-255] range.
	B int     `json:"b"`           // The blue component, in the [0-255] range.
	A float64 `json:"a,omitempty"` // The alpha component, in the [0-1] range (default: 1).
}

A structure holding an RGBA color.

type DOMRect

type DOMRect struct {
	X      float64 `json:"x"`      // X coordinate
	Y      float64 `json:"y"`      // Y coordinate
	Width  float64 `json:"width"`  // Rectangle width
	Height float64 `json:"height"` // Rectangle height
}

Rectangle.

type DOMRemoveAttributeParams

type DOMRemoveAttributeParams struct {
	// Id of the element to remove attribute from.
	NodeId int `json:"nodeId"`
	// Name of the attribute to remove.
	Name string `json:"name"`
}

type DOMRemoveNodeParams

type DOMRemoveNodeParams struct {
	// Id of the node to remove.
	NodeId int `json:"nodeId"`
}

type DOMRequestChildNodesParams

type DOMRequestChildNodesParams struct {
	// Id of the node to get children for.
	NodeId int `json:"nodeId"`
	// The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
	Depth int `json:"depth,omitempty"`
	// Whether or not iframes and shadow roots should be traversed when returning the sub-tree (default is false).
	Pierce bool `json:"pierce,omitempty"`
}

type DOMRequestNodeParams

type DOMRequestNodeParams struct {
	// JavaScript object id to convert into node.
	ObjectId string `json:"objectId"`
}

type DOMResolveNodeParams

type DOMResolveNodeParams struct {
	// Id of the node to resolve.
	NodeId int `json:"nodeId,omitempty"`
	// Backend identifier of the node to resolve.
	BackendNodeId int `json:"backendNodeId,omitempty"`
	// Symbolic group name that can be used to release multiple objects.
	ObjectGroup string `json:"objectGroup,omitempty"`
	// Execution context in which to resolve the node.
	ExecutionContextId int `json:"executionContextId,omitempty"`
}

type DOMScrollIntoViewIfNeededParams added in v1.0.9

type DOMScrollIntoViewIfNeededParams struct {
	// Identifier of the node.
	NodeId int `json:"nodeId,omitempty"`
	// Identifier of the backend node.
	BackendNodeId int `json:"backendNodeId,omitempty"`
	// JavaScript object id of the node wrapper.
	ObjectId string `json:"objectId,omitempty"`
	// The rect to be scrolled into view, relative to the node's border box, in CSS pixels. When omitted, center of the node will be used, similar to Element.scrollIntoView.
	Rect *DOMRect `json:"rect,omitempty"`
}

type DOMSetAttributeValueParams

type DOMSetAttributeValueParams struct {
	// Id of the element to set attribute for.
	NodeId int `json:"nodeId"`
	// Attribute name.
	Name string `json:"name"`
	// Attribute value.
	Value string `json:"value"`
}

type DOMSetAttributesAsTextParams

type DOMSetAttributesAsTextParams struct {
	// Id of the element to set attributes for.
	NodeId int `json:"nodeId"`
	// Text with a number of attributes. Will parse this text using HTML parser.
	Text string `json:"text"`
	// Attribute name to replace with new attributes derived from text in case text parsed successfully.
	Name string `json:"name,omitempty"`
}

type DOMSetChildNodesEvent

type DOMSetChildNodesEvent struct {
	Method string `json:"method"`
	Params struct {
		ParentId int        `json:"parentId"` // Parent node id to populate with children.
		Nodes    []*DOMNode `json:"nodes"`    // Child nodes array.
	} `json:"Params,omitempty"`
}

Fired when backend wants to provide client with the missing DOM structure. This happens upon most of the calls requesting node ids.

type DOMSetFileInputFilesParams

type DOMSetFileInputFilesParams struct {
	// Array of file paths to set.
	Files []string `json:"files"`
	// Identifier of the node.
	NodeId int `json:"nodeId,omitempty"`
	// Identifier of the backend node.
	BackendNodeId int `json:"backendNodeId,omitempty"`
	// JavaScript object id of the node wrapper.
	ObjectId string `json:"objectId,omitempty"`
}

type DOMSetInspectedNodeParams

type DOMSetInspectedNodeParams struct {
	// DOM node id to be accessible by means of $x command line API.
	NodeId int `json:"nodeId"`
}

type DOMSetNodeNameParams

type DOMSetNodeNameParams struct {
	// Id of the node to set name for.
	NodeId int `json:"nodeId"`
	// New node's name.
	Name string `json:"name"`
}

type DOMSetNodeStackTracesEnabledParams added in v1.0.9

type DOMSetNodeStackTracesEnabledParams struct {
	// Enable or disable.
	Enable bool `json:"enable"`
}

type DOMSetNodeValueParams

type DOMSetNodeValueParams struct {
	// Id of the node to set value for.
	NodeId int `json:"nodeId"`
	// New node's value.
	Value string `json:"value"`
}

type DOMSetOuterHTMLParams

type DOMSetOuterHTMLParams struct {
	// Id of the node to set markup for.
	NodeId int `json:"nodeId"`
	// Outer HTML markup to set.
	OuterHTML string `json:"outerHTML"`
}

type DOMShadowRootPoppedEvent

type DOMShadowRootPoppedEvent struct {
	Method string `json:"method"`
	Params struct {
		HostId int `json:"hostId"` // Host element id.
		RootId int `json:"rootId"` // Shadow root id.
	} `json:"Params,omitempty"`
}

Called when shadow root is popped from the element.

type DOMShadowRootPushedEvent

type DOMShadowRootPushedEvent struct {
	Method string `json:"method"`
	Params struct {
		HostId int      `json:"hostId"` // Host element id.
		Root   *DOMNode `json:"root"`   // Shadow root.
	} `json:"Params,omitempty"`
}

Called when shadow root is pushed into the element.

type DOMShapeOutsideInfo

type DOMShapeOutsideInfo struct {
	Bounds      []float64     `json:"bounds"`      // Shape bounds
	Shape       []interface{} `json:"shape"`       // Shape coordinate details
	MarginShape []interface{} `json:"marginShape"` // Margin shape bounds
}

CSS Shape Outside details.

type DOMSnapshot

type DOMSnapshot struct {
	// contains filtered or unexported fields
}

func NewDOMSnapshot

func NewDOMSnapshot(target gcdmessage.ChromeTargeter) *DOMSnapshot

func (*DOMSnapshot) CaptureSnapshot

func (c *DOMSnapshot) CaptureSnapshot(computedStyles []string, includePaintOrder bool, includeDOMRects bool) ([]*DOMSnapshotDocumentSnapshot, []string, error)

CaptureSnapshot - Returns a document snapshot, including the full DOM tree of the root node (including iframes, template contents, and imported documents) in a flattened array, as well as layout and white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is flattened. computedStyles - Whitelist of computed styles to return. includePaintOrder - Whether to include layout object paint orders into the snapshot. includeDOMRects - Whether to include DOM rectangles (offsetRects, clientRects, scrollRects) into the snapshot Returns - documents - The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document. strings - Shared string table that all string properties refer to with indexes.

func (*DOMSnapshot) CaptureSnapshotWithParams

func (c *DOMSnapshot) CaptureSnapshotWithParams(v *DOMSnapshotCaptureSnapshotParams) ([]*DOMSnapshotDocumentSnapshot, []string, error)

CaptureSnapshotWithParams - Returns a document snapshot, including the full DOM tree of the root node (including iframes, template contents, and imported documents) in a flattened array, as well as layout and white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is flattened. Returns - documents - The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document. strings - Shared string table that all string properties refer to with indexes.

func (*DOMSnapshot) Disable

func (c *DOMSnapshot) Disable() (*gcdmessage.ChromeResponse, error)

Disables DOM snapshot agent for the given page.

func (*DOMSnapshot) Enable

func (c *DOMSnapshot) Enable() (*gcdmessage.ChromeResponse, error)

Enables DOM snapshot agent for the given page.

func (*DOMSnapshot) GetSnapshot

func (c *DOMSnapshot) GetSnapshot(computedStyleWhitelist []string, includeEventListeners bool, includePaintOrder bool, includeUserAgentShadowTree bool) ([]*DOMSnapshotDOMNode, []*DOMSnapshotLayoutTreeNode, []*DOMSnapshotComputedStyle, error)

GetSnapshot - Returns a document snapshot, including the full DOM tree of the root node (including iframes, template contents, and imported documents) in a flattened array, as well as layout and white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is flattened. computedStyleWhitelist - Whitelist of computed styles to return. includeEventListeners - Whether or not to retrieve details of DOM listeners (default false). includePaintOrder - Whether to determine and include the paint order index of LayoutTreeNodes (default false). includeUserAgentShadowTree - Whether to include UA shadow tree in the snapshot (default false). Returns - domNodes - The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document. layoutTreeNodes - The nodes in the layout tree. computedStyles - Whitelisted ComputedStyle properties for each node in the layout tree.

func (*DOMSnapshot) GetSnapshotWithParams

GetSnapshotWithParams - Returns a document snapshot, including the full DOM tree of the root node (including iframes, template contents, and imported documents) in a flattened array, as well as layout and white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is flattened. Returns - domNodes - The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document. layoutTreeNodes - The nodes in the layout tree. computedStyles - Whitelisted ComputedStyle properties for each node in the layout tree.

type DOMSnapshotCaptureSnapshotParams

type DOMSnapshotCaptureSnapshotParams struct {
	// Whitelist of computed styles to return.
	ComputedStyles []string `json:"computedStyles"`
	// Whether to include layout object paint orders into the snapshot.
	IncludePaintOrder bool `json:"includePaintOrder,omitempty"`
	// Whether to include DOM rectangles (offsetRects, clientRects, scrollRects) into the snapshot
	IncludeDOMRects bool `json:"includeDOMRects,omitempty"`
}

type DOMSnapshotComputedStyle

type DOMSnapshotComputedStyle struct {
	Properties []*DOMSnapshotNameValue `json:"properties"` // Name/value pairs of computed style properties.
}

A subset of the full ComputedStyle as defined by the request whitelist.

type DOMSnapshotDOMNode

type DOMSnapshotDOMNode struct {
	NodeType             int                         `json:"nodeType"`                       // `Node`'s nodeType.
	NodeName             string                      `json:"nodeName"`                       // `Node`'s nodeName.
	NodeValue            string                      `json:"nodeValue"`                      // `Node`'s nodeValue.
	TextValue            string                      `json:"textValue,omitempty"`            // Only set for textarea elements, contains the text value.
	InputValue           string                      `json:"inputValue,omitempty"`           // Only set for input elements, contains the input's associated text value.
	InputChecked         bool                        `json:"inputChecked,omitempty"`         // Only set for radio and checkbox input elements, indicates if the element has been checked
	OptionSelected       bool                        `json:"optionSelected,omitempty"`       // Only set for option elements, indicates if the element has been selected
	BackendNodeId        int                         `json:"backendNodeId"`                  // `Node`'s id, corresponds to DOM.Node.backendNodeId.
	ChildNodeIndexes     []int                       `json:"childNodeIndexes,omitempty"`     // The indexes of the node's child nodes in the `domNodes` array returned by `getSnapshot`, if any.
	Attributes           []*DOMSnapshotNameValue     `json:"attributes,omitempty"`           // Attributes of an `Element` node.
	PseudoElementIndexes []int                       `json:"pseudoElementIndexes,omitempty"` // Indexes of pseudo elements associated with this node in the `domNodes` array returned by `getSnapshot`, if any.
	LayoutNodeIndex      int                         `json:"layoutNodeIndex,omitempty"`      // The index of the node's related layout tree node in the `layoutTreeNodes` array returned by `getSnapshot`, if any.
	DocumentURL          string                      `json:"documentURL,omitempty"`          // Document URL that `Document` or `FrameOwner` node points to.
	BaseURL              string                      `json:"baseURL,omitempty"`              // Base URL that `Document` or `FrameOwner` node uses for URL completion.
	ContentLanguage      string                      `json:"contentLanguage,omitempty"`      // Only set for documents, contains the document's content language.
	DocumentEncoding     string                      `json:"documentEncoding,omitempty"`     // Only set for documents, contains the document's character set encoding.
	PublicId             string                      `json:"publicId,omitempty"`             // `DocumentType` node's publicId.
	SystemId             string                      `json:"systemId,omitempty"`             // `DocumentType` node's systemId.
	FrameId              string                      `json:"frameId,omitempty"`              // Frame ID for frame owner elements and also for the document node.
	ContentDocumentIndex int                         `json:"contentDocumentIndex,omitempty"` // The index of a frame owner element's content document in the `domNodes` array returned by `getSnapshot`, if any.
	PseudoType           string                      `json:"pseudoType,omitempty"`           // Type of a pseudo element node. enum values: first-line, first-letter, before, after, marker, backdrop, selection, first-line-inherited, scrollbar, scrollbar-thumb, scrollbar-button, scrollbar-track, scrollbar-track-piece, scrollbar-corner, resizer, input-list-button
	ShadowRootType       string                      `json:"shadowRootType,omitempty"`       // Shadow root type. enum values: user-agent, open, closed
	IsClickable          bool                        `json:"isClickable,omitempty"`          // Whether this DOM node responds to mouse clicks. This includes nodes that have had click event listeners attached via JavaScript as well as anchor tags that naturally navigate when clicked.
	EventListeners       []*DOMDebuggerEventListener `json:"eventListeners,omitempty"`       // Details of the node's event listeners, if any.
	CurrentSourceURL     string                      `json:"currentSourceURL,omitempty"`     // The selected url for nodes with a srcset attribute.
	OriginURL            string                      `json:"originURL,omitempty"`            // The url of the script (if any) that generates this node.
	ScrollOffsetX        float64                     `json:"scrollOffsetX,omitempty"`        // Scroll offsets, set when this node is a Document.
	ScrollOffsetY        float64                     `json:"scrollOffsetY,omitempty"`        //
}

A Node in the DOM tree.

type DOMSnapshotDocumentSnapshot

type DOMSnapshotDocumentSnapshot struct {
	DocumentURL     int                            `json:"documentURL"`             // Document URL that `Document` or `FrameOwner` node points to.
	Title           int                            `json:"title"`                   // Document title.
	BaseURL         int                            `json:"baseURL"`                 // Base URL that `Document` or `FrameOwner` node uses for URL completion.
	ContentLanguage int                            `json:"contentLanguage"`         // Contains the document's content language.
	EncodingName    int                            `json:"encodingName"`            // Contains the document's character set encoding.
	PublicId        int                            `json:"publicId"`                // `DocumentType` node's publicId.
	SystemId        int                            `json:"systemId"`                // `DocumentType` node's systemId.
	FrameId         int                            `json:"frameId"`                 // Frame ID for frame owner elements and also for the document node.
	Nodes           *DOMSnapshotNodeTreeSnapshot   `json:"nodes"`                   // A table with dom nodes.
	Layout          *DOMSnapshotLayoutTreeSnapshot `json:"layout"`                  // The nodes in the layout tree.
	TextBoxes       *DOMSnapshotTextBoxSnapshot    `json:"textBoxes"`               // The post-layout inline text nodes.
	ScrollOffsetX   float64                        `json:"scrollOffsetX,omitempty"` // Horizontal scroll offset.
	ScrollOffsetY   float64                        `json:"scrollOffsetY,omitempty"` // Vertical scroll offset.
	ContentWidth    float64                        `json:"contentWidth,omitempty"`  // Document content width.
	ContentHeight   float64                        `json:"contentHeight,omitempty"` // Document content height.
}

Document snapshot.

type DOMSnapshotGetSnapshotParams

type DOMSnapshotGetSnapshotParams struct {
	// Whitelist of computed styles to return.
	ComputedStyleWhitelist []string `json:"computedStyleWhitelist"`
	// Whether or not to retrieve details of DOM listeners (default false).
	IncludeEventListeners bool `json:"includeEventListeners,omitempty"`
	// Whether to determine and include the paint order index of LayoutTreeNodes (default false).
	IncludePaintOrder bool `json:"includePaintOrder,omitempty"`
	// Whether to include UA shadow tree in the snapshot (default false).
	IncludeUserAgentShadowTree bool `json:"includeUserAgentShadowTree,omitempty"`
}

type DOMSnapshotInlineTextBox

type DOMSnapshotInlineTextBox struct {
	BoundingBox         *DOMRect `json:"boundingBox"`         // The bounding box in document coordinates. Note that scroll offset of the document is ignored.
	StartCharacterIndex int      `json:"startCharacterIndex"` // The starting index in characters, for this post layout textbox substring. Characters that would be represented as a surrogate pair in UTF-16 have length 2.
	NumCharacters       int      `json:"numCharacters"`       // The number of characters in this post layout textbox substring. Characters that would be represented as a surrogate pair in UTF-16 have length 2.
}

Details of post layout rendered text positions. The exact layout should not be regarded as stable and may change between versions.

type DOMSnapshotLayoutTreeNode

type DOMSnapshotLayoutTreeNode struct {
	DomNodeIndex      int                         `json:"domNodeIndex"`                // The index of the related DOM node in the `domNodes` array returned by `getSnapshot`.
	BoundingBox       *DOMRect                    `json:"boundingBox"`                 // The bounding box in document coordinates. Note that scroll offset of the document is ignored.
	LayoutText        string                      `json:"layoutText,omitempty"`        // Contents of the LayoutText, if any.
	InlineTextNodes   []*DOMSnapshotInlineTextBox `json:"inlineTextNodes,omitempty"`   // The post-layout inline text nodes, if any.
	StyleIndex        int                         `json:"styleIndex,omitempty"`        // Index into the `computedStyles` array returned by `getSnapshot`.
	PaintOrder        int                         `json:"paintOrder,omitempty"`        // Global paint order index, which is determined by the stacking order of the nodes. Nodes that are painted together will have the same index. Only provided if includePaintOrder in getSnapshot was true.
	IsStackingContext bool                        `json:"isStackingContext,omitempty"` // Set to true to indicate the element begins a new stacking context.
}

Details of an element in the DOM tree with a LayoutObject.

type DOMSnapshotLayoutTreeSnapshot

type DOMSnapshotLayoutTreeSnapshot struct {
	NodeIndex        []int                       `json:"nodeIndex"`             // Index of the corresponding node in the `NodeTreeSnapshot` array returned by `captureSnapshot`.
	Styles           []int                       `json:"styles"`                // Array of indexes specifying computed style strings, filtered according to the `computedStyles` parameter passed to `captureSnapshot`.
	Bounds           []float64                   `json:"bounds"`                // The absolute position bounding box.
	Text             []int                       `json:"text"`                  // Contents of the LayoutText, if any.
	StackingContexts *DOMSnapshotRareBooleanData `json:"stackingContexts"`      // Stacking context information.
	PaintOrders      []int                       `json:"paintOrders,omitempty"` // Global paint order index, which is determined by the stacking order of the nodes. Nodes that are painted together will have the same index. Only provided if includePaintOrder in captureSnapshot was true.
	OffsetRects      []float64                   `json:"offsetRects,omitempty"` // The offset rect of nodes. Only available when includeDOMRects is set to true
	ScrollRects      []float64                   `json:"scrollRects,omitempty"` // The scroll rect of nodes. Only available when includeDOMRects is set to true
	ClientRects      []float64                   `json:"clientRects,omitempty"` // The client rect of nodes. Only available when includeDOMRects is set to true
}

Table of details of an element in the DOM tree with a LayoutObject.

type DOMSnapshotNameValue

type DOMSnapshotNameValue struct {
	Name  string `json:"name"`  // Attribute/property name.
	Value string `json:"value"` // Attribute/property value.
}

A name/value pair.

type DOMSnapshotNodeTreeSnapshot

type DOMSnapshotNodeTreeSnapshot struct {
	ParentIndex          []int                       `json:"parentIndex,omitempty"`          // Parent node index.
	NodeType             []int                       `json:"nodeType,omitempty"`             // `Node`'s nodeType.
	NodeName             []int                       `json:"nodeName,omitempty"`             // `Node`'s nodeName.
	NodeValue            []int                       `json:"nodeValue,omitempty"`            // `Node`'s nodeValue.
	BackendNodeId        []int                       `json:"backendNodeId,omitempty"`        // `Node`'s id, corresponds to DOM.Node.backendNodeId.
	Attributes           []int                       `json:"attributes,omitempty"`           // Attributes of an `Element` node. Flatten name, value pairs.
	TextValue            *DOMSnapshotRareStringData  `json:"textValue,omitempty"`            // Only set for textarea elements, contains the text value.
	InputValue           *DOMSnapshotRareStringData  `json:"inputValue,omitempty"`           // Only set for input elements, contains the input's associated text value.
	InputChecked         *DOMSnapshotRareBooleanData `json:"inputChecked,omitempty"`         // Only set for radio and checkbox input elements, indicates if the element has been checked
	OptionSelected       *DOMSnapshotRareBooleanData `json:"optionSelected,omitempty"`       // Only set for option elements, indicates if the element has been selected
	ContentDocumentIndex *DOMSnapshotRareIntegerData `json:"contentDocumentIndex,omitempty"` // The index of the document in the list of the snapshot documents.
	PseudoType           *DOMSnapshotRareStringData  `json:"pseudoType,omitempty"`           // Type of a pseudo element node.
	IsClickable          *DOMSnapshotRareBooleanData `json:"isClickable,omitempty"`          // Whether this DOM node responds to mouse clicks. This includes nodes that have had click event listeners attached via JavaScript as well as anchor tags that naturally navigate when clicked.
	CurrentSourceURL     *DOMSnapshotRareStringData  `json:"currentSourceURL,omitempty"`     // The selected url for nodes with a srcset attribute.
	OriginURL            *DOMSnapshotRareStringData  `json:"originURL,omitempty"`            // The url of the script (if any) that generates this node.
}

Table containing nodes.

type DOMSnapshotRareBooleanData

type DOMSnapshotRareBooleanData struct {
	Index []int `json:"index"` //
}

No Description.

type DOMSnapshotRareIntegerData

type DOMSnapshotRareIntegerData struct {
	Index []int `json:"index"` //
	Value []int `json:"value"` //
}

No Description.

type DOMSnapshotRareStringData

type DOMSnapshotRareStringData struct {
	Index []int `json:"index"` //
	Value []int `json:"value"` //
}

Data that is only present on rare nodes.

type DOMSnapshotTextBoxSnapshot

type DOMSnapshotTextBoxSnapshot struct {
	LayoutIndex []int     `json:"layoutIndex"` // Index of the layout tree node that owns this box collection.
	Bounds      []float64 `json:"bounds"`      // The absolute position bounding box.
	Start       []int     `json:"start"`       // The starting index in characters, for this post layout textbox substring. Characters that would be represented as a surrogate pair in UTF-16 have length 2.
	Length      []int     `json:"length"`      // The number of characters in this post layout textbox substring. Characters that would be represented as a surrogate pair in UTF-16 have length 2.
}

Table of details of the post layout rendered text positions. The exact layout should not be regarded as stable and may change between versions.

type DOMStorage

type DOMStorage struct {
	// contains filtered or unexported fields
}

func NewDOMStorage

func NewDOMStorage(target gcdmessage.ChromeTargeter) *DOMStorage

func (*DOMStorage) Clear

Clear - storageId -

func (*DOMStorage) ClearWithParams

func (c *DOMStorage) ClearWithParams(v *DOMStorageClearParams) (*gcdmessage.ChromeResponse, error)

ClearWithParams -

func (*DOMStorage) Disable

func (c *DOMStorage) Disable() (*gcdmessage.ChromeResponse, error)

Disables storage tracking, prevents storage events from being sent to the client.

func (*DOMStorage) Enable

func (c *DOMStorage) Enable() (*gcdmessage.ChromeResponse, error)

Enables storage tracking, storage events will now be delivered to the client.

func (*DOMStorage) GetDOMStorageItems

func (c *DOMStorage) GetDOMStorageItems(storageId *DOMStorageStorageId) ([]string, error)

GetDOMStorageItems - storageId - Returns - entries -

func (*DOMStorage) GetDOMStorageItemsWithParams

func (c *DOMStorage) GetDOMStorageItemsWithParams(v *DOMStorageGetDOMStorageItemsParams) ([]string, error)

GetDOMStorageItemsWithParams - Returns - entries -

func (*DOMStorage) RemoveDOMStorageItem

func (c *DOMStorage) RemoveDOMStorageItem(storageId *DOMStorageStorageId, key string) (*gcdmessage.ChromeResponse, error)

RemoveDOMStorageItem - storageId - key -

func (*DOMStorage) RemoveDOMStorageItemWithParams

func (c *DOMStorage) RemoveDOMStorageItemWithParams(v *DOMStorageRemoveDOMStorageItemParams) (*gcdmessage.ChromeResponse, error)

RemoveDOMStorageItemWithParams -

func (*DOMStorage) SetDOMStorageItem

func (c *DOMStorage) SetDOMStorageItem(storageId *DOMStorageStorageId, key string, value string) (*gcdmessage.ChromeResponse, error)

SetDOMStorageItem - storageId - key - value -

func (*DOMStorage) SetDOMStorageItemWithParams

func (c *DOMStorage) SetDOMStorageItemWithParams(v *DOMStorageSetDOMStorageItemParams) (*gcdmessage.ChromeResponse, error)

SetDOMStorageItemWithParams -

type DOMStorageClearParams

type DOMStorageClearParams struct {
	//
	StorageId *DOMStorageStorageId `json:"storageId"`
}

type DOMStorageDomStorageItemAddedEvent

type DOMStorageDomStorageItemAddedEvent struct {
	Method string `json:"method"`
	Params struct {
		StorageId *DOMStorageStorageId `json:"storageId"` //
		Key       string               `json:"key"`       //
		NewValue  string               `json:"newValue"`  //
	} `json:"Params,omitempty"`
}

type DOMStorageDomStorageItemRemovedEvent

type DOMStorageDomStorageItemRemovedEvent struct {
	Method string `json:"method"`
	Params struct {
		StorageId *DOMStorageStorageId `json:"storageId"` //
		Key       string               `json:"key"`       //
	} `json:"Params,omitempty"`
}

type DOMStorageDomStorageItemUpdatedEvent

type DOMStorageDomStorageItemUpdatedEvent struct {
	Method string `json:"method"`
	Params struct {
		StorageId *DOMStorageStorageId `json:"storageId"` //
		Key       string               `json:"key"`       //
		OldValue  string               `json:"oldValue"`  //
		NewValue  string               `json:"newValue"`  //
	} `json:"Params,omitempty"`
}

type DOMStorageDomStorageItemsClearedEvent

type DOMStorageDomStorageItemsClearedEvent struct {
	Method string `json:"method"`
	Params struct {
		StorageId *DOMStorageStorageId `json:"storageId"` //
	} `json:"Params,omitempty"`
}

type DOMStorageGetDOMStorageItemsParams

type DOMStorageGetDOMStorageItemsParams struct {
	//
	StorageId *DOMStorageStorageId `json:"storageId"`
}

type DOMStorageRemoveDOMStorageItemParams

type DOMStorageRemoveDOMStorageItemParams struct {
	//
	StorageId *DOMStorageStorageId `json:"storageId"`
	//
	Key string `json:"key"`
}

type DOMStorageSetDOMStorageItemParams

type DOMStorageSetDOMStorageItemParams struct {
	//
	StorageId *DOMStorageStorageId `json:"storageId"`
	//
	Key string `json:"key"`
	//
	Value string `json:"value"`
}

type DOMStorageStorageId

type DOMStorageStorageId struct {
	SecurityOrigin string `json:"securityOrigin"` // Security origin for the storage.
	IsLocalStorage bool   `json:"isLocalStorage"` // Whether the storage is local storage (not session storage).
}

DOM Storage identifier.

type Database

type Database struct {
	// contains filtered or unexported fields
}

func NewDatabase

func NewDatabase(target gcdmessage.ChromeTargeter) *Database

func (*Database) Disable

func (c *Database) Disable() (*gcdmessage.ChromeResponse, error)

Disables database tracking, prevents database events from being sent to the client.

func (*Database) Enable

func (c *Database) Enable() (*gcdmessage.ChromeResponse, error)

Enables database tracking, database events will now be delivered to the client.

func (*Database) ExecuteSQL

func (c *Database) ExecuteSQL(databaseId string, query string) ([]string, []interface{}, *DatabaseError, error)

ExecuteSQL - databaseId - query - Returns - columnNames - values - sqlError -

func (*Database) ExecuteSQLWithParams

func (c *Database) ExecuteSQLWithParams(v *DatabaseExecuteSQLParams) ([]string, []interface{}, *DatabaseError, error)

ExecuteSQLWithParams - Returns - columnNames - values - sqlError -

func (*Database) GetDatabaseTableNames

func (c *Database) GetDatabaseTableNames(databaseId string) ([]string, error)

GetDatabaseTableNames - databaseId - Returns - tableNames -

func (*Database) GetDatabaseTableNamesWithParams

func (c *Database) GetDatabaseTableNamesWithParams(v *DatabaseGetDatabaseTableNamesParams) ([]string, error)

GetDatabaseTableNamesWithParams - Returns - tableNames -

type DatabaseAddDatabaseEvent

type DatabaseAddDatabaseEvent struct {
	Method string `json:"method"`
	Params struct {
		Database *DatabaseDatabase `json:"database"` //
	} `json:"Params,omitempty"`
}

type DatabaseDatabase

type DatabaseDatabase struct {
	Id      string `json:"id"`      // Database ID.
	Domain  string `json:"domain"`  // Database domain.
	Name    string `json:"name"`    // Database name.
	Version string `json:"version"` // Database version.
}

Database object.

type DatabaseError

type DatabaseError struct {
	Message string `json:"message"` // Error message.
	Code    int    `json:"code"`    // Error code.
}

Database error.

type DatabaseExecuteSQLParams

type DatabaseExecuteSQLParams struct {
	//
	DatabaseId string `json:"databaseId"`
	//
	Query string `json:"query"`
}

type DatabaseGetDatabaseTableNamesParams

type DatabaseGetDatabaseTableNamesParams struct {
	//
	DatabaseId string `json:"databaseId"`
}

type Debugger

type Debugger struct {
	// contains filtered or unexported fields
}

func NewDebugger

func NewDebugger(target gcdmessage.ChromeTargeter) *Debugger

func (*Debugger) ContinueToLocation

func (c *Debugger) ContinueToLocation(location *DebuggerLocation, targetCallFrames string) (*gcdmessage.ChromeResponse, error)

ContinueToLocation - Continues execution until specific location is reached. location - Location to continue to. targetCallFrames -

func (*Debugger) ContinueToLocationWithParams

func (c *Debugger) ContinueToLocationWithParams(v *DebuggerContinueToLocationParams) (*gcdmessage.ChromeResponse, error)

ContinueToLocationWithParams - Continues execution until specific location is reached.

func (*Debugger) Disable

func (c *Debugger) Disable() (*gcdmessage.ChromeResponse, error)

Disables debugger for given page.

func (*Debugger) Enable

func (c *Debugger) Enable(maxScriptsCacheSize float64) (string, error)

Enable - Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. maxScriptsCacheSize - The maximum size in bytes of collected scripts (not referenced by other heap objects) the debugger can hold. Puts no limit if paramter is omitted. Returns - debuggerId - Unique identifier of the debugger.

func (*Debugger) EnableWithParams added in v1.0.6

func (c *Debugger) EnableWithParams(v *DebuggerEnableParams) (string, error)

EnableWithParams - Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. Returns - debuggerId - Unique identifier of the debugger.

func (*Debugger) EvaluateOnCallFrame

func (c *Debugger) EvaluateOnCallFrame(callFrameId string, expression string, objectGroup string, includeCommandLineAPI bool, silent bool, returnByValue bool, generatePreview bool, throwOnSideEffect bool, timeout float64) (*RuntimeRemoteObject, *RuntimeExceptionDetails, error)

EvaluateOnCallFrame - Evaluates expression on a given call frame. callFrameId - Call frame identifier to evaluate on. expression - Expression to evaluate. objectGroup - String object group name to put result into (allows rapid releasing resulting object handles using `releaseObjectGroup`). includeCommandLineAPI - Specifies whether command line API should be available to the evaluated expression, defaults to false. silent - In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides `setPauseOnException` state. returnByValue - Whether the result is expected to be a JSON object that should be sent by value. generatePreview - Whether preview should be generated for the result. throwOnSideEffect - Whether to throw an exception if side effect cannot be ruled out during evaluation. timeout - Terminate execution after timing out (number of milliseconds). Returns - result - Object wrapper for the evaluation result. exceptionDetails - Exception details.

func (*Debugger) EvaluateOnCallFrameWithParams

EvaluateOnCallFrameWithParams - Evaluates expression on a given call frame. Returns - result - Object wrapper for the evaluation result. exceptionDetails - Exception details.

func (*Debugger) ExecuteWasmEvaluator added in v1.0.10

func (c *Debugger) ExecuteWasmEvaluator(callFrameId string, evaluator string, timeout float64) (*RuntimeRemoteObject, *RuntimeExceptionDetails, error)

ExecuteWasmEvaluator - Execute a Wasm Evaluator module on a given call frame. callFrameId - WebAssembly call frame identifier to evaluate on. evaluator - Code of the evaluator module. timeout - Terminate execution after timing out (number of milliseconds). Returns - result - Object wrapper for the evaluation result. exceptionDetails - Exception details.

func (*Debugger) ExecuteWasmEvaluatorWithParams added in v1.0.10

ExecuteWasmEvaluatorWithParams - Execute a Wasm Evaluator module on a given call frame. Returns - result - Object wrapper for the evaluation result. exceptionDetails - Exception details.

func (*Debugger) GetPossibleBreakpoints

func (c *Debugger) GetPossibleBreakpoints(start *DebuggerLocation, end *DebuggerLocation, restrictToFunction bool) ([]*DebuggerBreakLocation, error)

GetPossibleBreakpoints - Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. start - Start of range to search possible breakpoint locations in. end - End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range. restrictToFunction - Only consider locations which are in the same (non-nested) function as start. Returns - locations - List of the possible breakpoint locations.

func (*Debugger) GetPossibleBreakpointsWithParams

func (c *Debugger) GetPossibleBreakpointsWithParams(v *DebuggerGetPossibleBreakpointsParams) ([]*DebuggerBreakLocation, error)

GetPossibleBreakpointsWithParams - Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. Returns - locations - List of the possible breakpoint locations.

func (*Debugger) GetScriptSource

func (c *Debugger) GetScriptSource(scriptId string) (string, string, error)

GetScriptSource - Returns source for the script with given id. scriptId - Id of the script to get source for. Returns - scriptSource - Script source (empty in case of Wasm bytecode). bytecode - Wasm bytecode.

func (*Debugger) GetScriptSourceWithParams

func (c *Debugger) GetScriptSourceWithParams(v *DebuggerGetScriptSourceParams) (string, string, error)

GetScriptSourceWithParams - Returns source for the script with given id. Returns - scriptSource - Script source (empty in case of Wasm bytecode). bytecode - Wasm bytecode.

func (*Debugger) GetStackTrace

func (c *Debugger) GetStackTrace(stackTraceId *RuntimeStackTraceId) (*RuntimeStackTrace, error)

GetStackTrace - Returns stack trace with given `stackTraceId`. stackTraceId - Returns - stackTrace -

func (*Debugger) GetStackTraceWithParams

func (c *Debugger) GetStackTraceWithParams(v *DebuggerGetStackTraceParams) (*RuntimeStackTrace, error)

GetStackTraceWithParams - Returns stack trace with given `stackTraceId`. Returns - stackTrace -

func (*Debugger) GetWasmBytecode added in v1.0.9

func (c *Debugger) GetWasmBytecode(scriptId string) (string, error)

GetWasmBytecode - This command is deprecated. Use getScriptSource instead. scriptId - Id of the Wasm script to get source for. Returns - bytecode - Script source.

func (*Debugger) GetWasmBytecodeWithParams added in v1.0.9

func (c *Debugger) GetWasmBytecodeWithParams(v *DebuggerGetWasmBytecodeParams) (string, error)

GetWasmBytecodeWithParams - This command is deprecated. Use getScriptSource instead. Returns - bytecode - Script source.

func (*Debugger) Pause

func (c *Debugger) Pause() (*gcdmessage.ChromeResponse, error)

Stops on the next JavaScript statement.

func (*Debugger) PauseOnAsyncCall

func (c *Debugger) PauseOnAsyncCall(parentStackTraceId *RuntimeStackTraceId) (*gcdmessage.ChromeResponse, error)

PauseOnAsyncCall - parentStackTraceId - Debugger will pause when async call with given stack trace is started.

func (*Debugger) PauseOnAsyncCallWithParams

func (c *Debugger) PauseOnAsyncCallWithParams(v *DebuggerPauseOnAsyncCallParams) (*gcdmessage.ChromeResponse, error)

PauseOnAsyncCallWithParams -

func (*Debugger) RemoveBreakpoint

func (c *Debugger) RemoveBreakpoint(breakpointId string) (*gcdmessage.ChromeResponse, error)

RemoveBreakpoint - Removes JavaScript breakpoint. breakpointId -

func (*Debugger) RemoveBreakpointWithParams

func (c *Debugger) RemoveBreakpointWithParams(v *DebuggerRemoveBreakpointParams) (*gcdmessage.ChromeResponse, error)

RemoveBreakpointWithParams - Removes JavaScript breakpoint.

func (*Debugger) RestartFrame

func (c *Debugger) RestartFrame(callFrameId string) ([]*DebuggerCallFrame, *RuntimeStackTrace, *RuntimeStackTraceId, error)

RestartFrame - Restarts particular call frame from the beginning. callFrameId - Call frame identifier to evaluate on. Returns - callFrames - New stack trace. asyncStackTrace - Async stack trace, if any. asyncStackTraceId - Async stack trace, if any.

func (*Debugger) RestartFrameWithParams

RestartFrameWithParams - Restarts particular call frame from the beginning. Returns - callFrames - New stack trace. asyncStackTrace - Async stack trace, if any. asyncStackTraceId - Async stack trace, if any.

func (*Debugger) Resume

func (c *Debugger) Resume(terminateOnResume bool) (*gcdmessage.ChromeResponse, error)

Resume - Resumes JavaScript execution. terminateOnResume - Set to true to terminate execution upon resuming execution. In contrast to Runtime.terminateExecution, this will allows to execute further JavaScript (i.e. via evaluation) until execution of the paused code is actually resumed, at which point termination is triggered. If execution is currently not paused, this parameter has no effect.

func (*Debugger) ResumeWithParams added in v1.0.9

func (c *Debugger) ResumeWithParams(v *DebuggerResumeParams) (*gcdmessage.ChromeResponse, error)

ResumeWithParams - Resumes JavaScript execution.

func (*Debugger) SearchInContent

func (c *Debugger) SearchInContent(scriptId string, query string, caseSensitive bool, isRegex bool) ([]*DebuggerSearchMatch, error)

SearchInContent - Searches for given string in script content. scriptId - Id of the script to search in. query - String to search for. caseSensitive - If true, search is case sensitive. isRegex - If true, treats string parameter as regex. Returns - result - List of search matches.

func (*Debugger) SearchInContentWithParams

func (c *Debugger) SearchInContentWithParams(v *DebuggerSearchInContentParams) ([]*DebuggerSearchMatch, error)

SearchInContentWithParams - Searches for given string in script content. Returns - result - List of search matches.

func (*Debugger) SetAsyncCallStackDepth

func (c *Debugger) SetAsyncCallStackDepth(maxDepth int) (*gcdmessage.ChromeResponse, error)

SetAsyncCallStackDepth - Enables or disables async call stacks tracking. maxDepth - Maximum depth of async call stacks. Setting to `0` will effectively disable collecting async call stacks (default).

func (*Debugger) SetAsyncCallStackDepthWithParams

func (c *Debugger) SetAsyncCallStackDepthWithParams(v *DebuggerSetAsyncCallStackDepthParams) (*gcdmessage.ChromeResponse, error)

SetAsyncCallStackDepthWithParams - Enables or disables async call stacks tracking.

func (*Debugger) SetBlackboxPatterns

func (c *Debugger) SetBlackboxPatterns(patterns []string) (*gcdmessage.ChromeResponse, error)

SetBlackboxPatterns - Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. patterns - Array of regexps that will be used to check script url for blackbox state.

func (*Debugger) SetBlackboxPatternsWithParams

func (c *Debugger) SetBlackboxPatternsWithParams(v *DebuggerSetBlackboxPatternsParams) (*gcdmessage.ChromeResponse, error)

SetBlackboxPatternsWithParams - Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful.

func (*Debugger) SetBlackboxedRanges

func (c *Debugger) SetBlackboxedRanges(scriptId string, positions []*DebuggerScriptPosition) (*gcdmessage.ChromeResponse, error)

SetBlackboxedRanges - Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted. scriptId - Id of the script. positions -

func (*Debugger) SetBlackboxedRangesWithParams

func (c *Debugger) SetBlackboxedRangesWithParams(v *DebuggerSetBlackboxedRangesParams) (*gcdmessage.ChromeResponse, error)

SetBlackboxedRangesWithParams - Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted.

func (*Debugger) SetBreakpoint

func (c *Debugger) SetBreakpoint(location *DebuggerLocation, condition string) (string, *DebuggerLocation, error)

SetBreakpoint - Sets JavaScript breakpoint at a given location. location - Location to set breakpoint in. condition - Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. Returns - breakpointId - Id of the created breakpoint for further reference. actualLocation - Location this breakpoint resolved into.

func (*Debugger) SetBreakpointByUrl

func (c *Debugger) SetBreakpointByUrl(lineNumber int, url string, urlRegex string, scriptHash string, columnNumber int, condition string) (string, []*DebuggerLocation, error)

SetBreakpointByUrl - Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in `locations` property. Further matching script parsing will result in subsequent `breakpointResolved` events issued. This logical breakpoint will survive page reloads. lineNumber - Line number to set breakpoint at. url - URL of the resources to set breakpoint on. urlRegex - Regex pattern for the URLs of the resources to set breakpoints on. Either `url` or `urlRegex` must be specified. scriptHash - Script hash of the resources to set breakpoint on. columnNumber - Offset in the line to set breakpoint at. condition - Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. Returns - breakpointId - Id of the created breakpoint for further reference. locations - List of the locations this breakpoint resolved into upon addition.

func (*Debugger) SetBreakpointByUrlWithParams

func (c *Debugger) SetBreakpointByUrlWithParams(v *DebuggerSetBreakpointByUrlParams) (string, []*DebuggerLocation, error)

SetBreakpointByUrlWithParams - Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in `locations` property. Further matching script parsing will result in subsequent `breakpointResolved` events issued. This logical breakpoint will survive page reloads. Returns - breakpointId - Id of the created breakpoint for further reference. locations - List of the locations this breakpoint resolved into upon addition.

func (*Debugger) SetBreakpointOnFunctionCall

func (c *Debugger) SetBreakpointOnFunctionCall(objectId string, condition string) (string, error)

SetBreakpointOnFunctionCall - Sets JavaScript breakpoint before each call to the given function. If another function was created from the same source as a given one, calling it will also trigger the breakpoint. objectId - Function object id. condition - Expression to use as a breakpoint condition. When specified, debugger will stop on the breakpoint if this expression evaluates to true. Returns - breakpointId - Id of the created breakpoint for further reference.

func (*Debugger) SetBreakpointOnFunctionCallWithParams

func (c *Debugger) SetBreakpointOnFunctionCallWithParams(v *DebuggerSetBreakpointOnFunctionCallParams) (string, error)

SetBreakpointOnFunctionCallWithParams - Sets JavaScript breakpoint before each call to the given function. If another function was created from the same source as a given one, calling it will also trigger the breakpoint. Returns - breakpointId - Id of the created breakpoint for further reference.

func (*Debugger) SetBreakpointWithParams

func (c *Debugger) SetBreakpointWithParams(v *DebuggerSetBreakpointParams) (string, *DebuggerLocation, error)

SetBreakpointWithParams - Sets JavaScript breakpoint at a given location. Returns - breakpointId - Id of the created breakpoint for further reference. actualLocation - Location this breakpoint resolved into.

func (*Debugger) SetBreakpointsActive

func (c *Debugger) SetBreakpointsActive(active bool) (*gcdmessage.ChromeResponse, error)

SetBreakpointsActive - Activates / deactivates all breakpoints on the page. active - New value for breakpoints active state.

func (*Debugger) SetBreakpointsActiveWithParams

func (c *Debugger) SetBreakpointsActiveWithParams(v *DebuggerSetBreakpointsActiveParams) (*gcdmessage.ChromeResponse, error)

SetBreakpointsActiveWithParams - Activates / deactivates all breakpoints on the page.

func (*Debugger) SetInstrumentationBreakpoint added in v1.0.7

func (c *Debugger) SetInstrumentationBreakpoint(instrumentation string) (string, error)

SetInstrumentationBreakpoint - Sets instrumentation breakpoint. instrumentation - Instrumentation name. Returns - breakpointId - Id of the created breakpoint for further reference.

func (*Debugger) SetInstrumentationBreakpointWithParams added in v1.0.7

func (c *Debugger) SetInstrumentationBreakpointWithParams(v *DebuggerSetInstrumentationBreakpointParams) (string, error)

SetInstrumentationBreakpointWithParams - Sets instrumentation breakpoint. Returns - breakpointId - Id of the created breakpoint for further reference.

func (*Debugger) SetPauseOnExceptions

func (c *Debugger) SetPauseOnExceptions(state string) (*gcdmessage.ChromeResponse, error)

SetPauseOnExceptions - Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is `none`. state - Pause on exceptions mode.

func (*Debugger) SetPauseOnExceptionsWithParams

func (c *Debugger) SetPauseOnExceptionsWithParams(v *DebuggerSetPauseOnExceptionsParams) (*gcdmessage.ChromeResponse, error)

SetPauseOnExceptionsWithParams - Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is `none`.

func (*Debugger) SetReturnValue

func (c *Debugger) SetReturnValue(newValue *RuntimeCallArgument) (*gcdmessage.ChromeResponse, error)

SetReturnValue - Changes return value in top frame. Available only at return break position. newValue - New return value.

func (*Debugger) SetReturnValueWithParams

func (c *Debugger) SetReturnValueWithParams(v *DebuggerSetReturnValueParams) (*gcdmessage.ChromeResponse, error)

SetReturnValueWithParams - Changes return value in top frame. Available only at return break position.

func (*Debugger) SetScriptSource

func (c *Debugger) SetScriptSource(scriptId string, scriptSource string, dryRun bool) ([]*DebuggerCallFrame, bool, *RuntimeStackTrace, *RuntimeStackTraceId, *RuntimeExceptionDetails, error)

SetScriptSource - Edits JavaScript source live. scriptId - Id of the script to edit. scriptSource - New content of the script. dryRun - If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code. Returns - callFrames - New stack trace in case editing has happened while VM was stopped. stackChanged - Whether current call stack was modified after applying the changes. asyncStackTrace - Async stack trace, if any. asyncStackTraceId - Async stack trace, if any. exceptionDetails - Exception details if any.

func (*Debugger) SetScriptSourceWithParams

SetScriptSourceWithParams - Edits JavaScript source live. Returns - callFrames - New stack trace in case editing has happened while VM was stopped. stackChanged - Whether current call stack was modified after applying the changes. asyncStackTrace - Async stack trace, if any. asyncStackTraceId - Async stack trace, if any. exceptionDetails - Exception details if any.

func (*Debugger) SetSkipAllPauses

func (c *Debugger) SetSkipAllPauses(skip bool) (*gcdmessage.ChromeResponse, error)

SetSkipAllPauses - Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). skip - New value for skip pauses state.

func (*Debugger) SetSkipAllPausesWithParams

func (c *Debugger) SetSkipAllPausesWithParams(v *DebuggerSetSkipAllPausesParams) (*gcdmessage.ChromeResponse, error)

SetSkipAllPausesWithParams - Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).

func (*Debugger) SetVariableValue

func (c *Debugger) SetVariableValue(scopeNumber int, variableName string, newValue *RuntimeCallArgument, callFrameId string) (*gcdmessage.ChromeResponse, error)

SetVariableValue - Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. scopeNumber - 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually. variableName - Variable name. newValue - New variable value. callFrameId - Id of callframe that holds variable.

func (*Debugger) SetVariableValueWithParams

func (c *Debugger) SetVariableValueWithParams(v *DebuggerSetVariableValueParams) (*gcdmessage.ChromeResponse, error)

SetVariableValueWithParams - Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually.

func (*Debugger) StepInto

func (c *Debugger) StepInto(breakOnAsyncCall bool) (*gcdmessage.ChromeResponse, error)

StepInto - Steps into the function call. breakOnAsyncCall - Debugger will pause on the execution of the first async task which was scheduled before next pause.

func (*Debugger) StepIntoWithParams

func (c *Debugger) StepIntoWithParams(v *DebuggerStepIntoParams) (*gcdmessage.ChromeResponse, error)

StepIntoWithParams - Steps into the function call.

func (*Debugger) StepOut

func (c *Debugger) StepOut() (*gcdmessage.ChromeResponse, error)

Steps out of the function call.

func (*Debugger) StepOver

func (c *Debugger) StepOver() (*gcdmessage.ChromeResponse, error)

Steps over the statement.

type DebuggerBreakLocation

type DebuggerBreakLocation struct {
	ScriptId     string `json:"scriptId"`               // Script identifier as reported in the `Debugger.scriptParsed`.
	LineNumber   int    `json:"lineNumber"`             // Line number in the script (0-based).
	ColumnNumber int    `json:"columnNumber,omitempty"` // Column number in the script (0-based).
	Type         string `json:"type,omitempty"`         //
}

No Description.

type DebuggerBreakpointResolvedEvent

type DebuggerBreakpointResolvedEvent struct {
	Method string `json:"method"`
	Params struct {
		BreakpointId string            `json:"breakpointId"` // Breakpoint unique identifier.
		Location     *DebuggerLocation `json:"location"`     // Actual breakpoint location.
	} `json:"Params,omitempty"`
}

Fired when breakpoint is resolved to an actual script and location.

type DebuggerCallFrame

type DebuggerCallFrame struct {
	CallFrameId      string               `json:"callFrameId"`                // Call frame identifier. This identifier is only valid while the virtual machine is paused.
	FunctionName     string               `json:"functionName"`               // Name of the JavaScript function called on this call frame.
	FunctionLocation *DebuggerLocation    `json:"functionLocation,omitempty"` // Location in the source code.
	Location         *DebuggerLocation    `json:"location"`                   // Location in the source code.
	Url              string               `json:"url"`                        // JavaScript script name or url.
	ScopeChain       []*DebuggerScope     `json:"scopeChain"`                 // Scope chain for this call frame.
	This             *RuntimeRemoteObject `json:"this"`                       // `this` object for this call frame.
	ReturnValue      *RuntimeRemoteObject `json:"returnValue,omitempty"`      // The value being returned, if the function is at return point.
}

JavaScript call frame. Array of call frames form the call stack.

type DebuggerContinueToLocationParams

type DebuggerContinueToLocationParams struct {
	// Location to continue to.
	Location *DebuggerLocation `json:"location"`
	//
	TargetCallFrames string `json:"targetCallFrames,omitempty"`
}

type DebuggerDebugSymbols added in v1.0.10

type DebuggerDebugSymbols struct {
	Type        string `json:"type"`                  // Type of the debug symbols.
	ExternalURL string `json:"externalURL,omitempty"` // URL of the external symbol source.
}

Debug symbols available for a wasm script.

type DebuggerEnableParams added in v1.0.6

type DebuggerEnableParams struct {
	// The maximum size in bytes of collected scripts (not referenced by other heap objects) the debugger can hold. Puts no limit if paramter is omitted.
	MaxScriptsCacheSize float64 `json:"maxScriptsCacheSize,omitempty"`
}

type DebuggerEvaluateOnCallFrameParams

type DebuggerEvaluateOnCallFrameParams struct {
	// Call frame identifier to evaluate on.
	CallFrameId string `json:"callFrameId"`
	// Expression to evaluate.
	Expression string `json:"expression"`
	// String object group name to put result into (allows rapid releasing resulting object handles using `releaseObjectGroup`).
	ObjectGroup string `json:"objectGroup,omitempty"`
	// Specifies whether command line API should be available to the evaluated expression, defaults to false.
	IncludeCommandLineAPI bool `json:"includeCommandLineAPI,omitempty"`
	// In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides `setPauseOnException` state.
	Silent bool `json:"silent,omitempty"`
	// Whether the result is expected to be a JSON object that should be sent by value.
	ReturnByValue bool `json:"returnByValue,omitempty"`
	// Whether preview should be generated for the result.
	GeneratePreview bool `json:"generatePreview,omitempty"`
	// Whether to throw an exception if side effect cannot be ruled out during evaluation.
	ThrowOnSideEffect bool `json:"throwOnSideEffect,omitempty"`
	// Terminate execution after timing out (number of milliseconds).
	Timeout float64 `json:"timeout,omitempty"`
}

type DebuggerExecuteWasmEvaluatorParams added in v1.0.10

type DebuggerExecuteWasmEvaluatorParams struct {
	// WebAssembly call frame identifier to evaluate on.
	CallFrameId string `json:"callFrameId"`
	// Code of the evaluator module.
	Evaluator string `json:"evaluator"`
	// Terminate execution after timing out (number of milliseconds).
	Timeout float64 `json:"timeout,omitempty"`
}

type DebuggerGetPossibleBreakpointsParams

type DebuggerGetPossibleBreakpointsParams struct {
	// Start of range to search possible breakpoint locations in.
	Start *DebuggerLocation `json:"start"`
	// End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range.
	End *DebuggerLocation `json:"end,omitempty"`
	// Only consider locations which are in the same (non-nested) function as start.
	RestrictToFunction bool `json:"restrictToFunction,omitempty"`
}

type DebuggerGetScriptSourceParams

type DebuggerGetScriptSourceParams struct {
	// Id of the script to get source for.
	ScriptId string `json:"scriptId"`
}

type DebuggerGetStackTraceParams

type DebuggerGetStackTraceParams struct {
	//
	StackTraceId *RuntimeStackTraceId `json:"stackTraceId"`
}

type DebuggerGetWasmBytecodeParams added in v1.0.9

type DebuggerGetWasmBytecodeParams struct {
	// Id of the Wasm script to get source for.
	ScriptId string `json:"scriptId"`
}

type DebuggerLocation

type DebuggerLocation struct {
	ScriptId     string `json:"scriptId"`               // Script identifier as reported in the `Debugger.scriptParsed`.
	LineNumber   int    `json:"lineNumber"`             // Line number in the script (0-based).
	ColumnNumber int    `json:"columnNumber,omitempty"` // Column number in the script (0-based).
}

Location in the source code.

type DebuggerPauseOnAsyncCallParams

type DebuggerPauseOnAsyncCallParams struct {
	// Debugger will pause when async call with given stack trace is started.
	ParentStackTraceId *RuntimeStackTraceId `json:"parentStackTraceId"`
}

type DebuggerPausedEvent

type DebuggerPausedEvent struct {
	Method string `json:"method"`
	Params struct {
		CallFrames            []*DebuggerCallFrame   `json:"callFrames"`                      // Call stack the virtual machine stopped on.
		Reason                string                 `json:"reason"`                          // Pause reason.
		Data                  map[string]interface{} `json:"data,omitempty"`                  // Object containing break-specific auxiliary properties.
		HitBreakpoints        []string               `json:"hitBreakpoints,omitempty"`        // Hit breakpoints IDs
		AsyncStackTrace       *RuntimeStackTrace     `json:"asyncStackTrace,omitempty"`       // Async stack trace, if any.
		AsyncStackTraceId     *RuntimeStackTraceId   `json:"asyncStackTraceId,omitempty"`     // Async stack trace, if any.
		AsyncCallStackTraceId *RuntimeStackTraceId   `json:"asyncCallStackTraceId,omitempty"` // Never present, will be removed.
	} `json:"Params,omitempty"`
}

Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.

type DebuggerRemoveBreakpointParams

type DebuggerRemoveBreakpointParams struct {
	//
	BreakpointId string `json:"breakpointId"`
}

type DebuggerRestartFrameParams

type DebuggerRestartFrameParams struct {
	// Call frame identifier to evaluate on.
	CallFrameId string `json:"callFrameId"`
}

type DebuggerResumeParams added in v1.0.9

type DebuggerResumeParams struct {
	// Set to true to terminate execution upon resuming execution. In contrast to Runtime.terminateExecution, this will allows to execute further JavaScript (i.e. via evaluation) until execution of the paused code is actually resumed, at which point termination is triggered. If execution is currently not paused, this parameter has no effect.
	TerminateOnResume bool `json:"terminateOnResume,omitempty"`
}

type DebuggerScope

type DebuggerScope struct {
	Type          string               `json:"type"`                    // Scope type.
	Object        *RuntimeRemoteObject `json:"object"`                  // Object representing the scope. For `global` and `with` scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties.
	Name          string               `json:"name,omitempty"`          //
	StartLocation *DebuggerLocation    `json:"startLocation,omitempty"` // Location in the source code where scope starts
	EndLocation   *DebuggerLocation    `json:"endLocation,omitempty"`   // Location in the source code where scope ends
}

Scope description.

type DebuggerScriptFailedToParseEvent

type DebuggerScriptFailedToParseEvent struct {
	Method string `json:"method"`
	Params struct {
		ScriptId                string                 `json:"scriptId"`                          // Identifier of the script parsed.
		Url                     string                 `json:"url"`                               // URL or name of the script parsed (if any).
		StartLine               int                    `json:"startLine"`                         // Line offset of the script within the resource with given URL (for script tags).
		StartColumn             int                    `json:"startColumn"`                       // Column offset of the script within the resource with given URL.
		EndLine                 int                    `json:"endLine"`                           // Last line of the script.
		EndColumn               int                    `json:"endColumn"`                         // Length of the last line of the script.
		ExecutionContextId      int                    `json:"executionContextId"`                // Specifies script creation context.
		Hash                    string                 `json:"hash"`                              // Content hash of the script.
		ExecutionContextAuxData map[string]interface{} `json:"executionContextAuxData,omitempty"` // Embedder-specific auxiliary data.
		SourceMapURL            string                 `json:"sourceMapURL,omitempty"`            // URL of source map associated with script (if any).
		HasSourceURL            bool                   `json:"hasSourceURL,omitempty"`            // True, if this script has sourceURL.
		IsModule                bool                   `json:"isModule,omitempty"`                // True, if this script is ES6 module.
		Length                  int                    `json:"length,omitempty"`                  // This script length.
		StackTrace              *RuntimeStackTrace     `json:"stackTrace,omitempty"`              // JavaScript top stack frame of where the script parsed event was triggered if available.
		CodeOffset              int                    `json:"codeOffset,omitempty"`              // If the scriptLanguage is WebAssembly, the code section offset in the module.
		ScriptLanguage          string                 `json:"scriptLanguage,omitempty"`          // The language of the script. enum values: JavaScript, WebAssembly
	} `json:"Params,omitempty"`
}

Fired when virtual machine fails to parse the script.

type DebuggerScriptParsedEvent

type DebuggerScriptParsedEvent struct {
	Method string `json:"method"`
	Params struct {
		ScriptId                string                 `json:"scriptId"`                          // Identifier of the script parsed.
		Url                     string                 `json:"url"`                               // URL or name of the script parsed (if any).
		StartLine               int                    `json:"startLine"`                         // Line offset of the script within the resource with given URL (for script tags).
		StartColumn             int                    `json:"startColumn"`                       // Column offset of the script within the resource with given URL.
		EndLine                 int                    `json:"endLine"`                           // Last line of the script.
		EndColumn               int                    `json:"endColumn"`                         // Length of the last line of the script.
		ExecutionContextId      int                    `json:"executionContextId"`                // Specifies script creation context.
		Hash                    string                 `json:"hash"`                              // Content hash of the script.
		ExecutionContextAuxData map[string]interface{} `json:"executionContextAuxData,omitempty"` // Embedder-specific auxiliary data.
		IsLiveEdit              bool                   `json:"isLiveEdit,omitempty"`              // True, if this script is generated as a result of the live edit operation.
		SourceMapURL            string                 `json:"sourceMapURL,omitempty"`            // URL of source map associated with script (if any).
		HasSourceURL            bool                   `json:"hasSourceURL,omitempty"`            // True, if this script has sourceURL.
		IsModule                bool                   `json:"isModule,omitempty"`                // True, if this script is ES6 module.
		Length                  int                    `json:"length,omitempty"`                  // This script length.
		StackTrace              *RuntimeStackTrace     `json:"stackTrace,omitempty"`              // JavaScript top stack frame of where the script parsed event was triggered if available.
		CodeOffset              int                    `json:"codeOffset,omitempty"`              // If the scriptLanguage is WebAssembly, the code section offset in the module.
		ScriptLanguage          string                 `json:"scriptLanguage,omitempty"`          // The language of the script. enum values: JavaScript, WebAssembly
		DebugSymbols            *DebuggerDebugSymbols  `json:"debugSymbols,omitempty"`            // If the scriptLanguage is WebASsembly, the source of debug symbols for the module.
	} `json:"Params,omitempty"`
}

Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.

type DebuggerScriptPosition

type DebuggerScriptPosition struct {
	LineNumber   int `json:"lineNumber"`   //
	ColumnNumber int `json:"columnNumber"` //
}

Location in the source code.

type DebuggerSearchInContentParams

type DebuggerSearchInContentParams struct {
	// Id of the script to search in.
	ScriptId string `json:"scriptId"`
	// String to search for.
	Query string `json:"query"`
	// If true, search is case sensitive.
	CaseSensitive bool `json:"caseSensitive,omitempty"`
	// If true, treats string parameter as regex.
	IsRegex bool `json:"isRegex,omitempty"`
}

type DebuggerSearchMatch

type DebuggerSearchMatch struct {
	LineNumber  float64 `json:"lineNumber"`  // Line number in resource content.
	LineContent string  `json:"lineContent"` // Line with match content.
}

Search match for resource.

type DebuggerSetAsyncCallStackDepthParams

type DebuggerSetAsyncCallStackDepthParams struct {
	// Maximum depth of async call stacks. Setting to `0` will effectively disable collecting async call stacks (default).
	MaxDepth int `json:"maxDepth"`
}

type DebuggerSetBlackboxPatternsParams

type DebuggerSetBlackboxPatternsParams struct {
	// Array of regexps that will be used to check script url for blackbox state.
	Patterns []string `json:"patterns"`
}

type DebuggerSetBlackboxedRangesParams

type DebuggerSetBlackboxedRangesParams struct {
	// Id of the script.
	ScriptId string `json:"scriptId"`
	//
	Positions []*DebuggerScriptPosition `json:"positions"`
}

type DebuggerSetBreakpointByUrlParams

type DebuggerSetBreakpointByUrlParams struct {
	// Line number to set breakpoint at.
	LineNumber int `json:"lineNumber"`
	// URL of the resources to set breakpoint on.
	Url string `json:"url,omitempty"`
	// Regex pattern for the URLs of the resources to set breakpoints on. Either `url` or `urlRegex` must be specified.
	UrlRegex string `json:"urlRegex,omitempty"`
	// Script hash of the resources to set breakpoint on.
	ScriptHash string `json:"scriptHash,omitempty"`
	// Offset in the line to set breakpoint at.
	ColumnNumber int `json:"columnNumber,omitempty"`
	// Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true.
	Condition string `json:"condition,omitempty"`
}

type DebuggerSetBreakpointOnFunctionCallParams

type DebuggerSetBreakpointOnFunctionCallParams struct {
	// Function object id.
	ObjectId string `json:"objectId"`
	// Expression to use as a breakpoint condition. When specified, debugger will stop on the breakpoint if this expression evaluates to true.
	Condition string `json:"condition,omitempty"`
}

type DebuggerSetBreakpointParams

type DebuggerSetBreakpointParams struct {
	// Location to set breakpoint in.
	Location *DebuggerLocation `json:"location"`
	// Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true.
	Condition string `json:"condition,omitempty"`
}

type DebuggerSetBreakpointsActiveParams

type DebuggerSetBreakpointsActiveParams struct {
	// New value for breakpoints active state.
	Active bool `json:"active"`
}

type DebuggerSetInstrumentationBreakpointParams added in v1.0.7

type DebuggerSetInstrumentationBreakpointParams struct {
	// Instrumentation name.
	Instrumentation string `json:"instrumentation"`
}

type DebuggerSetPauseOnExceptionsParams

type DebuggerSetPauseOnExceptionsParams struct {
	// Pause on exceptions mode.
	State string `json:"state"`
}

type DebuggerSetReturnValueParams

type DebuggerSetReturnValueParams struct {
	// New return value.
	NewValue *RuntimeCallArgument `json:"newValue"`
}

type DebuggerSetScriptSourceParams

type DebuggerSetScriptSourceParams struct {
	// Id of the script to edit.
	ScriptId string `json:"scriptId"`
	// New content of the script.
	ScriptSource string `json:"scriptSource"`
	// If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code.
	DryRun bool `json:"dryRun,omitempty"`
}

type DebuggerSetSkipAllPausesParams

type DebuggerSetSkipAllPausesParams struct {
	// New value for skip pauses state.
	Skip bool `json:"skip"`
}

type DebuggerSetVariableValueParams

type DebuggerSetVariableValueParams struct {
	// 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually.
	ScopeNumber int `json:"scopeNumber"`
	// Variable name.
	VariableName string `json:"variableName"`
	// New variable value.
	NewValue *RuntimeCallArgument `json:"newValue"`
	// Id of callframe that holds variable.
	CallFrameId string `json:"callFrameId"`
}

type DebuggerStepIntoParams

type DebuggerStepIntoParams struct {
	// Debugger will pause on the execution of the first async task which was scheduled before next pause.
	BreakOnAsyncCall bool `json:"breakOnAsyncCall,omitempty"`
}

type DeviceOrientation

type DeviceOrientation struct {
	// contains filtered or unexported fields
}

func NewDeviceOrientation

func NewDeviceOrientation(target gcdmessage.ChromeTargeter) *DeviceOrientation

func (*DeviceOrientation) ClearDeviceOrientationOverride

func (c *DeviceOrientation) ClearDeviceOrientationOverride() (*gcdmessage.ChromeResponse, error)

Clears the overridden Device Orientation.

func (*DeviceOrientation) SetDeviceOrientationOverride

func (c *DeviceOrientation) SetDeviceOrientationOverride(alpha float64, beta float64, gamma float64) (*gcdmessage.ChromeResponse, error)

SetDeviceOrientationOverride - Overrides the Device Orientation. alpha - Mock alpha beta - Mock beta gamma - Mock gamma

func (*DeviceOrientation) SetDeviceOrientationOverrideWithParams

SetDeviceOrientationOverrideWithParams - Overrides the Device Orientation.

type DeviceOrientationSetDeviceOrientationOverrideParams

type DeviceOrientationSetDeviceOrientationOverrideParams struct {
	// Mock alpha
	Alpha float64 `json:"alpha"`
	// Mock beta
	Beta float64 `json:"beta"`
	// Mock gamma
	Gamma float64 `json:"gamma"`
}

type Emulation

type Emulation struct {
	// contains filtered or unexported fields
}

func NewEmulation

func NewEmulation(target gcdmessage.ChromeTargeter) *Emulation

func (*Emulation) CanEmulate

func (c *Emulation) CanEmulate() (bool, error)

CanEmulate - Tells whether emulation is supported. Returns - result - True if emulation is supported.

func (*Emulation) ClearDeviceMetricsOverride

func (c *Emulation) ClearDeviceMetricsOverride() (*gcdmessage.ChromeResponse, error)

Clears the overriden device metrics.

func (*Emulation) ClearGeolocationOverride

func (c *Emulation) ClearGeolocationOverride() (*gcdmessage.ChromeResponse, error)

Clears the overriden Geolocation Position and Error.

func (*Emulation) ResetPageScaleFactor

func (c *Emulation) ResetPageScaleFactor() (*gcdmessage.ChromeResponse, error)

Requests that page scale factor is reset to initial values.

func (*Emulation) SetCPUThrottlingRate

func (c *Emulation) SetCPUThrottlingRate(rate float64) (*gcdmessage.ChromeResponse, error)

SetCPUThrottlingRate - Enables CPU throttling to emulate slow CPUs. rate - Throttling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc).

func (*Emulation) SetCPUThrottlingRateWithParams

func (c *Emulation) SetCPUThrottlingRateWithParams(v *EmulationSetCPUThrottlingRateParams) (*gcdmessage.ChromeResponse, error)

SetCPUThrottlingRateWithParams - Enables CPU throttling to emulate slow CPUs.

func (*Emulation) SetDefaultBackgroundColorOverride

func (c *Emulation) SetDefaultBackgroundColorOverride(color *DOMRGBA) (*gcdmessage.ChromeResponse, error)

SetDefaultBackgroundColorOverride - Sets or clears an override of the default background color of the frame. This override is used if the content does not specify one. color - RGBA of the default background color. If not specified, any existing override will be cleared.

func (*Emulation) SetDefaultBackgroundColorOverrideWithParams

func (c *Emulation) SetDefaultBackgroundColorOverrideWithParams(v *EmulationSetDefaultBackgroundColorOverrideParams) (*gcdmessage.ChromeResponse, error)

SetDefaultBackgroundColorOverrideWithParams - Sets or clears an override of the default background color of the frame. This override is used if the content does not specify one.

func (*Emulation) SetDeviceMetricsOverride

func (c *Emulation) SetDeviceMetricsOverride(width int, height int, deviceScaleFactor float64, mobile bool, scale float64, screenWidth int, screenHeight int, positionX int, positionY int, dontSetVisibleSize bool, screenOrientation *EmulationScreenOrientation, viewport *PageViewport) (*gcdmessage.ChromeResponse, error)

SetDeviceMetricsOverride - Overrides the values of device screen dimensions (window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media query results). width - Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override. height - Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override. deviceScaleFactor - Overriding device scale factor value. 0 disables the override. 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. screenWidth - Overriding screen width value in pixels (minimum 0, maximum 10000000). screenHeight - Overriding screen height value in pixels (minimum 0, maximum 10000000). positionX - Overriding view X position on screen in pixels (minimum 0, maximum 10000000). positionY - Overriding view Y position on screen in pixels (minimum 0, maximum 10000000). dontSetVisibleSize - Do not set visible view size, rely upon explicit setVisibleSize call. screenOrientation - 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.

func (*Emulation) SetDeviceMetricsOverrideWithParams

func (c *Emulation) SetDeviceMetricsOverrideWithParams(v *EmulationSetDeviceMetricsOverrideParams) (*gcdmessage.ChromeResponse, error)

SetDeviceMetricsOverrideWithParams - Overrides the values of device screen dimensions (window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media query results).

func (*Emulation) SetDocumentCookieDisabled

func (c *Emulation) SetDocumentCookieDisabled(disabled bool) (*gcdmessage.ChromeResponse, error)

SetDocumentCookieDisabled - disabled - Whether document.coookie API should be disabled.

func (*Emulation) SetDocumentCookieDisabledWithParams

func (c *Emulation) SetDocumentCookieDisabledWithParams(v *EmulationSetDocumentCookieDisabledParams) (*gcdmessage.ChromeResponse, error)

SetDocumentCookieDisabledWithParams -

func (*Emulation) SetEmitTouchEventsForMouse

func (c *Emulation) SetEmitTouchEventsForMouse(enabled bool, configuration string) (*gcdmessage.ChromeResponse, error)

SetEmitTouchEventsForMouse - enabled - Whether touch emulation based on mouse input should be enabled. configuration - Touch/gesture events configuration. Default: current platform.

func (*Emulation) SetEmitTouchEventsForMouseWithParams

func (c *Emulation) SetEmitTouchEventsForMouseWithParams(v *EmulationSetEmitTouchEventsForMouseParams) (*gcdmessage.ChromeResponse, error)

SetEmitTouchEventsForMouseWithParams -

func (*Emulation) SetEmulatedMedia

func (c *Emulation) SetEmulatedMedia(media string, features []*EmulationMediaFeature) (*gcdmessage.ChromeResponse, error)

SetEmulatedMedia - Emulates the given media type or media feature for CSS media queries. media - Media type to emulate. Empty string disables the override. features - Media features to emulate.

func (*Emulation) SetEmulatedMediaWithParams

func (c *Emulation) SetEmulatedMediaWithParams(v *EmulationSetEmulatedMediaParams) (*gcdmessage.ChromeResponse, error)

SetEmulatedMediaWithParams - Emulates the given media type or media feature for CSS media queries.

func (*Emulation) SetEmulatedVisionDeficiency added in v1.0.9

func (c *Emulation) SetEmulatedVisionDeficiency(theType string) (*gcdmessage.ChromeResponse, error)

SetEmulatedVisionDeficiency - Emulates the given vision deficiency. type - Vision deficiency to emulate.

func (*Emulation) SetEmulatedVisionDeficiencyWithParams added in v1.0.9

func (c *Emulation) SetEmulatedVisionDeficiencyWithParams(v *EmulationSetEmulatedVisionDeficiencyParams) (*gcdmessage.ChromeResponse, error)

SetEmulatedVisionDeficiencyWithParams - Emulates the given vision deficiency.

func (*Emulation) SetFocusEmulationEnabled

func (c *Emulation) SetFocusEmulationEnabled(enabled bool) (*gcdmessage.ChromeResponse, error)

SetFocusEmulationEnabled - Enables or disables simulating a focused and active page. enabled - Whether to enable to disable focus emulation.

func (*Emulation) SetFocusEmulationEnabledWithParams

func (c *Emulation) SetFocusEmulationEnabledWithParams(v *EmulationSetFocusEmulationEnabledParams) (*gcdmessage.ChromeResponse, error)

SetFocusEmulationEnabledWithParams - Enables or disables simulating a focused and active page.

func (*Emulation) SetGeolocationOverride

func (c *Emulation) SetGeolocationOverride(latitude float64, longitude float64, accuracy float64) (*gcdmessage.ChromeResponse, error)

SetGeolocationOverride - Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position unavailable. latitude - Mock latitude longitude - Mock longitude accuracy - Mock accuracy

func (*Emulation) SetGeolocationOverrideWithParams

func (c *Emulation) SetGeolocationOverrideWithParams(v *EmulationSetGeolocationOverrideParams) (*gcdmessage.ChromeResponse, error)

SetGeolocationOverrideWithParams - Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position unavailable.

func (*Emulation) SetLocaleOverride added in v1.0.9

func (c *Emulation) SetLocaleOverride(locale string) (*gcdmessage.ChromeResponse, error)

SetLocaleOverride - Overrides default host system locale with the specified one. locale - ICU style C locale (e.g. "en_US"). If not specified or empty, disables the override and restores default host system locale.

func (*Emulation) SetLocaleOverrideWithParams added in v1.0.9

func (c *Emulation) SetLocaleOverrideWithParams(v *EmulationSetLocaleOverrideParams) (*gcdmessage.ChromeResponse, error)

SetLocaleOverrideWithParams - Overrides default host system locale with the specified one.

func (*Emulation) SetNavigatorOverrides

func (c *Emulation) SetNavigatorOverrides(platform string) (*gcdmessage.ChromeResponse, error)

SetNavigatorOverrides - Overrides value returned by the javascript navigator object. platform - The platform navigator.platform should return.

func (*Emulation) SetNavigatorOverridesWithParams

func (c *Emulation) SetNavigatorOverridesWithParams(v *EmulationSetNavigatorOverridesParams) (*gcdmessage.ChromeResponse, error)

SetNavigatorOverridesWithParams - Overrides value returned by the javascript navigator object.

func (*Emulation) SetPageScaleFactor

func (c *Emulation) SetPageScaleFactor(pageScaleFactor float64) (*gcdmessage.ChromeResponse, error)

SetPageScaleFactor - Sets a specified page scale factor. pageScaleFactor - Page scale factor.

func (*Emulation) SetPageScaleFactorWithParams

func (c *Emulation) SetPageScaleFactorWithParams(v *EmulationSetPageScaleFactorParams) (*gcdmessage.ChromeResponse, error)

SetPageScaleFactorWithParams - Sets a specified page scale factor.

func (*Emulation) SetScriptExecutionDisabled

func (c *Emulation) SetScriptExecutionDisabled(value bool) (*gcdmessage.ChromeResponse, error)

SetScriptExecutionDisabled - Switches script execution in the page. value - Whether script execution should be disabled in the page.

func (*Emulation) SetScriptExecutionDisabledWithParams

func (c *Emulation) SetScriptExecutionDisabledWithParams(v *EmulationSetScriptExecutionDisabledParams) (*gcdmessage.ChromeResponse, error)

SetScriptExecutionDisabledWithParams - Switches script execution in the page.

func (*Emulation) SetScrollbarsHidden

func (c *Emulation) SetScrollbarsHidden(hidden bool) (*gcdmessage.ChromeResponse, error)

SetScrollbarsHidden - hidden - Whether scrollbars should be always hidden.

func (*Emulation) SetScrollbarsHiddenWithParams

func (c *Emulation) SetScrollbarsHiddenWithParams(v *EmulationSetScrollbarsHiddenParams) (*gcdmessage.ChromeResponse, error)

SetScrollbarsHiddenWithParams -

func (*Emulation) SetTimezoneOverride added in v1.0.7

func (c *Emulation) SetTimezoneOverride(timezoneId string) (*gcdmessage.ChromeResponse, error)

SetTimezoneOverride - Overrides default host system timezone with the specified one. timezoneId - The timezone identifier. If empty, disables the override and restores default host system timezone.

func (*Emulation) SetTimezoneOverrideWithParams added in v1.0.7

func (c *Emulation) SetTimezoneOverrideWithParams(v *EmulationSetTimezoneOverrideParams) (*gcdmessage.ChromeResponse, error)

SetTimezoneOverrideWithParams - Overrides default host system timezone with the specified one.

func (*Emulation) SetTouchEmulationEnabled

func (c *Emulation) SetTouchEmulationEnabled(enabled bool, maxTouchPoints int) (*gcdmessage.ChromeResponse, error)

SetTouchEmulationEnabled - Enables touch on platforms which do not support them. enabled - Whether the touch event emulation should be enabled. maxTouchPoints - Maximum touch points supported. Defaults to one.

func (*Emulation) SetTouchEmulationEnabledWithParams

func (c *Emulation) SetTouchEmulationEnabledWithParams(v *EmulationSetTouchEmulationEnabledParams) (*gcdmessage.ChromeResponse, error)

SetTouchEmulationEnabledWithParams - Enables touch on platforms which do not support them.

func (*Emulation) SetUserAgentOverride

func (c *Emulation) SetUserAgentOverride(userAgent string, acceptLanguage string, platform string, userAgentMetadata *EmulationUserAgentMetadata) (*gcdmessage.ChromeResponse, error)

SetUserAgentOverride - Allows overriding user agent with the given string. userAgent - User agent to use. acceptLanguage - Browser langugage to emulate. platform - The platform navigator.platform should return. userAgentMetadata - To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData

func (*Emulation) SetUserAgentOverrideWithParams

func (c *Emulation) SetUserAgentOverrideWithParams(v *EmulationSetUserAgentOverrideParams) (*gcdmessage.ChromeResponse, error)

SetUserAgentOverrideWithParams - Allows overriding user agent with the given string.

func (*Emulation) SetVirtualTimePolicy

func (c *Emulation) SetVirtualTimePolicy(policy string, budget float64, maxVirtualTimeTaskStarvationCount int, waitForNavigation bool, initialVirtualTime float64) (float64, error)

SetVirtualTimePolicy - Turns on virtual time for all frames (replacing real-time with a synthetic time source) and sets the current virtual time policy. Note this supersedes any previous time budget. policy - enum values: advance, pause, pauseIfNetworkFetchesPending budget - If set, after this many virtual milliseconds have elapsed virtual time will be paused and a virtualTimeBudgetExpired event is sent. maxVirtualTimeTaskStarvationCount - If set this specifies the maximum number of tasks that can be run before virtual is forced forwards to prevent deadlock. waitForNavigation - If set the virtual time policy change should be deferred until any frame starts navigating. Note any previous deferred policy change is superseded. initialVirtualTime - If set, base::Time::Now will be overriden to initially return this value. Returns - virtualTimeTicksBase - Absolute timestamp at which virtual time was first enabled (up time in milliseconds).

func (*Emulation) SetVirtualTimePolicyWithParams

func (c *Emulation) SetVirtualTimePolicyWithParams(v *EmulationSetVirtualTimePolicyParams) (float64, error)

SetVirtualTimePolicyWithParams - Turns on virtual time for all frames (replacing real-time with a synthetic time source) and sets the current virtual time policy. Note this supersedes any previous time budget. Returns - virtualTimeTicksBase - Absolute timestamp at which virtual time was first enabled (up time in milliseconds).

func (*Emulation) SetVisibleSize

func (c *Emulation) SetVisibleSize(width int, height int) (*gcdmessage.ChromeResponse, error)

SetVisibleSize - Resizes the frame/viewport of the page. Note that this does not affect the frame's container (e.g. browser window). Can be used to produce screenshots of the specified size. Not supported on Android. width - Frame width (DIP). height - Frame height (DIP).

func (*Emulation) SetVisibleSizeWithParams

func (c *Emulation) SetVisibleSizeWithParams(v *EmulationSetVisibleSizeParams) (*gcdmessage.ChromeResponse, error)

SetVisibleSizeWithParams - Resizes the frame/viewport of the page. Note that this does not affect the frame's container (e.g. browser window). Can be used to produce screenshots of the specified size. Not supported on Android.

type EmulationMediaFeature added in v1.0.9

type EmulationMediaFeature struct {
	Name  string `json:"name"`  //
	Value string `json:"value"` //
}

No Description.

type EmulationScreenOrientation

type EmulationScreenOrientation struct {
	Type  string `json:"type"`  // Orientation type.
	Angle int    `json:"angle"` // Orientation angle.
}

Screen orientation.

type EmulationSetCPUThrottlingRateParams

type EmulationSetCPUThrottlingRateParams struct {
	// Throttling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc).
	Rate float64 `json:"rate"`
}

type EmulationSetDefaultBackgroundColorOverrideParams

type EmulationSetDefaultBackgroundColorOverrideParams struct {
	// RGBA of the default background color. If not specified, any existing override will be cleared.
	Color *DOMRGBA `json:"color,omitempty"`
}

type EmulationSetDeviceMetricsOverrideParams

type EmulationSetDeviceMetricsOverrideParams struct {
	// Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.
	Width int `json:"width"`
	// Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.
	Height int `json:"height"`
	// Overriding device scale factor value. 0 disables the override.
	DeviceScaleFactor float64 `json:"deviceScaleFactor"`
	// Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more.
	Mobile bool `json:"mobile"`
	// Scale to apply to resulting view image.
	Scale float64 `json:"scale,omitempty"`
	// Overriding screen width value in pixels (minimum 0, maximum 10000000).
	ScreenWidth int `json:"screenWidth,omitempty"`
	// Overriding screen height value in pixels (minimum 0, maximum 10000000).
	ScreenHeight int `json:"screenHeight,omitempty"`
	// Overriding view X position on screen in pixels (minimum 0, maximum 10000000).
	PositionX int `json:"positionX,omitempty"`
	// Overriding view Y position on screen in pixels (minimum 0, maximum 10000000).
	PositionY int `json:"positionY,omitempty"`
	// Do not set visible view size, rely upon explicit setVisibleSize call.
	DontSetVisibleSize bool `json:"dontSetVisibleSize,omitempty"`
	// Screen orientation override.
	ScreenOrientation *EmulationScreenOrientation `json:"screenOrientation,omitempty"`
	// 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.
	Viewport *PageViewport `json:"viewport,omitempty"`
}

type EmulationSetDocumentCookieDisabledParams

type EmulationSetDocumentCookieDisabledParams struct {
	// Whether document.coookie API should be disabled.
	Disabled bool `json:"disabled"`
}

type EmulationSetEmitTouchEventsForMouseParams

type EmulationSetEmitTouchEventsForMouseParams struct {
	// Whether touch emulation based on mouse input should be enabled.
	Enabled bool `json:"enabled"`
	// Touch/gesture events configuration. Default: current platform.
	Configuration string `json:"configuration,omitempty"`
}

type EmulationSetEmulatedMediaParams

type EmulationSetEmulatedMediaParams struct {
	// Media type to emulate. Empty string disables the override.
	Media string `json:"media,omitempty"`
	// Media features to emulate.
	Features []*EmulationMediaFeature `json:"features,omitempty"`
}

type EmulationSetEmulatedVisionDeficiencyParams added in v1.0.9

type EmulationSetEmulatedVisionDeficiencyParams struct {
	// Vision deficiency to emulate.
	TheType string `json:"type"`
}

type EmulationSetFocusEmulationEnabledParams

type EmulationSetFocusEmulationEnabledParams struct {
	// Whether to enable to disable focus emulation.
	Enabled bool `json:"enabled"`
}

type EmulationSetGeolocationOverrideParams

type EmulationSetGeolocationOverrideParams struct {
	// Mock latitude
	Latitude float64 `json:"latitude,omitempty"`
	// Mock longitude
	Longitude float64 `json:"longitude,omitempty"`
	// Mock accuracy
	Accuracy float64 `json:"accuracy,omitempty"`
}

type EmulationSetLocaleOverrideParams added in v1.0.9

type EmulationSetLocaleOverrideParams struct {
	// ICU style C locale (e.g. "en_US"). If not specified or empty, disables the override and restores default host system locale.
	Locale string `json:"locale,omitempty"`
}

type EmulationSetNavigatorOverridesParams

type EmulationSetNavigatorOverridesParams struct {
	// The platform navigator.platform should return.
	Platform string `json:"platform"`
}

type EmulationSetPageScaleFactorParams

type EmulationSetPageScaleFactorParams struct {
	// Page scale factor.
	PageScaleFactor float64 `json:"pageScaleFactor"`
}

type EmulationSetScriptExecutionDisabledParams

type EmulationSetScriptExecutionDisabledParams struct {
	// Whether script execution should be disabled in the page.
	Value bool `json:"value"`
}

type EmulationSetScrollbarsHiddenParams

type EmulationSetScrollbarsHiddenParams struct {
	// Whether scrollbars should be always hidden.
	Hidden bool `json:"hidden"`
}

type EmulationSetTimezoneOverrideParams added in v1.0.7

type EmulationSetTimezoneOverrideParams struct {
	// The timezone identifier. If empty, disables the override and restores default host system timezone.
	TimezoneId string `json:"timezoneId"`
}

type EmulationSetTouchEmulationEnabledParams

type EmulationSetTouchEmulationEnabledParams struct {
	// Whether the touch event emulation should be enabled.
	Enabled bool `json:"enabled"`
	// Maximum touch points supported. Defaults to one.
	MaxTouchPoints int `json:"maxTouchPoints,omitempty"`
}

type EmulationSetUserAgentOverrideParams

type EmulationSetUserAgentOverrideParams struct {
	// User agent to use.
	UserAgent string `json:"userAgent"`
	// Browser langugage to emulate.
	AcceptLanguage string `json:"acceptLanguage,omitempty"`
	// The platform navigator.platform should return.
	Platform string `json:"platform,omitempty"`
	// To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData
	UserAgentMetadata *EmulationUserAgentMetadata `json:"userAgentMetadata,omitempty"`
}

type EmulationSetVirtualTimePolicyParams

type EmulationSetVirtualTimePolicyParams struct {
	//  enum values: advance, pause, pauseIfNetworkFetchesPending
	Policy string `json:"policy"`
	// If set, after this many virtual milliseconds have elapsed virtual time will be paused and a virtualTimeBudgetExpired event is sent.
	Budget float64 `json:"budget,omitempty"`
	// If set this specifies the maximum number of tasks that can be run before virtual is forced forwards to prevent deadlock.
	MaxVirtualTimeTaskStarvationCount int `json:"maxVirtualTimeTaskStarvationCount,omitempty"`
	// If set the virtual time policy change should be deferred until any frame starts navigating. Note any previous deferred policy change is superseded.
	WaitForNavigation bool `json:"waitForNavigation,omitempty"`
	// If set, base::Time::Now will be overriden to initially return this value.
	InitialVirtualTime float64 `json:"initialVirtualTime,omitempty"`
}

type EmulationSetVisibleSizeParams

type EmulationSetVisibleSizeParams struct {
	// Frame width (DIP).
	Width int `json:"width"`
	// Frame height (DIP).
	Height int `json:"height"`
}

type EmulationUserAgentBrandVersion added in v1.0.10

type EmulationUserAgentBrandVersion struct {
	Brand   string `json:"brand"`   //
	Version string `json:"version"` //
}

Used to specify User Agent Cient Hints to emulate. See https://wicg.github.io/ua-client-hints

type EmulationUserAgentMetadata added in v1.0.10

type EmulationUserAgentMetadata struct {
	Brands          []*EmulationUserAgentBrandVersion `json:"brands"`          //
	FullVersion     string                            `json:"fullVersion"`     //
	Platform        string                            `json:"platform"`        //
	PlatformVersion string                            `json:"platformVersion"` //
	Architecture    string                            `json:"architecture"`    //
	Model           string                            `json:"model"`           //
	Mobile          bool                              `json:"mobile"`          //
}

Used to specify User Agent Cient Hints to emulate. See https://wicg.github.io/ua-client-hints

type Fetch added in v1.0.3

type Fetch struct {
	// contains filtered or unexported fields
}

func NewFetch added in v1.0.3

func NewFetch(target gcdmessage.ChromeTargeter) *Fetch

func (*Fetch) ContinueRequest added in v1.0.3

func (c *Fetch) ContinueRequest(requestId string, url string, method string, postData string, headers []*FetchHeaderEntry) (*gcdmessage.ChromeResponse, error)

ContinueRequest - Continues the request, optionally modifying some of its parameters. requestId - An id the client received in requestPaused event. url - If set, the request url will be modified in a way that's not observable by page. method - If set, the request method is overridden. postData - If set, overrides the post data in the request. headers - If set, overrides the request headers.

func (*Fetch) ContinueRequestWithParams added in v1.0.3

func (c *Fetch) ContinueRequestWithParams(v *FetchContinueRequestParams) (*gcdmessage.ChromeResponse, error)

ContinueRequestWithParams - Continues the request, optionally modifying some of its parameters.

func (*Fetch) ContinueWithAuth added in v1.0.3

func (c *Fetch) ContinueWithAuth(requestId string, authChallengeResponse *FetchAuthChallengeResponse) (*gcdmessage.ChromeResponse, error)

ContinueWithAuth - Continues a request supplying authChallengeResponse following authRequired event. requestId - An id the client received in authRequired event. authChallengeResponse - Response to with an authChallenge.

func (*Fetch) ContinueWithAuthWithParams added in v1.0.3

func (c *Fetch) ContinueWithAuthWithParams(v *FetchContinueWithAuthParams) (*gcdmessage.ChromeResponse, error)

ContinueWithAuthWithParams - Continues a request supplying authChallengeResponse following authRequired event.

func (*Fetch) Disable added in v1.0.3

func (c *Fetch) Disable() (*gcdmessage.ChromeResponse, error)

Disables the fetch domain.

func (*Fetch) Enable added in v1.0.3

func (c *Fetch) Enable(patterns []*FetchRequestPattern, handleAuthRequests bool) (*gcdmessage.ChromeResponse, error)

Enable - Enables issuing of requestPaused events. A request will be paused until client calls one of failRequest, fulfillRequest or continueRequest/continueWithAuth. patterns - If specified, only requests matching any of these patterns will produce fetchRequested event and will be paused until clients response. If not set, all requests will be affected. handleAuthRequests - If true, authRequired events will be issued and requests will be paused expecting a call to continueWithAuth.

func (*Fetch) EnableWithParams added in v1.0.3

func (c *Fetch) EnableWithParams(v *FetchEnableParams) (*gcdmessage.ChromeResponse, error)

EnableWithParams - Enables issuing of requestPaused events. A request will be paused until client calls one of failRequest, fulfillRequest or continueRequest/continueWithAuth.

func (*Fetch) FailRequest added in v1.0.3

func (c *Fetch) FailRequest(requestId string, errorReason string) (*gcdmessage.ChromeResponse, error)

FailRequest - Causes the request to fail with specified reason. requestId - An id the client received in requestPaused event. errorReason - Causes the request to fail with the given reason. enum values: Failed, Aborted, TimedOut, AccessDenied, ConnectionClosed, ConnectionReset, ConnectionRefused, ConnectionAborted, ConnectionFailed, NameNotResolved, InternetDisconnected, AddressUnreachable, BlockedByClient, BlockedByResponse

func (*Fetch) FailRequestWithParams added in v1.0.3

func (c *Fetch) FailRequestWithParams(v *FetchFailRequestParams) (*gcdmessage.ChromeResponse, error)

FailRequestWithParams - Causes the request to fail with specified reason.

func (*Fetch) FulfillRequest added in v1.0.3

func (c *Fetch) FulfillRequest(requestId string, responseCode int, responseHeaders []*FetchHeaderEntry, binaryResponseHeaders string, body string, responsePhrase string) (*gcdmessage.ChromeResponse, error)

FulfillRequest - Provides response to the request. requestId - An id the client received in requestPaused event. responseCode - An HTTP response code. responseHeaders - Response headers. binaryResponseHeaders - Alternative way of specifying response headers as a \0-separated series of name: value pairs. Prefer the above method unless you need to represent some non-UTF8 values that can't be transmitted over the protocol as text. body - A response body. responsePhrase - A textual representation of responseCode. If absent, a standard phrase matching responseCode is used.

func (*Fetch) FulfillRequestWithParams added in v1.0.3

func (c *Fetch) FulfillRequestWithParams(v *FetchFulfillRequestParams) (*gcdmessage.ChromeResponse, error)

FulfillRequestWithParams - Provides response to the request.

func (*Fetch) GetResponseBody added in v1.0.3

func (c *Fetch) GetResponseBody(requestId string) (string, bool, error)

GetResponseBody - Causes the body of the response to be received from the server and returned as a single string. May only be issued for a request that is paused in the Response stage and is mutually exclusive with takeResponseBodyForInterceptionAsStream. Calling other methods that affect the request or disabling fetch domain before body is received results in an undefined behavior. requestId - Identifier for the intercepted request to get body for. Returns - body - Response body. base64Encoded - True, if content was sent as base64.

func (*Fetch) GetResponseBodyWithParams added in v1.0.3

func (c *Fetch) GetResponseBodyWithParams(v *FetchGetResponseBodyParams) (string, bool, error)

GetResponseBodyWithParams - Causes the body of the response to be received from the server and returned as a single string. May only be issued for a request that is paused in the Response stage and is mutually exclusive with takeResponseBodyForInterceptionAsStream. Calling other methods that affect the request or disabling fetch domain before body is received results in an undefined behavior. Returns - body - Response body. base64Encoded - True, if content was sent as base64.

func (*Fetch) TakeResponseBodyAsStream added in v1.0.3

func (c *Fetch) TakeResponseBodyAsStream(requestId string) (string, error)

TakeResponseBodyAsStream - Returns a handle to the stream representing the response body. The request must be paused in the HeadersReceived stage. Note that after this command the request can't be continued as is -- client either needs to cancel it or to provide the response body. The stream only supports sequential read, IO.read will fail if the position is specified. This method is mutually exclusive with getResponseBody. Calling other methods that affect the request or disabling fetch domain before body is received results in an undefined behavior. requestId - Returns - stream -

func (*Fetch) TakeResponseBodyAsStreamWithParams added in v1.0.3

func (c *Fetch) TakeResponseBodyAsStreamWithParams(v *FetchTakeResponseBodyAsStreamParams) (string, error)

TakeResponseBodyAsStreamWithParams - Returns a handle to the stream representing the response body. The request must be paused in the HeadersReceived stage. Note that after this command the request can't be continued as is -- client either needs to cancel it or to provide the response body. The stream only supports sequential read, IO.read will fail if the position is specified. This method is mutually exclusive with getResponseBody. Calling other methods that affect the request or disabling fetch domain before body is received results in an undefined behavior. Returns - stream -

type FetchAuthChallenge added in v1.0.3

type FetchAuthChallenge struct {
	Source string `json:"source,omitempty"` // Source of the authentication challenge.
	Origin string `json:"origin"`           // Origin of the challenger.
	Scheme string `json:"scheme"`           // The authentication scheme used, such as basic or digest
	Realm  string `json:"realm"`            // The realm of the challenge. May be empty.
}

Authorization challenge for HTTP status code 401 or 407.

type FetchAuthChallengeResponse added in v1.0.3

type FetchAuthChallengeResponse struct {
	Response string `json:"response"`           // The decision on what to do in response to the authorization challenge.  Default means deferring to the default behavior of the net stack, which will likely either the Cancel authentication or display a popup dialog box.
	Username string `json:"username,omitempty"` // The username to provide, possibly empty. Should only be set if response is ProvideCredentials.
	Password string `json:"password,omitempty"` // The password to provide, possibly empty. Should only be set if response is ProvideCredentials.
}

Response to an AuthChallenge.

type FetchAuthRequiredEvent added in v1.0.3

type FetchAuthRequiredEvent struct {
	Method string `json:"method"`
	Params struct {
		RequestId     string              `json:"requestId"`     // Each request the page makes will have a unique id.
		Request       *NetworkRequest     `json:"request"`       // The details of the request.
		FrameId       string              `json:"frameId"`       // The id of the frame that initiated the request.
		ResourceType  string              `json:"resourceType"`  // How the requested resource will be used. enum values: Document, Stylesheet, Image, Media, Font, Script, TextTrack, XHR, Fetch, EventSource, WebSocket, Manifest, SignedExchange, Ping, CSPViolationReport, Other
		AuthChallenge *FetchAuthChallenge `json:"authChallenge"` // Details of the Authorization Challenge encountered. If this is set, client should respond with continueRequest that contains AuthChallengeResponse.
	} `json:"Params,omitempty"`
}

Issued when the domain is enabled with handleAuthRequests set to true. The request is paused until client responds with continueWithAuth.

type FetchContinueRequestParams added in v1.0.3

type FetchContinueRequestParams struct {
	// An id the client received in requestPaused event.
	RequestId string `json:"requestId"`
	// If set, the request url will be modified in a way that's not observable by page.
	Url string `json:"url,omitempty"`
	// If set, the request method is overridden.
	Method string `json:"method,omitempty"`
	// If set, overrides the post data in the request.
	PostData string `json:"postData,omitempty"`
	// If set, overrides the request headers.
	Headers []*FetchHeaderEntry `json:"headers,omitempty"`
}

type FetchContinueWithAuthParams added in v1.0.3

type FetchContinueWithAuthParams struct {
	// An id the client received in authRequired event.
	RequestId string `json:"requestId"`
	// Response to  with an authChallenge.
	AuthChallengeResponse *FetchAuthChallengeResponse `json:"authChallengeResponse"`
}

type FetchEnableParams added in v1.0.3

type FetchEnableParams struct {
	// If specified, only requests matching any of these patterns will produce fetchRequested event and will be paused until clients response. If not set, all requests will be affected.
	Patterns []*FetchRequestPattern `json:"patterns,omitempty"`
	// If true, authRequired events will be issued and requests will be paused expecting a call to continueWithAuth.
	HandleAuthRequests bool `json:"handleAuthRequests,omitempty"`
}

type FetchFailRequestParams added in v1.0.3

type FetchFailRequestParams struct {
	// An id the client received in requestPaused event.
	RequestId string `json:"requestId"`
	// Causes the request to fail with the given reason. enum values: Failed, Aborted, TimedOut, AccessDenied, ConnectionClosed, ConnectionReset, ConnectionRefused, ConnectionAborted, ConnectionFailed, NameNotResolved, InternetDisconnected, AddressUnreachable, BlockedByClient, BlockedByResponse
	ErrorReason string `json:"errorReason"`
}

type FetchFulfillRequestParams added in v1.0.3

type FetchFulfillRequestParams struct {
	// An id the client received in requestPaused event.
	RequestId string `json:"requestId"`
	// An HTTP response code.
	ResponseCode int `json:"responseCode"`
	// Response headers.
	ResponseHeaders []*FetchHeaderEntry `json:"responseHeaders,omitempty"`
	// Alternative way of specifying response headers as a \0-separated series of name: value pairs. Prefer the above method unless you need to represent some non-UTF8 values that can't be transmitted over the protocol as text.
	BinaryResponseHeaders string `json:"binaryResponseHeaders,omitempty"`
	// A response body.
	Body string `json:"body,omitempty"`
	// A textual representation of responseCode. If absent, a standard phrase matching responseCode is used.
	ResponsePhrase string `json:"responsePhrase,omitempty"`
}

type FetchGetResponseBodyParams added in v1.0.3

type FetchGetResponseBodyParams struct {
	// Identifier for the intercepted request to get body for.
	RequestId string `json:"requestId"`
}

type FetchHeaderEntry added in v1.0.3

type FetchHeaderEntry struct {
	Name  string `json:"name"`  //
	Value string `json:"value"` //
}

Response HTTP header entry

type FetchRequestPattern added in v1.0.3

type FetchRequestPattern struct {
	UrlPattern   string `json:"urlPattern,omitempty"`   // Wildcards ('*' -> zero or more, '?' -> exactly one) are allowed. Escape character is backslash. Omitting is equivalent to "*".
	ResourceType string `json:"resourceType,omitempty"` // If set, only requests for matching resource types will be intercepted. enum values: Document, Stylesheet, Image, Media, Font, Script, TextTrack, XHR, Fetch, EventSource, WebSocket, Manifest, SignedExchange, Ping, CSPViolationReport, Other
	RequestStage string `json:"requestStage,omitempty"` // Stage at wich to begin intercepting requests. Default is Request. enum values: Request, Response
}

No Description.

type FetchRequestPausedEvent added in v1.0.3

type FetchRequestPausedEvent struct {
	Method string `json:"method"`
	Params struct {
		RequestId           string              `json:"requestId"`                     // Each request the page makes will have a unique id.
		Request             *NetworkRequest     `json:"request"`                       // The details of the request.
		FrameId             string              `json:"frameId"`                       // The id of the frame that initiated the request.
		ResourceType        string              `json:"resourceType"`                  // How the requested resource will be used. enum values: Document, Stylesheet, Image, Media, Font, Script, TextTrack, XHR, Fetch, EventSource, WebSocket, Manifest, SignedExchange, Ping, CSPViolationReport, Other
		ResponseErrorReason string              `json:"responseErrorReason,omitempty"` // Response error if intercepted at response stage. enum values: Failed, Aborted, TimedOut, AccessDenied, ConnectionClosed, ConnectionReset, ConnectionRefused, ConnectionAborted, ConnectionFailed, NameNotResolved, InternetDisconnected, AddressUnreachable, BlockedByClient, BlockedByResponse
		ResponseStatusCode  int                 `json:"responseStatusCode,omitempty"`  // Response code if intercepted at response stage.
		ResponseHeaders     []*FetchHeaderEntry `json:"responseHeaders,omitempty"`     // Response headers if intercepted at the response stage.
		NetworkId           string              `json:"networkId,omitempty"`           // If the intercepted request had a corresponding Network.requestWillBeSent event fired for it, then this networkId will be the same as the requestId present in the requestWillBeSent event.
	} `json:"Params,omitempty"`
}

Issued when the domain is enabled and the request URL matches the specified filter. The request is paused until the client responds with one of continueRequest, failRequest or fulfillRequest. The stage of the request can be determined by presence of responseErrorReason and responseStatusCode -- the request is at the response stage if either of these fields is present and in the request stage otherwise.

type FetchTakeResponseBodyAsStreamParams added in v1.0.3

type FetchTakeResponseBodyAsStreamParams struct {
	//
	RequestId string `json:"requestId"`
}

type HeadlessExperimental

type HeadlessExperimental struct {
	// contains filtered or unexported fields
}

func NewHeadlessExperimental

func NewHeadlessExperimental(target gcdmessage.ChromeTargeter) *HeadlessExperimental

func (*HeadlessExperimental) BeginFrame

func (c *HeadlessExperimental) BeginFrame(frameTimeTicks float64, interval float64, noDisplayUpdates bool, screenshot *HeadlessExperimentalScreenshotParams) (bool, string, error)

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. frameTimeTicks - Timestamp of this BeginFrame in Renderer TimeTicks (milliseconds of uptime). If not set, the current time will be used. interval - 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 - 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 - 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. 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 (*HeadlessExperimental) BeginFrameWithParams

BeginFrameWithParams - 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. 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 (*HeadlessExperimental) Disable

Disables headless events for the target.

func (*HeadlessExperimental) Enable

Enables headless events for the target.

type HeadlessExperimentalBeginFrameParams

type HeadlessExperimentalBeginFrameParams struct {
	// Timestamp of this BeginFrame in Renderer TimeTicks (milliseconds of uptime). If not set, the current time will be used.
	FrameTimeTicks float64 `json:"frameTimeTicks,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.
	Interval float64 `json:"interval,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.
	NoDisplayUpdates bool `json:"noDisplayUpdates,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.
	Screenshot *HeadlessExperimentalScreenshotParams `json:"screenshot,omitempty"`
}

type HeadlessExperimentalNeedsBeginFramesChangedEvent

type HeadlessExperimentalNeedsBeginFramesChangedEvent struct {
	Method string `json:"method"`
	Params struct {
		NeedsBeginFrames bool `json:"needsBeginFrames"` // True if BeginFrames are needed, false otherwise.
	} `json:"Params,omitempty"`
}

Issued when the target starts or stops needing BeginFrames. Deprecated. Issue beginFrame unconditionally instead and use result from beginFrame to detect whether the frames were suppressed.

type HeadlessExperimentalScreenshotParams

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

Encoding options for a screenshot.

type HeapProfiler

type HeapProfiler struct {
	// contains filtered or unexported fields
}

func NewHeapProfiler

func NewHeapProfiler(target gcdmessage.ChromeTargeter) *HeapProfiler

func (*HeapProfiler) AddInspectedHeapObject

func (c *HeapProfiler) AddInspectedHeapObject(heapObjectId string) (*gcdmessage.ChromeResponse, error)

AddInspectedHeapObject - Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). heapObjectId - Heap snapshot object id to be accessible by means of $x command line API.

func (*HeapProfiler) AddInspectedHeapObjectWithParams

func (c *HeapProfiler) AddInspectedHeapObjectWithParams(v *HeapProfilerAddInspectedHeapObjectParams) (*gcdmessage.ChromeResponse, error)

AddInspectedHeapObjectWithParams - Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).

func (*HeapProfiler) CollectGarbage

func (c *HeapProfiler) CollectGarbage() (*gcdmessage.ChromeResponse, error)

func (*HeapProfiler) Disable

func (c *HeapProfiler) Disable() (*gcdmessage.ChromeResponse, error)

func (*HeapProfiler) Enable

func (c *HeapProfiler) Enable() (*gcdmessage.ChromeResponse, error)

func (*HeapProfiler) GetHeapObjectId

func (c *HeapProfiler) GetHeapObjectId(objectId string) (string, error)

GetHeapObjectId - objectId - Identifier of the object to get heap object id for. Returns - heapSnapshotObjectId - Id of the heap snapshot object corresponding to the passed remote object id.

func (*HeapProfiler) GetHeapObjectIdWithParams

func (c *HeapProfiler) GetHeapObjectIdWithParams(v *HeapProfilerGetHeapObjectIdParams) (string, error)

GetHeapObjectIdWithParams - Returns - heapSnapshotObjectId - Id of the heap snapshot object corresponding to the passed remote object id.

func (*HeapProfiler) GetObjectByHeapObjectId

func (c *HeapProfiler) GetObjectByHeapObjectId(objectId string, objectGroup string) (*RuntimeRemoteObject, error)

GetObjectByHeapObjectId - objectId - objectGroup - Symbolic group name that can be used to release multiple objects. Returns - result - Evaluation result.

func (*HeapProfiler) GetObjectByHeapObjectIdWithParams

func (c *HeapProfiler) GetObjectByHeapObjectIdWithParams(v *HeapProfilerGetObjectByHeapObjectIdParams) (*RuntimeRemoteObject, error)

GetObjectByHeapObjectIdWithParams - Returns - result - Evaluation result.

func (*HeapProfiler) GetSamplingProfile

func (c *HeapProfiler) GetSamplingProfile() (*HeapProfilerSamplingHeapProfile, error)

GetSamplingProfile - Returns - profile - Return the sampling profile being collected.

func (*HeapProfiler) StartSampling

func (c *HeapProfiler) StartSampling(samplingInterval float64) (*gcdmessage.ChromeResponse, error)

StartSampling - samplingInterval - Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes.

func (*HeapProfiler) StartSamplingWithParams

func (c *HeapProfiler) StartSamplingWithParams(v *HeapProfilerStartSamplingParams) (*gcdmessage.ChromeResponse, error)

StartSamplingWithParams -

func (*HeapProfiler) StartTrackingHeapObjects

func (c *HeapProfiler) StartTrackingHeapObjects(trackAllocations bool) (*gcdmessage.ChromeResponse, error)

StartTrackingHeapObjects - trackAllocations -

func (*HeapProfiler) StartTrackingHeapObjectsWithParams

func (c *HeapProfiler) StartTrackingHeapObjectsWithParams(v *HeapProfilerStartTrackingHeapObjectsParams) (*gcdmessage.ChromeResponse, error)

StartTrackingHeapObjectsWithParams -

func (*HeapProfiler) StopSampling

func (c *HeapProfiler) StopSampling() (*HeapProfilerSamplingHeapProfile, error)

StopSampling - Returns - profile - Recorded sampling heap profile.

func (*HeapProfiler) StopTrackingHeapObjects

func (c *HeapProfiler) StopTrackingHeapObjects(reportProgress bool, treatGlobalObjectsAsRoots bool) (*gcdmessage.ChromeResponse, error)

StopTrackingHeapObjects - reportProgress - If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped. treatGlobalObjectsAsRoots -

func (*HeapProfiler) StopTrackingHeapObjectsWithParams

func (c *HeapProfiler) StopTrackingHeapObjectsWithParams(v *HeapProfilerStopTrackingHeapObjectsParams) (*gcdmessage.ChromeResponse, error)

StopTrackingHeapObjectsWithParams -

func (*HeapProfiler) TakeHeapSnapshot

func (c *HeapProfiler) TakeHeapSnapshot(reportProgress bool, treatGlobalObjectsAsRoots bool) (*gcdmessage.ChromeResponse, error)

TakeHeapSnapshot - reportProgress - If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. treatGlobalObjectsAsRoots - If true, a raw snapshot without artifical roots will be generated

func (*HeapProfiler) TakeHeapSnapshotWithParams

func (c *HeapProfiler) TakeHeapSnapshotWithParams(v *HeapProfilerTakeHeapSnapshotParams) (*gcdmessage.ChromeResponse, error)

TakeHeapSnapshotWithParams -

type HeapProfilerAddHeapSnapshotChunkEvent

type HeapProfilerAddHeapSnapshotChunkEvent struct {
	Method string `json:"method"`
	Params struct {
		Chunk string `json:"chunk"` //
	} `json:"Params,omitempty"`
}

type HeapProfilerAddInspectedHeapObjectParams

type HeapProfilerAddInspectedHeapObjectParams struct {
	// Heap snapshot object id to be accessible by means of $x command line API.
	HeapObjectId string `json:"heapObjectId"`
}

type HeapProfilerGetHeapObjectIdParams

type HeapProfilerGetHeapObjectIdParams struct {
	// Identifier of the object to get heap object id for.
	ObjectId string `json:"objectId"`
}

type HeapProfilerGetObjectByHeapObjectIdParams

type HeapProfilerGetObjectByHeapObjectIdParams struct {
	//
	ObjectId string `json:"objectId"`
	// Symbolic group name that can be used to release multiple objects.
	ObjectGroup string `json:"objectGroup,omitempty"`
}

type HeapProfilerHeapStatsUpdateEvent

type HeapProfilerHeapStatsUpdateEvent struct {
	Method string `json:"method"`
	Params struct {
		StatsUpdate []int `json:"statsUpdate"` // An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment.
	} `json:"Params,omitempty"`
}

If heap objects tracking has been started then backend may send update for one or more fragments

type HeapProfilerLastSeenObjectIdEvent

type HeapProfilerLastSeenObjectIdEvent struct {
	Method string `json:"method"`
	Params struct {
		LastSeenObjectId int     `json:"lastSeenObjectId"` //
		Timestamp        float64 `json:"timestamp"`        //
	} `json:"Params,omitempty"`
}

If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.

type HeapProfilerReportHeapSnapshotProgressEvent

type HeapProfilerReportHeapSnapshotProgressEvent struct {
	Method string `json:"method"`
	Params struct {
		Done     int  `json:"done"`               //
		Total    int  `json:"total"`              //
		Finished bool `json:"finished,omitempty"` //
	} `json:"Params,omitempty"`
}

type HeapProfilerSamplingHeapProfile

type HeapProfilerSamplingHeapProfile struct {
	Head    *HeapProfilerSamplingHeapProfileNode     `json:"head"`    //
	Samples []*HeapProfilerSamplingHeapProfileSample `json:"samples"` //
}

Sampling profile.

type HeapProfilerSamplingHeapProfileNode

type HeapProfilerSamplingHeapProfileNode struct {
	CallFrame *RuntimeCallFrame                      `json:"callFrame"` // Function location.
	SelfSize  float64                                `json:"selfSize"`  // Allocations size in bytes for the node excluding children.
	Id        int                                    `json:"id"`        // Node id. Ids are unique across all profiles collected between startSampling and stopSampling.
	Children  []*HeapProfilerSamplingHeapProfileNode `json:"children"`  // Child nodes.
}

Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes.

type HeapProfilerSamplingHeapProfileSample added in v1.0.3

type HeapProfilerSamplingHeapProfileSample struct {
	Size    float64 `json:"size"`    // Allocation size in bytes attributed to the sample.
	NodeId  int     `json:"nodeId"`  // Id of the corresponding profile tree node.
	Ordinal float64 `json:"ordinal"` // Time-ordered sample ordinal number. It is unique across all profiles retrieved between startSampling and stopSampling.
}

A single sample from a sampling profile.

type HeapProfilerStartSamplingParams

type HeapProfilerStartSamplingParams struct {
	// Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes.
	SamplingInterval float64 `json:"samplingInterval,omitempty"`
}

type HeapProfilerStartTrackingHeapObjectsParams

type HeapProfilerStartTrackingHeapObjectsParams struct {
	//
	TrackAllocations bool `json:"trackAllocations,omitempty"`
}

type HeapProfilerStopTrackingHeapObjectsParams

type HeapProfilerStopTrackingHeapObjectsParams struct {
	// If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped.
	ReportProgress bool `json:"reportProgress,omitempty"`
	//
	TreatGlobalObjectsAsRoots bool `json:"treatGlobalObjectsAsRoots,omitempty"`
}

type HeapProfilerTakeHeapSnapshotParams

type HeapProfilerTakeHeapSnapshotParams struct {
	// If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken.
	ReportProgress bool `json:"reportProgress,omitempty"`
	// If true, a raw snapshot without artifical roots will be generated
	TreatGlobalObjectsAsRoots bool `json:"treatGlobalObjectsAsRoots,omitempty"`
}

type IO

type IO struct {
	// contains filtered or unexported fields
}

func NewIO

func NewIO(target gcdmessage.ChromeTargeter) *IO

func (*IO) Close

func (c *IO) Close(handle string) (*gcdmessage.ChromeResponse, error)

Close - Close the stream, discard any temporary backing storage. handle - Handle of the stream to close.

func (*IO) CloseWithParams

func (c *IO) CloseWithParams(v *IOCloseParams) (*gcdmessage.ChromeResponse, error)

CloseWithParams - Close the stream, discard any temporary backing storage.

func (*IO) Read

func (c *IO) Read(handle string, offset int, size int) (bool, string, bool, error)

Read - Read a chunk of the stream handle - Handle of the stream to read. offset - Seek to the specified offset before reading (if not specificed, proceed with offset following the last read). Some types of streams may only support sequential reads. size - Maximum number of bytes to read (left upon the agent discretion if not specified). Returns - base64Encoded - Set if the data is base64-encoded data - Data that were read. eof - Set if the end-of-file condition occured while reading.

func (*IO) ReadWithParams

func (c *IO) ReadWithParams(v *IOReadParams) (bool, string, bool, error)

ReadWithParams - Read a chunk of the stream Returns - base64Encoded - Set if the data is base64-encoded data - Data that were read. eof - Set if the end-of-file condition occured while reading.

func (*IO) ResolveBlob

func (c *IO) ResolveBlob(objectId string) (string, error)

ResolveBlob - Return UUID of Blob object specified by a remote object id. objectId - Object id of a Blob object wrapper. Returns - uuid - UUID of the specified Blob.

func (*IO) ResolveBlobWithParams

func (c *IO) ResolveBlobWithParams(v *IOResolveBlobParams) (string, error)

ResolveBlobWithParams - Return UUID of Blob object specified by a remote object id. Returns - uuid - UUID of the specified Blob.

type IOCloseParams

type IOCloseParams struct {
	// Handle of the stream to close.
	Handle string `json:"handle"`
}

type IOReadParams

type IOReadParams struct {
	// Handle of the stream to read.
	Handle string `json:"handle"`
	// Seek to the specified offset before reading (if not specificed, proceed with offset following the last read). Some types of streams may only support sequential reads.
	Offset int `json:"offset,omitempty"`
	// Maximum number of bytes to read (left upon the agent discretion if not specified).
	Size int `json:"size,omitempty"`
}

type IOResolveBlobParams

type IOResolveBlobParams struct {
	// Object id of a Blob object wrapper.
	ObjectId string `json:"objectId"`
}

type IndexedDB

type IndexedDB struct {
	// contains filtered or unexported fields
}

func NewIndexedDB

func NewIndexedDB(target gcdmessage.ChromeTargeter) *IndexedDB

func (*IndexedDB) ClearObjectStore

func (c *IndexedDB) ClearObjectStore(securityOrigin string, databaseName string, objectStoreName string) (*gcdmessage.ChromeResponse, error)

ClearObjectStore - Clears all entries from an object store. securityOrigin - Security origin. databaseName - Database name. objectStoreName - Object store name.

func (*IndexedDB) ClearObjectStoreWithParams

func (c *IndexedDB) ClearObjectStoreWithParams(v *IndexedDBClearObjectStoreParams) (*gcdmessage.ChromeResponse, error)

ClearObjectStoreWithParams - Clears all entries from an object store.

func (*IndexedDB) DeleteDatabase

func (c *IndexedDB) DeleteDatabase(securityOrigin string, databaseName string) (*gcdmessage.ChromeResponse, error)

DeleteDatabase - Deletes a database. securityOrigin - Security origin. databaseName - Database name.

func (*IndexedDB) DeleteDatabaseWithParams

func (c *IndexedDB) DeleteDatabaseWithParams(v *IndexedDBDeleteDatabaseParams) (*gcdmessage.ChromeResponse, error)

DeleteDatabaseWithParams - Deletes a database.

func (*IndexedDB) DeleteObjectStoreEntries

func (c *IndexedDB) DeleteObjectStoreEntries(securityOrigin string, databaseName string, objectStoreName string, keyRange *IndexedDBKeyRange) (*gcdmessage.ChromeResponse, error)

DeleteObjectStoreEntries - Delete a range of entries from an object store securityOrigin - databaseName - objectStoreName - keyRange - Range of entry keys to delete

func (*IndexedDB) DeleteObjectStoreEntriesWithParams

func (c *IndexedDB) DeleteObjectStoreEntriesWithParams(v *IndexedDBDeleteObjectStoreEntriesParams) (*gcdmessage.ChromeResponse, error)

DeleteObjectStoreEntriesWithParams - Delete a range of entries from an object store

func (*IndexedDB) Disable

func (c *IndexedDB) Disable() (*gcdmessage.ChromeResponse, error)

Disables events from backend.

func (*IndexedDB) Enable

func (c *IndexedDB) Enable() (*gcdmessage.ChromeResponse, error)

Enables events from backend.

func (*IndexedDB) GetMetadata added in v1.0.6

func (c *IndexedDB) GetMetadata(securityOrigin string, databaseName string, objectStoreName string) (float64, float64, error)

GetMetadata - Gets metadata of an object store securityOrigin - Security origin. databaseName - Database name. objectStoreName - Object store name. Returns - entriesCount - the entries count keyGeneratorValue - the current value of key generator, to become the next inserted key into the object store. Valid if objectStore.autoIncrement is true.

func (*IndexedDB) GetMetadataWithParams added in v1.0.6

func (c *IndexedDB) GetMetadataWithParams(v *IndexedDBGetMetadataParams) (float64, float64, error)

GetMetadataWithParams - Gets metadata of an object store Returns - entriesCount - the entries count keyGeneratorValue - the current value of key generator, to become the next inserted key into the object store. Valid if objectStore.autoIncrement is true.

func (*IndexedDB) RequestData

func (c *IndexedDB) RequestData(securityOrigin string, databaseName string, objectStoreName string, indexName string, skipCount int, pageSize int, keyRange *IndexedDBKeyRange) ([]*IndexedDBDataEntry, bool, error)

RequestData - Requests data from object store or index. securityOrigin - Security origin. databaseName - Database name. objectStoreName - Object store name. indexName - Index name, empty string for object store data requests. skipCount - Number of records to skip. pageSize - Number of records to fetch. keyRange - Key range. Returns - objectStoreDataEntries - Array of object store data entries. hasMore - If true, there are more entries to fetch in the given range.

func (*IndexedDB) RequestDataWithParams

func (c *IndexedDB) RequestDataWithParams(v *IndexedDBRequestDataParams) ([]*IndexedDBDataEntry, bool, error)

RequestDataWithParams - Requests data from object store or index. Returns - objectStoreDataEntries - Array of object store data entries. hasMore - If true, there are more entries to fetch in the given range.

func (*IndexedDB) RequestDatabase

func (c *IndexedDB) RequestDatabase(securityOrigin string, databaseName string) (*IndexedDBDatabaseWithObjectStores, error)

RequestDatabase - Requests database with given name in given frame. securityOrigin - Security origin. databaseName - Database name. Returns - databaseWithObjectStores - Database with an array of object stores.

func (*IndexedDB) RequestDatabaseNames

func (c *IndexedDB) RequestDatabaseNames(securityOrigin string) ([]string, error)

RequestDatabaseNames - Requests database names for given security origin. securityOrigin - Security origin. Returns - databaseNames - Database names for origin.

func (*IndexedDB) RequestDatabaseNamesWithParams

func (c *IndexedDB) RequestDatabaseNamesWithParams(v *IndexedDBRequestDatabaseNamesParams) ([]string, error)

RequestDatabaseNamesWithParams - Requests database names for given security origin. Returns - databaseNames - Database names for origin.

func (*IndexedDB) RequestDatabaseWithParams

RequestDatabaseWithParams - Requests database with given name in given frame. Returns - databaseWithObjectStores - Database with an array of object stores.

type IndexedDBClearObjectStoreParams

type IndexedDBClearObjectStoreParams struct {
	// Security origin.
	SecurityOrigin string `json:"securityOrigin"`
	// Database name.
	DatabaseName string `json:"databaseName"`
	// Object store name.
	ObjectStoreName string `json:"objectStoreName"`
}

type IndexedDBDataEntry

type IndexedDBDataEntry struct {
	Key        *RuntimeRemoteObject `json:"key"`        // Key object.
	PrimaryKey *RuntimeRemoteObject `json:"primaryKey"` // Primary key object.
	Value      *RuntimeRemoteObject `json:"value"`      // Value object.
}

Data entry.

type IndexedDBDatabaseWithObjectStores

type IndexedDBDatabaseWithObjectStores struct {
	Name         string                  `json:"name"`         // Database name.
	Version      float64                 `json:"version"`      // Database version (type is not 'integer', as the standard requires the version number to be 'unsigned long long')
	ObjectStores []*IndexedDBObjectStore `json:"objectStores"` // Object stores in this database.
}

Database with an array of object stores.

type IndexedDBDeleteDatabaseParams

type IndexedDBDeleteDatabaseParams struct {
	// Security origin.
	SecurityOrigin string `json:"securityOrigin"`
	// Database name.
	DatabaseName string `json:"databaseName"`
}

type IndexedDBDeleteObjectStoreEntriesParams

type IndexedDBDeleteObjectStoreEntriesParams struct {
	//
	SecurityOrigin string `json:"securityOrigin"`
	//
	DatabaseName string `json:"databaseName"`
	//
	ObjectStoreName string `json:"objectStoreName"`
	// Range of entry keys to delete
	KeyRange *IndexedDBKeyRange `json:"keyRange"`
}

type IndexedDBGetMetadataParams added in v1.0.6

type IndexedDBGetMetadataParams struct {
	// Security origin.
	SecurityOrigin string `json:"securityOrigin"`
	// Database name.
	DatabaseName string `json:"databaseName"`
	// Object store name.
	ObjectStoreName string `json:"objectStoreName"`
}

type IndexedDBKey

type IndexedDBKey struct {
	Type   string          `json:"type"`             // Key type.
	Number float64         `json:"number,omitempty"` // Number value.
	String string          `json:"string,omitempty"` // String value.
	Date   float64         `json:"date,omitempty"`   // Date value.
	Array  []*IndexedDBKey `json:"array,omitempty"`  // Array value.
}

Key.

type IndexedDBKeyPath

type IndexedDBKeyPath struct {
	Type   string   `json:"type"`             // Key path type.
	String string   `json:"string,omitempty"` // String value.
	Array  []string `json:"array,omitempty"`  // Array value.
}

Key path.

type IndexedDBKeyRange

type IndexedDBKeyRange struct {
	Lower     *IndexedDBKey `json:"lower,omitempty"` // Lower bound.
	Upper     *IndexedDBKey `json:"upper,omitempty"` // Upper bound.
	LowerOpen bool          `json:"lowerOpen"`       // If true lower bound is open.
	UpperOpen bool          `json:"upperOpen"`       // If true upper bound is open.
}

Key range.

type IndexedDBObjectStore

type IndexedDBObjectStore struct {
	Name          string                       `json:"name"`          // Object store name.
	KeyPath       *IndexedDBKeyPath            `json:"keyPath"`       // Object store key path.
	AutoIncrement bool                         `json:"autoIncrement"` // If true, object store has auto increment flag set.
	Indexes       []*IndexedDBObjectStoreIndex `json:"indexes"`       // Indexes in this object store.
}

Object store.

type IndexedDBObjectStoreIndex

type IndexedDBObjectStoreIndex struct {
	Name       string            `json:"name"`       // Index name.
	KeyPath    *IndexedDBKeyPath `json:"keyPath"`    // Index key path.
	Unique     bool              `json:"unique"`     // If true, index is unique.
	MultiEntry bool              `json:"multiEntry"` // If true, index allows multiple entries for a key.
}

Object store index.

type IndexedDBRequestDataParams

type IndexedDBRequestDataParams struct {
	// Security origin.
	SecurityOrigin string `json:"securityOrigin"`
	// Database name.
	DatabaseName string `json:"databaseName"`
	// Object store name.
	ObjectStoreName string `json:"objectStoreName"`
	// Index name, empty string for object store data requests.
	IndexName string `json:"indexName"`
	// Number of records to skip.
	SkipCount int `json:"skipCount"`
	// Number of records to fetch.
	PageSize int `json:"pageSize"`
	// Key range.
	KeyRange *IndexedDBKeyRange `json:"keyRange,omitempty"`
}

type IndexedDBRequestDatabaseNamesParams

type IndexedDBRequestDatabaseNamesParams struct {
	// Security origin.
	SecurityOrigin string `json:"securityOrigin"`
}

type IndexedDBRequestDatabaseParams

type IndexedDBRequestDatabaseParams struct {
	// Security origin.
	SecurityOrigin string `json:"securityOrigin"`
	// Database name.
	DatabaseName string `json:"databaseName"`
}

type Input

type Input struct {
	// contains filtered or unexported fields
}

func NewInput

func NewInput(target gcdmessage.ChromeTargeter) *Input

func (*Input) DispatchKeyEvent

func (c *Input) DispatchKeyEvent(theType string, modifiers int, timestamp float64, text string, unmodifiedText string, keyIdentifier string, code string, key string, windowsVirtualKeyCode int, nativeVirtualKeyCode int, autoRepeat bool, isKeypad bool, isSystemKey bool, location int, commands []string) (*gcdmessage.ChromeResponse, error)

DispatchKeyEvent - Dispatches a key event to the page. type - Type of the key event. modifiers - Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0). timestamp - Time at which the event occurred. text - Text as generated by processing a virtual key code with a keyboard layout. Not needed for for `keyUp` and `rawKeyDown` events (default: "") unmodifiedText - Text that would have been generated by the keyboard if no modifiers were pressed (except for shift). Useful for shortcut (accelerator) key handling (default: ""). keyIdentifier - Unique key identifier (e.g., 'U+0041') (default: ""). code - Unique DOM defined string value for each physical key (e.g., 'KeyA') (default: ""). key - Unique DOM defined string value describing the meaning of the key in the context of active modifiers, keyboard layout, etc (e.g., 'AltGr') (default: ""). windowsVirtualKeyCode - Windows virtual key code (default: 0). nativeVirtualKeyCode - Native virtual key code (default: 0). autoRepeat - Whether the event was generated from auto repeat (default: false). isKeypad - Whether the event was generated from the keypad (default: false). isSystemKey - Whether the event was a system key event (default: false). location - Whether the event was from the left or right side of the keyboard. 1=Left, 2=Right (default: 0). commands - Editing commands to send with the key event (e.g., 'selectAll') (default: []). These are related to but not equal the command names used in `document.execCommand` and NSStandardKeyBindingResponding. See https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/editing/commands/editor_command_names.h for valid command names.

func (*Input) DispatchKeyEventWithParams

func (c *Input) DispatchKeyEventWithParams(v *InputDispatchKeyEventParams) (*gcdmessage.ChromeResponse, error)

DispatchKeyEventWithParams - Dispatches a key event to the page.

func (*Input) DispatchMouseEvent

func (c *Input) DispatchMouseEvent(theType string, x float64, y float64, modifiers int, timestamp float64, button string, buttons int, clickCount int, deltaX float64, deltaY float64, pointerType string) (*gcdmessage.ChromeResponse, error)

DispatchMouseEvent - Dispatches a mouse event to the page. type - Type of the mouse event. x - X coordinate of the event relative to the main frame's viewport in CSS pixels. y - Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport. modifiers - Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0). timestamp - Time at which the event occurred. button - Mouse button (default: "none"). enum values: none, left, middle, right, back, forward buttons - A number indicating which buttons are pressed on the mouse when a mouse event is triggered. Left=1, Right=2, Middle=4, Back=8, Forward=16, None=0. clickCount - Number of times the mouse button was clicked (default: 0). deltaX - X delta in CSS pixels for mouse wheel event (default: 0). deltaY - Y delta in CSS pixels for mouse wheel event (default: 0). pointerType - Pointer type (default: "mouse").

func (*Input) DispatchMouseEventWithParams

func (c *Input) DispatchMouseEventWithParams(v *InputDispatchMouseEventParams) (*gcdmessage.ChromeResponse, error)

DispatchMouseEventWithParams - Dispatches a mouse event to the page.

func (*Input) DispatchTouchEvent

func (c *Input) DispatchTouchEvent(theType string, touchPoints []*InputTouchPoint, modifiers int, timestamp float64) (*gcdmessage.ChromeResponse, error)

DispatchTouchEvent - Dispatches a touch event to the page. type - Type of the touch event. TouchEnd and TouchCancel must not contain any touch points, while TouchStart and TouchMove must contains at least one. touchPoints - Active touch points on the touch device. One event per any changed point (compared to previous touch event in a sequence) is generated, emulating pressing/moving/releasing points one by one. modifiers - Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0). timestamp - Time at which the event occurred.

func (*Input) DispatchTouchEventWithParams

func (c *Input) DispatchTouchEventWithParams(v *InputDispatchTouchEventParams) (*gcdmessage.ChromeResponse, error)

DispatchTouchEventWithParams - Dispatches a touch event to the page.

func (*Input) EmulateTouchFromMouseEvent

func (c *Input) EmulateTouchFromMouseEvent(theType string, x int, y int, button string, timestamp float64, deltaX float64, deltaY float64, modifiers int, clickCount int) (*gcdmessage.ChromeResponse, error)

EmulateTouchFromMouseEvent - Emulates touch event from the mouse event parameters. type - Type of the mouse event. x - X coordinate of the mouse pointer in DIP. y - Y coordinate of the mouse pointer in DIP. button - Mouse button. Only "none", "left", "right" are supported. enum values: none, left, middle, right, back, forward timestamp - Time at which the event occurred (default: current time). deltaX - X delta in DIP for mouse wheel event (default: 0). deltaY - Y delta in DIP for mouse wheel event (default: 0). modifiers - Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0). clickCount - Number of times the mouse button was clicked (default: 0).

func (*Input) EmulateTouchFromMouseEventWithParams

func (c *Input) EmulateTouchFromMouseEventWithParams(v *InputEmulateTouchFromMouseEventParams) (*gcdmessage.ChromeResponse, error)

EmulateTouchFromMouseEventWithParams - Emulates touch event from the mouse event parameters.

func (*Input) InsertText

func (c *Input) InsertText(text string) (*gcdmessage.ChromeResponse, error)

InsertText - This method emulates inserting text that doesn't come from a key press, for example an emoji keyboard or an IME. text - The text to insert.

func (*Input) InsertTextWithParams

func (c *Input) InsertTextWithParams(v *InputInsertTextParams) (*gcdmessage.ChromeResponse, error)

InsertTextWithParams - This method emulates inserting text that doesn't come from a key press, for example an emoji keyboard or an IME.

func (*Input) SetIgnoreInputEvents

func (c *Input) SetIgnoreInputEvents(ignore bool) (*gcdmessage.ChromeResponse, error)

SetIgnoreInputEvents - Ignores input events (useful while auditing page). ignore - Ignores input events processing when set to true.

func (*Input) SetIgnoreInputEventsWithParams

func (c *Input) SetIgnoreInputEventsWithParams(v *InputSetIgnoreInputEventsParams) (*gcdmessage.ChromeResponse, error)

SetIgnoreInputEventsWithParams - Ignores input events (useful while auditing page).

func (*Input) SynthesizePinchGesture

func (c *Input) SynthesizePinchGesture(x float64, y float64, scaleFactor float64, relativeSpeed int, gestureSourceType string) (*gcdmessage.ChromeResponse, error)

SynthesizePinchGesture - Synthesizes a pinch gesture over a time period by issuing appropriate touch events. x - X coordinate of the start of the gesture in CSS pixels. y - Y coordinate of the start of the gesture in CSS pixels. scaleFactor - Relative scale factor after zooming (>1.0 zooms in, <1.0 zooms out). relativeSpeed - Relative pointer speed in pixels per second (default: 800). gestureSourceType - Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type). enum values: default, touch, mouse

func (*Input) SynthesizePinchGestureWithParams

func (c *Input) SynthesizePinchGestureWithParams(v *InputSynthesizePinchGestureParams) (*gcdmessage.ChromeResponse, error)

SynthesizePinchGestureWithParams - Synthesizes a pinch gesture over a time period by issuing appropriate touch events.

func (*Input) SynthesizeScrollGesture

func (c *Input) SynthesizeScrollGesture(x float64, y float64, xDistance float64, yDistance float64, xOverscroll float64, yOverscroll float64, preventFling bool, speed int, gestureSourceType string, repeatCount int, repeatDelayMs int, interactionMarkerName string) (*gcdmessage.ChromeResponse, error)

SynthesizeScrollGesture - Synthesizes a scroll gesture over a time period by issuing appropriate touch events. x - X coordinate of the start of the gesture in CSS pixels. y - Y coordinate of the start of the gesture in CSS pixels. xDistance - The distance to scroll along the X axis (positive to scroll left). yDistance - The distance to scroll along the Y axis (positive to scroll up). xOverscroll - The number of additional pixels to scroll back along the X axis, in addition to the given distance. yOverscroll - The number of additional pixels to scroll back along the Y axis, in addition to the given distance. preventFling - Prevent fling (default: true). speed - Swipe speed in pixels per second (default: 800). gestureSourceType - Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type). enum values: default, touch, mouse repeatCount - The number of times to repeat the gesture (default: 0). repeatDelayMs - The number of milliseconds delay between each repeat. (default: 250). interactionMarkerName - The name of the interaction markers to generate, if not empty (default: "").

func (*Input) SynthesizeScrollGestureWithParams

func (c *Input) SynthesizeScrollGestureWithParams(v *InputSynthesizeScrollGestureParams) (*gcdmessage.ChromeResponse, error)

SynthesizeScrollGestureWithParams - Synthesizes a scroll gesture over a time period by issuing appropriate touch events.

func (*Input) SynthesizeTapGesture

func (c *Input) SynthesizeTapGesture(x float64, y float64, duration int, tapCount int, gestureSourceType string) (*gcdmessage.ChromeResponse, error)

SynthesizeTapGesture - Synthesizes a tap gesture over a time period by issuing appropriate touch events. x - X coordinate of the start of the gesture in CSS pixels. y - Y coordinate of the start of the gesture in CSS pixels. duration - Duration between touchdown and touchup events in ms (default: 50). tapCount - Number of times to perform the tap (e.g. 2 for double tap, default: 1). gestureSourceType - Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type). enum values: default, touch, mouse

func (*Input) SynthesizeTapGestureWithParams

func (c *Input) SynthesizeTapGestureWithParams(v *InputSynthesizeTapGestureParams) (*gcdmessage.ChromeResponse, error)

SynthesizeTapGestureWithParams - Synthesizes a tap gesture over a time period by issuing appropriate touch events.

type InputDispatchKeyEventParams

type InputDispatchKeyEventParams struct {
	// Type of the key event.
	TheType string `json:"type"`
	// Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
	Modifiers int `json:"modifiers,omitempty"`
	// Time at which the event occurred.
	Timestamp float64 `json:"timestamp,omitempty"`
	// Text as generated by processing a virtual key code with a keyboard layout. Not needed for for `keyUp` and `rawKeyDown` events (default: "")
	Text string `json:"text,omitempty"`
	// Text that would have been generated by the keyboard if no modifiers were pressed (except for shift). Useful for shortcut (accelerator) key handling (default: "").
	UnmodifiedText string `json:"unmodifiedText,omitempty"`
	// Unique key identifier (e.g., 'U+0041') (default: "").
	KeyIdentifier string `json:"keyIdentifier,omitempty"`
	// Unique DOM defined string value for each physical key (e.g., 'KeyA') (default: "").
	Code string `json:"code,omitempty"`
	// Unique DOM defined string value describing the meaning of the key in the context of active modifiers, keyboard layout, etc (e.g., 'AltGr') (default: "").
	Key string `json:"key,omitempty"`
	// Windows virtual key code (default: 0).
	WindowsVirtualKeyCode int `json:"windowsVirtualKeyCode,omitempty"`
	// Native virtual key code (default: 0).
	NativeVirtualKeyCode int `json:"nativeVirtualKeyCode,omitempty"`
	// Whether the event was generated from auto repeat (default: false).
	AutoRepeat bool `json:"autoRepeat,omitempty"`
	// Whether the event was generated from the keypad (default: false).
	IsKeypad bool `json:"isKeypad,omitempty"`
	// Whether the event was a system key event (default: false).
	IsSystemKey bool `json:"isSystemKey,omitempty"`
	// Whether the event was from the left or right side of the keyboard. 1=Left, 2=Right (default: 0).
	Location int `json:"location,omitempty"`
	// Editing commands to send with the key event (e.g., 'selectAll') (default: []). These are related to but not equal the command names used in `document.execCommand` and NSStandardKeyBindingResponding. See https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/editing/commands/editor_command_names.h for valid command names.
	Commands []string `json:"commands,omitempty"`
}

type InputDispatchMouseEventParams

type InputDispatchMouseEventParams struct {
	// Type of the mouse event.
	TheType string `json:"type"`
	// X coordinate of the event relative to the main frame's viewport in CSS pixels.
	X float64 `json:"x"`
	// Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport.
	Y float64 `json:"y"`
	// Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
	Modifiers int `json:"modifiers,omitempty"`
	// Time at which the event occurred.
	Timestamp float64 `json:"timestamp,omitempty"`
	// Mouse button (default: "none"). enum values: none, left, middle, right, back, forward
	Button string `json:"button,omitempty"`
	// A number indicating which buttons are pressed on the mouse when a mouse event is triggered. Left=1, Right=2, Middle=4, Back=8, Forward=16, None=0.
	Buttons int `json:"buttons,omitempty"`
	// Number of times the mouse button was clicked (default: 0).
	ClickCount int `json:"clickCount,omitempty"`
	// X delta in CSS pixels for mouse wheel event (default: 0).
	DeltaX float64 `json:"deltaX,omitempty"`
	// Y delta in CSS pixels for mouse wheel event (default: 0).
	DeltaY float64 `json:"deltaY,omitempty"`
	// Pointer type (default: "mouse").
	PointerType string `json:"pointerType,omitempty"`
}

type InputDispatchTouchEventParams

type InputDispatchTouchEventParams struct {
	// Type of the touch event. TouchEnd and TouchCancel must not contain any touch points, while TouchStart and TouchMove must contains at least one.
	TheType string `json:"type"`
	// Active touch points on the touch device. One event per any changed point (compared to previous touch event in a sequence) is generated, emulating pressing/moving/releasing points one by one.
	TouchPoints []*InputTouchPoint `json:"touchPoints"`
	// Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
	Modifiers int `json:"modifiers,omitempty"`
	// Time at which the event occurred.
	Timestamp float64 `json:"timestamp,omitempty"`
}

type InputEmulateTouchFromMouseEventParams

type InputEmulateTouchFromMouseEventParams struct {
	// Type of the mouse event.
	TheType string `json:"type"`
	// X coordinate of the mouse pointer in DIP.
	X int `json:"x"`
	// Y coordinate of the mouse pointer in DIP.
	Y int `json:"y"`
	// Mouse button. Only "none", "left", "right" are supported. enum values: none, left, middle, right, back, forward
	Button string `json:"button"`
	// Time at which the event occurred (default: current time).
	Timestamp float64 `json:"timestamp,omitempty"`
	// X delta in DIP for mouse wheel event (default: 0).
	DeltaX float64 `json:"deltaX,omitempty"`
	// Y delta in DIP for mouse wheel event (default: 0).
	DeltaY float64 `json:"deltaY,omitempty"`
	// Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
	Modifiers int `json:"modifiers,omitempty"`
	// Number of times the mouse button was clicked (default: 0).
	ClickCount int `json:"clickCount,omitempty"`
}

type InputInsertTextParams

type InputInsertTextParams struct {
	// The text to insert.
	Text string `json:"text"`
}

type InputSetIgnoreInputEventsParams

type InputSetIgnoreInputEventsParams struct {
	// Ignores input events processing when set to true.
	Ignore bool `json:"ignore"`
}

type InputSynthesizePinchGestureParams

type InputSynthesizePinchGestureParams struct {
	// X coordinate of the start of the gesture in CSS pixels.
	X float64 `json:"x"`
	// Y coordinate of the start of the gesture in CSS pixels.
	Y float64 `json:"y"`
	// Relative scale factor after zooming (>1.0 zooms in, <1.0 zooms out).
	ScaleFactor float64 `json:"scaleFactor"`
	// Relative pointer speed in pixels per second (default: 800).
	RelativeSpeed int `json:"relativeSpeed,omitempty"`
	// Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type). enum values: default, touch, mouse
	GestureSourceType string `json:"gestureSourceType,omitempty"`
}

type InputSynthesizeScrollGestureParams

type InputSynthesizeScrollGestureParams struct {
	// X coordinate of the start of the gesture in CSS pixels.
	X float64 `json:"x"`
	// Y coordinate of the start of the gesture in CSS pixels.
	Y float64 `json:"y"`
	// The distance to scroll along the X axis (positive to scroll left).
	XDistance float64 `json:"xDistance,omitempty"`
	// The distance to scroll along the Y axis (positive to scroll up).
	YDistance float64 `json:"yDistance,omitempty"`
	// The number of additional pixels to scroll back along the X axis, in addition to the given distance.
	XOverscroll float64 `json:"xOverscroll,omitempty"`
	// The number of additional pixels to scroll back along the Y axis, in addition to the given distance.
	YOverscroll float64 `json:"yOverscroll,omitempty"`
	// Prevent fling (default: true).
	PreventFling bool `json:"preventFling,omitempty"`
	// Swipe speed in pixels per second (default: 800).
	Speed int `json:"speed,omitempty"`
	// Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type). enum values: default, touch, mouse
	GestureSourceType string `json:"gestureSourceType,omitempty"`
	// The number of times to repeat the gesture (default: 0).
	RepeatCount int `json:"repeatCount,omitempty"`
	// The number of milliseconds delay between each repeat. (default: 250).
	RepeatDelayMs int `json:"repeatDelayMs,omitempty"`
	// The name of the interaction markers to generate, if not empty (default: "").
	InteractionMarkerName string `json:"interactionMarkerName,omitempty"`
}

type InputSynthesizeTapGestureParams

type InputSynthesizeTapGestureParams struct {
	// X coordinate of the start of the gesture in CSS pixels.
	X float64 `json:"x"`
	// Y coordinate of the start of the gesture in CSS pixels.
	Y float64 `json:"y"`
	// Duration between touchdown and touchup events in ms (default: 50).
	Duration int `json:"duration,omitempty"`
	// Number of times to perform the tap (e.g. 2 for double tap, default: 1).
	TapCount int `json:"tapCount,omitempty"`
	// Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type). enum values: default, touch, mouse
	GestureSourceType string `json:"gestureSourceType,omitempty"`
}

type InputTouchPoint

type InputTouchPoint struct {
	X             float64 `json:"x"`                       // X coordinate of the event relative to the main frame's viewport in CSS pixels.
	Y             float64 `json:"y"`                       // Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport.
	RadiusX       float64 `json:"radiusX,omitempty"`       // X radius of the touch area (default: 1.0).
	RadiusY       float64 `json:"radiusY,omitempty"`       // Y radius of the touch area (default: 1.0).
	RotationAngle float64 `json:"rotationAngle,omitempty"` // Rotation angle (default: 0.0).
	Force         float64 `json:"force,omitempty"`         // Force (default: 1.0).
	Id            float64 `json:"id,omitempty"`            // Identifier used to track touch sources between events, must be unique within an event.
}

No Description.

type Inspector

type Inspector struct {
	// contains filtered or unexported fields
}

func NewInspector

func NewInspector(target gcdmessage.ChromeTargeter) *Inspector

func (*Inspector) Disable

func (c *Inspector) Disable() (*gcdmessage.ChromeResponse, error)

Disables inspector domain notifications.

func (*Inspector) Enable

func (c *Inspector) Enable() (*gcdmessage.ChromeResponse, error)

Enables inspector domain notifications.

type InspectorDetachedEvent

type InspectorDetachedEvent struct {
	Method string `json:"method"`
	Params struct {
		Reason string `json:"reason"` // The reason why connection has been terminated.
	} `json:"Params,omitempty"`
}

Fired when remote debugging connection is about to be terminated. Contains detach reason.

type LayerTree

type LayerTree struct {
	// contains filtered or unexported fields
}

func NewLayerTree

func NewLayerTree(target gcdmessage.ChromeTargeter) *LayerTree

func (*LayerTree) CompositingReasons

func (c *LayerTree) CompositingReasons(layerId string) ([]string, []string, error)

CompositingReasons - Provides the reasons why the given layer was composited. layerId - The id of the layer for which we want to get the reasons it was composited. Returns - compositingReasons - A list of strings specifying reasons for the given layer to become composited. compositingReasonIds - A list of strings specifying reason IDs for the given layer to become composited.

func (*LayerTree) CompositingReasonsWithParams

func (c *LayerTree) CompositingReasonsWithParams(v *LayerTreeCompositingReasonsParams) ([]string, []string, error)

CompositingReasonsWithParams - Provides the reasons why the given layer was composited. Returns - compositingReasons - A list of strings specifying reasons for the given layer to become composited. compositingReasonIds - A list of strings specifying reason IDs for the given layer to become composited.

func (*LayerTree) Disable

func (c *LayerTree) Disable() (*gcdmessage.ChromeResponse, error)

Disables compositing tree inspection.

func (*LayerTree) Enable

func (c *LayerTree) Enable() (*gcdmessage.ChromeResponse, error)

Enables compositing tree inspection.

func (*LayerTree) LoadSnapshot

func (c *LayerTree) LoadSnapshot(tiles []*LayerTreePictureTile) (string, error)

LoadSnapshot - Returns the snapshot identifier. tiles - An array of tiles composing the snapshot. Returns - snapshotId - The id of the snapshot.

func (*LayerTree) LoadSnapshotWithParams

func (c *LayerTree) LoadSnapshotWithParams(v *LayerTreeLoadSnapshotParams) (string, error)

LoadSnapshotWithParams - Returns the snapshot identifier. Returns - snapshotId - The id of the snapshot.

func (*LayerTree) MakeSnapshot

func (c *LayerTree) MakeSnapshot(layerId string) (string, error)

MakeSnapshot - Returns the layer snapshot identifier. layerId - The id of the layer. Returns - snapshotId - The id of the layer snapshot.

func (*LayerTree) MakeSnapshotWithParams

func (c *LayerTree) MakeSnapshotWithParams(v *LayerTreeMakeSnapshotParams) (string, error)

MakeSnapshotWithParams - Returns the layer snapshot identifier. Returns - snapshotId - The id of the layer snapshot.

func (*LayerTree) ProfileSnapshot

func (c *LayerTree) ProfileSnapshot(snapshotId string, minRepeatCount int, minDuration float64, clipRect *DOMRect) ([]float64, error)

ProfileSnapshot - snapshotId - The id of the layer snapshot. minRepeatCount - The maximum number of times to replay the snapshot (1, if not specified). minDuration - The minimum duration (in seconds) to replay the snapshot. clipRect - The clip rectangle to apply when replaying the snapshot. Returns - timings - The array of paint profiles, one per run.

func (*LayerTree) ProfileSnapshotWithParams

func (c *LayerTree) ProfileSnapshotWithParams(v *LayerTreeProfileSnapshotParams) ([]float64, error)

ProfileSnapshotWithParams - Returns - timings - The array of paint profiles, one per run.

func (*LayerTree) ReleaseSnapshot

func (c *LayerTree) ReleaseSnapshot(snapshotId string) (*gcdmessage.ChromeResponse, error)

ReleaseSnapshot - Releases layer snapshot captured by the back-end. snapshotId - The id of the layer snapshot.

func (*LayerTree) ReleaseSnapshotWithParams

func (c *LayerTree) ReleaseSnapshotWithParams(v *LayerTreeReleaseSnapshotParams) (*gcdmessage.ChromeResponse, error)

ReleaseSnapshotWithParams - Releases layer snapshot captured by the back-end.

func (*LayerTree) ReplaySnapshot

func (c *LayerTree) ReplaySnapshot(snapshotId string, fromStep int, toStep int, scale float64) (string, error)

ReplaySnapshot - Replays the layer snapshot and returns the resulting bitmap. snapshotId - The id of the layer snapshot. fromStep - The first step to replay from (replay from the very start if not specified). toStep - The last step to replay to (replay till the end if not specified). scale - The scale to apply while replaying (defaults to 1). Returns - dataURL - A data: URL for resulting image.

func (*LayerTree) ReplaySnapshotWithParams

func (c *LayerTree) ReplaySnapshotWithParams(v *LayerTreeReplaySnapshotParams) (string, error)

ReplaySnapshotWithParams - Replays the layer snapshot and returns the resulting bitmap. Returns - dataURL - A data: URL for resulting image.

func (*LayerTree) SnapshotCommandLog

func (c *LayerTree) SnapshotCommandLog(snapshotId string) error

SnapshotCommandLog - Replays the layer snapshot and returns canvas log. snapshotId - The id of the layer snapshot. Returns -

func (*LayerTree) SnapshotCommandLogWithParams

func (c *LayerTree) SnapshotCommandLogWithParams(v *LayerTreeSnapshotCommandLogParams) error

SnapshotCommandLogWithParams - Replays the layer snapshot and returns canvas log. Returns -

type LayerTreeCompositingReasonsParams

type LayerTreeCompositingReasonsParams struct {
	// The id of the layer for which we want to get the reasons it was composited.
	LayerId string `json:"layerId"`
}

type LayerTreeLayer

type LayerTreeLayer struct {
	LayerId                  string                             `json:"layerId"`                            // The unique id for this layer.
	ParentLayerId            string                             `json:"parentLayerId,omitempty"`            // The id of parent (not present for root).
	BackendNodeId            int                                `json:"backendNodeId,omitempty"`            // The backend id for the node associated with this layer.
	OffsetX                  float64                            `json:"offsetX"`                            // Offset from parent layer, X coordinate.
	OffsetY                  float64                            `json:"offsetY"`                            // Offset from parent layer, Y coordinate.
	Width                    float64                            `json:"width"`                              // Layer width.
	Height                   float64                            `json:"height"`                             // Layer height.
	Transform                []float64                          `json:"transform,omitempty"`                // Transformation matrix for layer, default is identity matrix
	AnchorX                  float64                            `json:"anchorX,omitempty"`                  // Transform anchor point X, absent if no transform specified
	AnchorY                  float64                            `json:"anchorY,omitempty"`                  // Transform anchor point Y, absent if no transform specified
	AnchorZ                  float64                            `json:"anchorZ,omitempty"`                  // Transform anchor point Z, absent if no transform specified
	PaintCount               int                                `json:"paintCount"`                         // Indicates how many time this layer has painted.
	DrawsContent             bool                               `json:"drawsContent"`                       // Indicates whether this layer hosts any content, rather than being used for transform/scrolling purposes only.
	Invisible                bool                               `json:"invisible,omitempty"`                // Set if layer is not visible.
	ScrollRects              []*LayerTreeScrollRect             `json:"scrollRects,omitempty"`              // Rectangles scrolling on main thread only.
	StickyPositionConstraint *LayerTreeStickyPositionConstraint `json:"stickyPositionConstraint,omitempty"` // Sticky position constraint information
}

Information about a compositing layer.

type LayerTreeLayerPaintedEvent

type LayerTreeLayerPaintedEvent struct {
	Method string `json:"method"`
	Params struct {
		LayerId string   `json:"layerId"` // The id of the painted layer.
		Clip    *DOMRect `json:"clip"`    // Clip rectangle.
	} `json:"Params,omitempty"`
}

type LayerTreeLayerTreeDidChangeEvent

type LayerTreeLayerTreeDidChangeEvent struct {
	Method string `json:"method"`
	Params struct {
		Layers []*LayerTreeLayer `json:"layers,omitempty"` // Layer tree, absent if not in the comspositing mode.
	} `json:"Params,omitempty"`
}

type LayerTreeLoadSnapshotParams

type LayerTreeLoadSnapshotParams struct {
	// An array of tiles composing the snapshot.
	Tiles []*LayerTreePictureTile `json:"tiles"`
}

type LayerTreeMakeSnapshotParams

type LayerTreeMakeSnapshotParams struct {
	// The id of the layer.
	LayerId string `json:"layerId"`
}

type LayerTreePictureTile

type LayerTreePictureTile struct {
	X       float64 `json:"x"`       // Offset from owning layer left boundary
	Y       float64 `json:"y"`       // Offset from owning layer top boundary
	Picture string  `json:"picture"` // Base64-encoded snapshot data.
}

Serialized fragment of layer picture along with its offset within the layer.

type LayerTreeProfileSnapshotParams

type LayerTreeProfileSnapshotParams struct {
	// The id of the layer snapshot.
	SnapshotId string `json:"snapshotId"`
	// The maximum number of times to replay the snapshot (1, if not specified).
	MinRepeatCount int `json:"minRepeatCount,omitempty"`
	// The minimum duration (in seconds) to replay the snapshot.
	MinDuration float64 `json:"minDuration,omitempty"`
	// The clip rectangle to apply when replaying the snapshot.
	ClipRect *DOMRect `json:"clipRect,omitempty"`
}

type LayerTreeReleaseSnapshotParams

type LayerTreeReleaseSnapshotParams struct {
	// The id of the layer snapshot.
	SnapshotId string `json:"snapshotId"`
}

type LayerTreeReplaySnapshotParams

type LayerTreeReplaySnapshotParams struct {
	// The id of the layer snapshot.
	SnapshotId string `json:"snapshotId"`
	// The first step to replay from (replay from the very start if not specified).
	FromStep int `json:"fromStep,omitempty"`
	// The last step to replay to (replay till the end if not specified).
	ToStep int `json:"toStep,omitempty"`
	// The scale to apply while replaying (defaults to 1).
	Scale float64 `json:"scale,omitempty"`
}

type LayerTreeScrollRect

type LayerTreeScrollRect struct {
	Rect *DOMRect `json:"rect"` // Rectangle itself.
	Type string   `json:"type"` // Reason for rectangle to force scrolling on the main thread
}

Rectangle where scrolling happens on the main thread.

type LayerTreeSnapshotCommandLogParams

type LayerTreeSnapshotCommandLogParams struct {
	// The id of the layer snapshot.
	SnapshotId string `json:"snapshotId"`
}

type LayerTreeStickyPositionConstraint

type LayerTreeStickyPositionConstraint struct {
	StickyBoxRect                       *DOMRect `json:"stickyBoxRect"`                                 // Layout rectangle of the sticky element before being shifted
	ContainingBlockRect                 *DOMRect `json:"containingBlockRect"`                           // Layout rectangle of the containing block of the sticky element
	NearestLayerShiftingStickyBox       string   `json:"nearestLayerShiftingStickyBox,omitempty"`       // The nearest sticky layer that shifts the sticky box
	NearestLayerShiftingContainingBlock string   `json:"nearestLayerShiftingContainingBlock,omitempty"` // The nearest sticky layer that shifts the containing block
}

Sticky position constraints.

type Log

type Log struct {
	// contains filtered or unexported fields
}

func NewLog

func NewLog(target gcdmessage.ChromeTargeter) *Log

func (*Log) Clear

func (c *Log) Clear() (*gcdmessage.ChromeResponse, error)

Clears the log.

func (*Log) Disable

func (c *Log) Disable() (*gcdmessage.ChromeResponse, error)

Disables log domain, prevents further log entries from being reported to the client.

func (*Log) Enable

func (c *Log) Enable() (*gcdmessage.ChromeResponse, error)

Enables log domain, sends the entries collected so far to the client by means of the `entryAdded` notification.

func (*Log) StartViolationsReport

func (c *Log) StartViolationsReport(config []*LogViolationSetting) (*gcdmessage.ChromeResponse, error)

StartViolationsReport - start violation reporting. config - Configuration for violations.

func (*Log) StartViolationsReportWithParams

func (c *Log) StartViolationsReportWithParams(v *LogStartViolationsReportParams) (*gcdmessage.ChromeResponse, error)

StartViolationsReportWithParams - start violation reporting.

func (*Log) StopViolationsReport

func (c *Log) StopViolationsReport() (*gcdmessage.ChromeResponse, error)

Stop violation reporting.

type LogEntryAddedEvent

type LogEntryAddedEvent struct {
	Method string `json:"method"`
	Params struct {
		Entry *LogLogEntry `json:"entry"` // The entry.
	} `json:"Params,omitempty"`
}

Issued when new message was logged.

type LogLogEntry

type LogLogEntry struct {
	Source           string                 `json:"source"`                     // Log entry source.
	Level            string                 `json:"level"`                      // Log entry severity.
	Text             string                 `json:"text"`                       // Logged text.
	Timestamp        float64                `json:"timestamp"`                  // Timestamp when this entry was added.
	Url              string                 `json:"url,omitempty"`              // URL of the resource if known.
	LineNumber       int                    `json:"lineNumber,omitempty"`       // Line number in the resource.
	StackTrace       *RuntimeStackTrace     `json:"stackTrace,omitempty"`       // JavaScript stack trace.
	NetworkRequestId string                 `json:"networkRequestId,omitempty"` // Identifier of the network request associated with this entry.
	WorkerId         string                 `json:"workerId,omitempty"`         // Identifier of the worker associated with this entry.
	Args             []*RuntimeRemoteObject `json:"args,omitempty"`             // Call arguments.
}

Log entry.

type LogStartViolationsReportParams

type LogStartViolationsReportParams struct {
	// Configuration for violations.
	Config []*LogViolationSetting `json:"config"`
}

type LogViolationSetting

type LogViolationSetting struct {
	Name      string  `json:"name"`      // Violation type.
	Threshold float64 `json:"threshold"` // Time threshold to trigger upon.
}

Violation configuration setting.

type Media added in v1.0.9

type Media struct {
	// contains filtered or unexported fields
}

func NewMedia added in v1.0.9

func NewMedia(target gcdmessage.ChromeTargeter) *Media

func (*Media) Disable added in v1.0.9

func (c *Media) Disable() (*gcdmessage.ChromeResponse, error)

Disables the Media domain.

func (*Media) Enable added in v1.0.9

func (c *Media) Enable() (*gcdmessage.ChromeResponse, error)

Enables the Media domain

type MediaPlayerError added in v1.0.10

type MediaPlayerError struct {
	Type      string `json:"type"`      //
	ErrorCode string `json:"errorCode"` // When this switches to using media::Status instead of PipelineStatus we can remove "errorCode" and replace it with the fields from a Status instance. This also seems like a duplicate of the error level enum - there is a todo bug to have that level removed and use this instead. (crbug.com/1068454)
}

Corresponds to kMediaError

type MediaPlayerErrorsRaisedEvent added in v1.0.10

type MediaPlayerErrorsRaisedEvent struct {
	Method string `json:"method"`
	Params struct {
		PlayerId string              `json:"playerId"` //
		Errors   []*MediaPlayerError `json:"errors"`   //
	} `json:"Params,omitempty"`
}

Send a list of any errors that need to be delivered.

type MediaPlayerEvent added in v1.0.9

type MediaPlayerEvent struct {
	Timestamp float64 `json:"timestamp"` //
	Value     string  `json:"value"`     //
}

Corresponds to kMediaEventTriggered

type MediaPlayerEventsAddedEvent added in v1.0.9

type MediaPlayerEventsAddedEvent struct {
	Method string `json:"method"`
	Params struct {
		PlayerId string              `json:"playerId"` //
		Events   []*MediaPlayerEvent `json:"events"`   //
	} `json:"Params,omitempty"`
}

Send events as a list, allowing them to be batched on the browser for less congestion. If batched, events must ALWAYS be in chronological order.

type MediaPlayerMessage added in v1.0.10

type MediaPlayerMessage struct {
	Level   string `json:"level"`   // Keep in sync with MediaLogMessageLevel We are currently keeping the message level 'error' separate from the PlayerError type because right now they represent different things, this one being a DVLOG(ERROR) style log message that gets printed based on what log level is selected in the UI, and the other is a representation of a media::PipelineStatus object. Soon however we're going to be moving away from using PipelineStatus for errors and introducing a new error type which should hopefully let us integrate the error log level into the PlayerError type.
	Message string `json:"message"` //
}

Have one type per entry in MediaLogRecord::Type Corresponds to kMessage

type MediaPlayerMessagesLoggedEvent added in v1.0.10

type MediaPlayerMessagesLoggedEvent struct {
	Method string `json:"method"`
	Params struct {
		PlayerId string                `json:"playerId"` //
		Messages []*MediaPlayerMessage `json:"messages"` //
	} `json:"Params,omitempty"`
}

Send a list of any messages that need to be delivered.

type MediaPlayerPropertiesChangedEvent added in v1.0.9

type MediaPlayerPropertiesChangedEvent struct {
	Method string `json:"method"`
	Params struct {
		PlayerId   string                 `json:"playerId"`   //
		Properties []*MediaPlayerProperty `json:"properties"` //
	} `json:"Params,omitempty"`
}

This can be called multiple times, and can be used to set / override / remove player properties. A null propValue indicates removal.

type MediaPlayerProperty added in v1.0.9

type MediaPlayerProperty struct {
	Name  string `json:"name"`  //
	Value string `json:"value"` //
}

Corresponds to kMediaPropertyChange

type MediaPlayersCreatedEvent added in v1.0.9

type MediaPlayersCreatedEvent struct {
	Method string `json:"method"`
	Params struct {
		Players []string `json:"players"` //
	} `json:"Params,omitempty"`
}

Called whenever a player is created, or when a new agent joins and recieves a list of active players. If an agent is restored, it will recieve the full list of player ids and all events again.

type Memory

type Memory struct {
	// contains filtered or unexported fields
}

func NewMemory

func NewMemory(target gcdmessage.ChromeTargeter) *Memory

func (*Memory) ForciblyPurgeJavaScriptMemory added in v1.0.3

func (c *Memory) ForciblyPurgeJavaScriptMemory() (*gcdmessage.ChromeResponse, error)

Simulate OomIntervention by purging V8 memory.

func (*Memory) GetAllTimeSamplingProfile

func (c *Memory) GetAllTimeSamplingProfile() (*MemorySamplingProfile, error)

GetAllTimeSamplingProfile - Retrieve native memory allocations profile collected since renderer process startup. Returns - profile -

func (*Memory) GetBrowserSamplingProfile

func (c *Memory) GetBrowserSamplingProfile() (*MemorySamplingProfile, error)

GetBrowserSamplingProfile - Retrieve native memory allocations profile collected since browser process startup. Returns - profile -

func (*Memory) GetDOMCounters

func (c *Memory) GetDOMCounters() (int, int, int, error)

GetDOMCounters - Returns - documents - nodes - jsEventListeners -

func (*Memory) GetSamplingProfile

func (c *Memory) GetSamplingProfile() (*MemorySamplingProfile, error)

GetSamplingProfile - Retrieve native memory allocations profile collected since last `startSampling` call. Returns - profile -

func (*Memory) PrepareForLeakDetection

func (c *Memory) PrepareForLeakDetection() (*gcdmessage.ChromeResponse, error)

func (*Memory) SetPressureNotificationsSuppressed

func (c *Memory) SetPressureNotificationsSuppressed(suppressed bool) (*gcdmessage.ChromeResponse, error)

SetPressureNotificationsSuppressed - Enable/disable suppressing memory pressure notifications in all processes. suppressed - If true, memory pressure notifications will be suppressed.

func (*Memory) SetPressureNotificationsSuppressedWithParams

func (c *Memory) SetPressureNotificationsSuppressedWithParams(v *MemorySetPressureNotificationsSuppressedParams) (*gcdmessage.ChromeResponse, error)

SetPressureNotificationsSuppressedWithParams - Enable/disable suppressing memory pressure notifications in all processes.

func (*Memory) SimulatePressureNotification

func (c *Memory) SimulatePressureNotification(level string) (*gcdmessage.ChromeResponse, error)

SimulatePressureNotification - Simulate a memory pressure notification in all processes. level - Memory pressure level of the notification. enum values: moderate, critical

func (*Memory) SimulatePressureNotificationWithParams

func (c *Memory) SimulatePressureNotificationWithParams(v *MemorySimulatePressureNotificationParams) (*gcdmessage.ChromeResponse, error)

SimulatePressureNotificationWithParams - Simulate a memory pressure notification in all processes.

func (*Memory) StartSampling

func (c *Memory) StartSampling(samplingInterval int, suppressRandomness bool) (*gcdmessage.ChromeResponse, error)

StartSampling - Start collecting native memory profile. samplingInterval - Average number of bytes between samples. suppressRandomness - Do not randomize intervals between samples.

func (*Memory) StartSamplingWithParams

func (c *Memory) StartSamplingWithParams(v *MemoryStartSamplingParams) (*gcdmessage.ChromeResponse, error)

StartSamplingWithParams - Start collecting native memory profile.

func (*Memory) StopSampling

func (c *Memory) StopSampling() (*gcdmessage.ChromeResponse, error)

Stop collecting native memory profile.

type MemoryModule

type MemoryModule struct {
	Name        string  `json:"name"`        // Name of the module.
	Uuid        string  `json:"uuid"`        // UUID of the module.
	BaseAddress string  `json:"baseAddress"` // Base address where the module is loaded into memory. Encoded as a decimal or hexadecimal (0x prefixed) string.
	Size        float64 `json:"size"`        // Size of the module in bytes.
}

Executable module information

type MemorySamplingProfile

type MemorySamplingProfile struct {
	Samples []*MemorySamplingProfileNode `json:"samples"` //
	Modules []*MemoryModule              `json:"modules"` //
}

Array of heap profile samples.

type MemorySamplingProfileNode

type MemorySamplingProfileNode struct {
	Size  float64  `json:"size"`  // Size of the sampled allocation.
	Total float64  `json:"total"` // Total bytes attributed to this sample.
	Stack []string `json:"stack"` // Execution stack at the point of allocation.
}

Heap profile sample.

type MemorySetPressureNotificationsSuppressedParams

type MemorySetPressureNotificationsSuppressedParams struct {
	// If true, memory pressure notifications will be suppressed.
	Suppressed bool `json:"suppressed"`
}

type MemorySimulatePressureNotificationParams

type MemorySimulatePressureNotificationParams struct {
	// Memory pressure level of the notification. enum values: moderate, critical
	Level string `json:"level"`
}

type MemoryStartSamplingParams

type MemoryStartSamplingParams struct {
	// Average number of bytes between samples.
	SamplingInterval int `json:"samplingInterval,omitempty"`
	// Do not randomize intervals between samples.
	SuppressRandomness bool `json:"suppressRandomness,omitempty"`
}

type Network

type Network struct {
	// contains filtered or unexported fields
}

func NewNetwork

func NewNetwork(target gcdmessage.ChromeTargeter) *Network

func (*Network) CanClearBrowserCache

func (c *Network) CanClearBrowserCache() (bool, error)

CanClearBrowserCache - Tells whether clearing browser cache is supported. Returns - result - True if browser cache can be cleared.

func (*Network) CanClearBrowserCookies

func (c *Network) CanClearBrowserCookies() (bool, error)

CanClearBrowserCookies - Tells whether clearing browser cookies is supported. Returns - result - True if browser cookies can be cleared.

func (*Network) CanEmulateNetworkConditions

func (c *Network) CanEmulateNetworkConditions() (bool, error)

CanEmulateNetworkConditions - Tells whether emulation of network conditions is supported. Returns - result - True if emulation of network conditions is supported.

func (*Network) ClearBrowserCache

func (c *Network) ClearBrowserCache() (*gcdmessage.ChromeResponse, error)

Clears browser cache.

func (*Network) ClearBrowserCookies

func (c *Network) ClearBrowserCookies() (*gcdmessage.ChromeResponse, error)

Clears browser cookies.

func (*Network) ContinueInterceptedRequest

func (c *Network) ContinueInterceptedRequest(interceptionId string, errorReason string, rawResponse string, url string, method string, postData string, headers map[string]interface{}, authChallengeResponse *NetworkAuthChallengeResponse) (*gcdmessage.ChromeResponse, error)

ContinueInterceptedRequest - Response to Network.requestIntercepted which either modifies the request to continue with any modifications, or blocks it, or completes it with the provided response bytes. If a network fetch occurs as a result which encounters a redirect an additional Network.requestIntercepted event will be sent with the same InterceptionId. Deprecated, use Fetch.continueRequest, Fetch.fulfillRequest and Fetch.failRequest instead. interceptionId - errorReason - If set this causes the request to fail with the given reason. Passing `Aborted` for requests marked with `isNavigationRequest` also cancels the navigation. Must not be set in response to an authChallenge. enum values: Failed, Aborted, TimedOut, AccessDenied, ConnectionClosed, ConnectionReset, ConnectionRefused, ConnectionAborted, ConnectionFailed, NameNotResolved, InternetDisconnected, AddressUnreachable, BlockedByClient, BlockedByResponse rawResponse - If set the requests completes using with the provided base64 encoded raw response, including HTTP status line and headers etc... Must not be set in response to an authChallenge. url - If set the request url will be modified in a way that's not observable by page. Must not be set in response to an authChallenge. method - If set this allows the request method to be overridden. Must not be set in response to an authChallenge. postData - If set this allows postData to be set. Must not be set in response to an authChallenge. headers - If set this allows the request headers to be changed. Must not be set in response to an authChallenge. authChallengeResponse - Response to a requestIntercepted with an authChallenge. Must not be set otherwise.

func (*Network) ContinueInterceptedRequestWithParams

func (c *Network) ContinueInterceptedRequestWithParams(v *NetworkContinueInterceptedRequestParams) (*gcdmessage.ChromeResponse, error)

ContinueInterceptedRequestWithParams - Response to Network.requestIntercepted which either modifies the request to continue with any modifications, or blocks it, or completes it with the provided response bytes. If a network fetch occurs as a result which encounters a redirect an additional Network.requestIntercepted event will be sent with the same InterceptionId. Deprecated, use Fetch.continueRequest, Fetch.fulfillRequest and Fetch.failRequest instead.

func (*Network) DeleteCookies

func (c *Network) DeleteCookies(name string, url string, domain string, path string) (*gcdmessage.ChromeResponse, error)

DeleteCookies - Deletes browser cookies with matching name and url or domain/path pair. name - Name of the cookies to remove. url - If specified, deletes all the cookies with the given name where domain and path match provided URL. domain - If specified, deletes only cookies with the exact domain. path - If specified, deletes only cookies with the exact path.

func (*Network) DeleteCookiesWithParams

func (c *Network) DeleteCookiesWithParams(v *NetworkDeleteCookiesParams) (*gcdmessage.ChromeResponse, error)

DeleteCookiesWithParams - Deletes browser cookies with matching name and url or domain/path pair.

func (*Network) Disable

func (c *Network) Disable() (*gcdmessage.ChromeResponse, error)

Disables network tracking, prevents network events from being sent to the client.

func (*Network) EmulateNetworkConditions

func (c *Network) EmulateNetworkConditions(offline bool, latency float64, downloadThroughput float64, uploadThroughput float64, connectionType string) (*gcdmessage.ChromeResponse, error)

EmulateNetworkConditions - Activates emulation of network conditions. offline - True to emulate internet disconnection. latency - Minimum latency from request sent to response headers received (ms). downloadThroughput - Maximal aggregated download throughput (bytes/sec). -1 disables download throttling. uploadThroughput - Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling. connectionType - Connection type if known. enum values: none, cellular2g, cellular3g, cellular4g, bluetooth, ethernet, wifi, wimax, other

func (*Network) EmulateNetworkConditionsWithParams

func (c *Network) EmulateNetworkConditionsWithParams(v *NetworkEmulateNetworkConditionsParams) (*gcdmessage.ChromeResponse, error)

EmulateNetworkConditionsWithParams - Activates emulation of network conditions.

func (*Network) Enable

func (c *Network) Enable(maxTotalBufferSize int, maxResourceBufferSize int, maxPostDataSize int) (*gcdmessage.ChromeResponse, error)

Enable - Enables network tracking, network events will now be delivered to the client. maxTotalBufferSize - Buffer size in bytes to use when preserving network payloads (XHRs, etc). maxResourceBufferSize - Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc). maxPostDataSize - Longest post body size (in bytes) that would be included in requestWillBeSent notification

func (*Network) EnableWithParams

func (c *Network) EnableWithParams(v *NetworkEnableParams) (*gcdmessage.ChromeResponse, error)

EnableWithParams - Enables network tracking, network events will now be delivered to the client.

func (*Network) GetAllCookies

func (c *Network) GetAllCookies() ([]*NetworkCookie, error)

GetAllCookies - Returns all browser cookies. Depending on the backend support, will return detailed cookie information in the `cookies` field. Returns - cookies - Array of cookie objects.

func (*Network) GetCertificate

func (c *Network) GetCertificate(origin string) ([]string, error)

GetCertificate - Returns the DER-encoded certificate. origin - Origin to get certificate for. Returns - tableNames -

func (*Network) GetCertificateWithParams

func (c *Network) GetCertificateWithParams(v *NetworkGetCertificateParams) ([]string, error)

GetCertificateWithParams - Returns the DER-encoded certificate. Returns - tableNames -

func (*Network) GetCookies

func (c *Network) GetCookies(urls []string) ([]*NetworkCookie, error)

GetCookies - Returns all browser cookies for the current URL. Depending on the backend support, will return detailed cookie information in the `cookies` field. urls - The list of URLs for which applicable cookies will be fetched Returns - cookies - Array of cookie objects.

func (*Network) GetCookiesWithParams

func (c *Network) GetCookiesWithParams(v *NetworkGetCookiesParams) ([]*NetworkCookie, error)

GetCookiesWithParams - Returns all browser cookies for the current URL. Depending on the backend support, will return detailed cookie information in the `cookies` field. Returns - cookies - Array of cookie objects.

func (*Network) GetRequestPostData

func (c *Network) GetRequestPostData(requestId string) (string, error)

GetRequestPostData - Returns post data sent with the request. Returns an error when no data was sent with the request. requestId - Identifier of the network request to get content for. Returns - postData - Request body string, omitting files from multipart requests

func (*Network) GetRequestPostDataWithParams

func (c *Network) GetRequestPostDataWithParams(v *NetworkGetRequestPostDataParams) (string, error)

GetRequestPostDataWithParams - Returns post data sent with the request. Returns an error when no data was sent with the request. Returns - postData - Request body string, omitting files from multipart requests

func (*Network) GetResponseBody

func (c *Network) GetResponseBody(requestId string) (string, bool, error)

GetResponseBody - Returns content served for the given request. requestId - Identifier of the network request to get content for. Returns - body - Response body. base64Encoded - True, if content was sent as base64.

func (*Network) GetResponseBodyForInterception

func (c *Network) GetResponseBodyForInterception(interceptionId string) (string, bool, error)

GetResponseBodyForInterception - Returns content served for the given currently intercepted request. interceptionId - Identifier for the intercepted request to get body for. Returns - body - Response body. base64Encoded - True, if content was sent as base64.

func (*Network) GetResponseBodyForInterceptionWithParams

func (c *Network) GetResponseBodyForInterceptionWithParams(v *NetworkGetResponseBodyForInterceptionParams) (string, bool, error)

GetResponseBodyForInterceptionWithParams - Returns content served for the given currently intercepted request. Returns - body - Response body. base64Encoded - True, if content was sent as base64.

func (*Network) GetResponseBodyWithParams

func (c *Network) GetResponseBodyWithParams(v *NetworkGetResponseBodyParams) (string, bool, error)

GetResponseBodyWithParams - Returns content served for the given request. Returns - body - Response body. base64Encoded - True, if content was sent as base64.

func (*Network) ReplayXHR

func (c *Network) ReplayXHR(requestId string) (*gcdmessage.ChromeResponse, error)

ReplayXHR - This method sends a new XMLHttpRequest which is identical to the original one. The following parameters should be identical: method, url, async, request body, extra headers, withCredentials attribute, user, password. requestId - Identifier of XHR to replay.

func (*Network) ReplayXHRWithParams

func (c *Network) ReplayXHRWithParams(v *NetworkReplayXHRParams) (*gcdmessage.ChromeResponse, error)

ReplayXHRWithParams - This method sends a new XMLHttpRequest which is identical to the original one. The following parameters should be identical: method, url, async, request body, extra headers, withCredentials attribute, user, password.

func (*Network) SearchInResponseBody

func (c *Network) SearchInResponseBody(requestId string, query string, caseSensitive bool, isRegex bool) ([]*DebuggerSearchMatch, error)

SearchInResponseBody - Searches for given string in response content. requestId - Identifier of the network response to search. query - String to search for. caseSensitive - If true, search is case sensitive. isRegex - If true, treats string parameter as regex. Returns - result - List of search matches.

func (*Network) SearchInResponseBodyWithParams

func (c *Network) SearchInResponseBodyWithParams(v *NetworkSearchInResponseBodyParams) ([]*DebuggerSearchMatch, error)

SearchInResponseBodyWithParams - Searches for given string in response content. Returns - result - List of search matches.

func (*Network) SetBlockedURLs

func (c *Network) SetBlockedURLs(urls []string) (*gcdmessage.ChromeResponse, error)

SetBlockedURLs - Blocks URLs from loading. urls - URL patterns to block. Wildcards ('*') are allowed.

func (*Network) SetBlockedURLsWithParams

func (c *Network) SetBlockedURLsWithParams(v *NetworkSetBlockedURLsParams) (*gcdmessage.ChromeResponse, error)

SetBlockedURLsWithParams - Blocks URLs from loading.

func (*Network) SetBypassServiceWorker

func (c *Network) SetBypassServiceWorker(bypass bool) (*gcdmessage.ChromeResponse, error)

SetBypassServiceWorker - Toggles ignoring of service worker for each request. bypass - Bypass service worker and load from network.

func (*Network) SetBypassServiceWorkerWithParams

func (c *Network) SetBypassServiceWorkerWithParams(v *NetworkSetBypassServiceWorkerParams) (*gcdmessage.ChromeResponse, error)

SetBypassServiceWorkerWithParams - Toggles ignoring of service worker for each request.

func (*Network) SetCacheDisabled

func (c *Network) SetCacheDisabled(cacheDisabled bool) (*gcdmessage.ChromeResponse, error)

SetCacheDisabled - Toggles ignoring cache for each request. If `true`, cache will not be used. cacheDisabled - Cache disabled state.

func (*Network) SetCacheDisabledWithParams

func (c *Network) SetCacheDisabledWithParams(v *NetworkSetCacheDisabledParams) (*gcdmessage.ChromeResponse, error)

SetCacheDisabledWithParams - Toggles ignoring cache for each request. If `true`, cache will not be used.

func (*Network) SetCookie

func (c *Network) SetCookie(name string, value string, url string, domain string, path string, secure bool, httpOnly bool, sameSite string, expires float64, priority string) (bool, error)

SetCookie - Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist. name - Cookie name. value - Cookie value. url - The request-URI to associate with the setting of the cookie. This value can affect the default domain and path values of the created cookie. domain - Cookie domain. path - Cookie path. secure - True if cookie is secure. httpOnly - True if cookie is http-only. sameSite - Cookie SameSite type. enum values: Strict, Lax, None expires - Cookie expiration date, session cookie if not set priority - Cookie Priority type. enum values: Low, Medium, High Returns - success - True if successfully set cookie.

func (*Network) SetCookieWithParams

func (c *Network) SetCookieWithParams(v *NetworkSetCookieParams) (bool, error)

SetCookieWithParams - Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist. Returns - success - True if successfully set cookie.

func (*Network) SetCookies

func (c *Network) SetCookies(cookies []*NetworkCookieParam) (*gcdmessage.ChromeResponse, error)

SetCookies - Sets given cookies. cookies - Cookies to be set.

func (*Network) SetCookiesWithParams

func (c *Network) SetCookiesWithParams(v *NetworkSetCookiesParams) (*gcdmessage.ChromeResponse, error)

SetCookiesWithParams - Sets given cookies.

func (*Network) SetDataSizeLimitsForTest

func (c *Network) SetDataSizeLimitsForTest(maxTotalSize int, maxResourceSize int) (*gcdmessage.ChromeResponse, error)

SetDataSizeLimitsForTest - For testing. maxTotalSize - Maximum total buffer size. maxResourceSize - Maximum per-resource size.

func (*Network) SetDataSizeLimitsForTestWithParams

func (c *Network) SetDataSizeLimitsForTestWithParams(v *NetworkSetDataSizeLimitsForTestParams) (*gcdmessage.ChromeResponse, error)

SetDataSizeLimitsForTestWithParams - For testing.

func (*Network) SetExtraHTTPHeaders

func (c *Network) SetExtraHTTPHeaders(headers map[string]interface{}) (*gcdmessage.ChromeResponse, error)

SetExtraHTTPHeaders - Specifies whether to always send extra HTTP headers with the requests from this page. headers - Map with extra HTTP headers.

func (*Network) SetExtraHTTPHeadersWithParams

func (c *Network) SetExtraHTTPHeadersWithParams(v *NetworkSetExtraHTTPHeadersParams) (*gcdmessage.ChromeResponse, error)

SetExtraHTTPHeadersWithParams - Specifies whether to always send extra HTTP headers with the requests from this page.

func (*Network) SetRequestInterception

func (c *Network) SetRequestInterception(patterns []*NetworkRequestPattern) (*gcdmessage.ChromeResponse, error)

SetRequestInterception - Sets the requests to intercept that match the provided patterns and optionally resource types. Deprecated, please use Fetch.enable instead. patterns - Requests matching any of these patterns will be forwarded and wait for the corresponding continueInterceptedRequest call.

func (*Network) SetRequestInterceptionWithParams

func (c *Network) SetRequestInterceptionWithParams(v *NetworkSetRequestInterceptionParams) (*gcdmessage.ChromeResponse, error)

SetRequestInterceptionWithParams - Sets the requests to intercept that match the provided patterns and optionally resource types. Deprecated, please use Fetch.enable instead.

func (*Network) SetUserAgentOverride

func (c *Network) SetUserAgentOverride(userAgent string, acceptLanguage string, platform string, userAgentMetadata *EmulationUserAgentMetadata) (*gcdmessage.ChromeResponse, error)

SetUserAgentOverride - Allows overriding user agent with the given string. userAgent - User agent to use. acceptLanguage - Browser langugage to emulate. platform - The platform navigator.platform should return. userAgentMetadata - To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData

func (*Network) SetUserAgentOverrideWithParams

func (c *Network) SetUserAgentOverrideWithParams(v *NetworkSetUserAgentOverrideParams) (*gcdmessage.ChromeResponse, error)

SetUserAgentOverrideWithParams - Allows overriding user agent with the given string.

func (*Network) TakeResponseBodyForInterceptionAsStream

func (c *Network) TakeResponseBodyForInterceptionAsStream(interceptionId string) (string, error)

TakeResponseBodyForInterceptionAsStream - Returns a handle to the stream representing the response body. Note that after this command, the intercepted request can't be continued as is -- you either need to cancel it or to provide the response body. The stream only supports sequential read, IO.read will fail if the position is specified. interceptionId - Returns - stream -

func (*Network) TakeResponseBodyForInterceptionAsStreamWithParams

func (c *Network) TakeResponseBodyForInterceptionAsStreamWithParams(v *NetworkTakeResponseBodyForInterceptionAsStreamParams) (string, error)

TakeResponseBodyForInterceptionAsStreamWithParams - Returns a handle to the stream representing the response body. Note that after this command, the intercepted request can't be continued as is -- you either need to cancel it or to provide the response body. The stream only supports sequential read, IO.read will fail if the position is specified. Returns - stream -

type NetworkAuthChallenge

type NetworkAuthChallenge struct {
	Source string `json:"source,omitempty"` // Source of the authentication challenge.
	Origin string `json:"origin"`           // Origin of the challenger.
	Scheme string `json:"scheme"`           // The authentication scheme used, such as basic or digest
	Realm  string `json:"realm"`            // The realm of the challenge. May be empty.
}

Authorization challenge for HTTP status code 401 or 407.

type NetworkAuthChallengeResponse

type NetworkAuthChallengeResponse struct {
	Response string `json:"response"`           // The decision on what to do in response to the authorization challenge.  Default means deferring to the default behavior of the net stack, which will likely either the Cancel authentication or display a popup dialog box.
	Username string `json:"username,omitempty"` // The username to provide, possibly empty. Should only be set if response is ProvideCredentials.
	Password string `json:"password,omitempty"` // The password to provide, possibly empty. Should only be set if response is ProvideCredentials.
}

Response to an AuthChallenge.

type NetworkBlockedCookieWithReason added in v1.0.7

type NetworkBlockedCookieWithReason struct {
	BlockedReasons []string       `json:"blockedReasons"` // The reason(s) the cookie was blocked. enum values: SecureOnly, NotOnPath, DomainMismatch, SameSiteStrict, SameSiteLax, SameSiteUnspecifiedTreatedAsLax, SameSiteNoneInsecure, UserPreferences, UnknownError
	Cookie         *NetworkCookie `json:"cookie"`         // The cookie object representing the cookie which was not sent.
}

A cookie with was not sent with a request with the corresponding reason.

type NetworkBlockedSetCookieWithReason added in v1.0.7

type NetworkBlockedSetCookieWithReason struct {
	BlockedReasons []string       `json:"blockedReasons"`   // The reason(s) this cookie was blocked. enum values: SecureOnly, SameSiteStrict, SameSiteLax, SameSiteUnspecifiedTreatedAsLax, SameSiteNoneInsecure, UserPreferences, SyntaxError, SchemeNotSupported, OverwriteSecure, InvalidDomain, InvalidPrefix, UnknownError
	CookieLine     string         `json:"cookieLine"`       // The string representing this individual cookie as it would appear in the header. This is not the entire "cookie" or "set-cookie" header which could have multiple cookies.
	Cookie         *NetworkCookie `json:"cookie,omitempty"` // The cookie object which represents the cookie which was not stored. It is optional because sometimes complete cookie information is not available, such as in the case of parsing errors.
}

A cookie which was not stored from a response with the corresponding reason.

type NetworkCachedResource

type NetworkCachedResource struct {
	Url      string           `json:"url"`                // Resource URL. This is the url of the original network request.
	Type     string           `json:"type"`               // Type of this resource. enum values: Document, Stylesheet, Image, Media, Font, Script, TextTrack, XHR, Fetch, EventSource, WebSocket, Manifest, SignedExchange, Ping, CSPViolationReport, Other
	Response *NetworkResponse `json:"response,omitempty"` // Cached response data.
	BodySize float64          `json:"bodySize"`           // Cached response body size.
}

Information about the cached resource.

type NetworkContinueInterceptedRequestParams

type NetworkContinueInterceptedRequestParams struct {
	//
	InterceptionId string `json:"interceptionId"`
	// If set this causes the request to fail with the given reason. Passing `Aborted` for requests marked with `isNavigationRequest` also cancels the navigation. Must not be set in response to an authChallenge. enum values: Failed, Aborted, TimedOut, AccessDenied, ConnectionClosed, ConnectionReset, ConnectionRefused, ConnectionAborted, ConnectionFailed, NameNotResolved, InternetDisconnected, AddressUnreachable, BlockedByClient, BlockedByResponse
	ErrorReason string `json:"errorReason,omitempty"`
	// If set the requests completes using with the provided base64 encoded raw response, including HTTP status line and headers etc... Must not be set in response to an authChallenge.
	RawResponse string `json:"rawResponse,omitempty"`
	// If set the request url will be modified in a way that's not observable by page. Must not be set in response to an authChallenge.
	Url string `json:"url,omitempty"`
	// If set this allows the request method to be overridden. Must not be set in response to an authChallenge.
	Method string `json:"method,omitempty"`
	// If set this allows postData to be set. Must not be set in response to an authChallenge.
	PostData string `json:"postData,omitempty"`
	// If set this allows the request headers to be changed. Must not be set in response to an authChallenge.
	Headers map[string]interface{} `json:"headers,omitempty"`
	// Response to a requestIntercepted with an authChallenge. Must not be set otherwise.
	AuthChallengeResponse *NetworkAuthChallengeResponse `json:"authChallengeResponse,omitempty"`
}

type NetworkCookie

type NetworkCookie struct {
	Name     string  `json:"name"`               // Cookie name.
	Value    string  `json:"value"`              // Cookie value.
	Domain   string  `json:"domain"`             // Cookie domain.
	Path     string  `json:"path"`               // Cookie path.
	Expires  float64 `json:"expires"`            // Cookie expiration date as the number of seconds since the UNIX epoch.
	Size     int     `json:"size"`               // Cookie size.
	HttpOnly bool    `json:"httpOnly"`           // True if cookie is http-only.
	Secure   bool    `json:"secure"`             // True if cookie is secure.
	Session  bool    `json:"session"`            // True in case of session cookie.
	SameSite string  `json:"sameSite,omitempty"` // Cookie SameSite type. enum values: Strict, Lax, None
	Priority string  `json:"priority"`           // Cookie Priority enum values: Low, Medium, High
}

Cookie object

type NetworkCookieParam

type NetworkCookieParam struct {
	Name     string  `json:"name"`               // Cookie name.
	Value    string  `json:"value"`              // Cookie value.
	Url      string  `json:"url,omitempty"`      // The request-URI to associate with the setting of the cookie. This value can affect the default domain and path values of the created cookie.
	Domain   string  `json:"domain,omitempty"`   // Cookie domain.
	Path     string  `json:"path,omitempty"`     // Cookie path.
	Secure   bool    `json:"secure,omitempty"`   // True if cookie is secure.
	HttpOnly bool    `json:"httpOnly,omitempty"` // True if cookie is http-only.
	SameSite string  `json:"sameSite,omitempty"` // Cookie SameSite type. enum values: Strict, Lax, None
	Expires  float64 `json:"expires,omitempty"`  // Cookie expiration date, session cookie if not set
	Priority string  `json:"priority,omitempty"` // Cookie Priority. enum values: Low, Medium, High
}

Cookie parameter object

type NetworkDataReceivedEvent

type NetworkDataReceivedEvent struct {
	Method string `json:"method"`
	Params struct {
		RequestId         string  `json:"requestId"`         // Request identifier.
		Timestamp         float64 `json:"timestamp"`         // Timestamp.
		DataLength        int     `json:"dataLength"`        // Data chunk length.
		EncodedDataLength int     `json:"encodedDataLength"` // Actual bytes received (might be less than dataLength for compressed encodings).
	} `json:"Params,omitempty"`
}

Fired when data chunk was received over the network.

type NetworkDeleteCookiesParams

type NetworkDeleteCookiesParams struct {
	// Name of the cookies to remove.
	Name string `json:"name"`
	// If specified, deletes all the cookies with the given name where domain and path match provided URL.
	Url string `json:"url,omitempty"`
	// If specified, deletes only cookies with the exact domain.
	Domain string `json:"domain,omitempty"`
	// If specified, deletes only cookies with the exact path.
	Path string `json:"path,omitempty"`
}

type NetworkEmulateNetworkConditionsParams

type NetworkEmulateNetworkConditionsParams struct {
	// True to emulate internet disconnection.
	Offline bool `json:"offline"`
	// Minimum latency from request sent to response headers received (ms).
	Latency float64 `json:"latency"`
	// Maximal aggregated download throughput (bytes/sec). -1 disables download throttling.
	DownloadThroughput float64 `json:"downloadThroughput"`
	// Maximal aggregated upload throughput (bytes/sec).  -1 disables upload throttling.
	UploadThroughput float64 `json:"uploadThroughput"`
	// Connection type if known. enum values: none, cellular2g, cellular3g, cellular4g, bluetooth, ethernet, wifi, wimax, other
	ConnectionType string `json:"connectionType,omitempty"`
}

type NetworkEnableParams

type NetworkEnableParams struct {
	// Buffer size in bytes to use when preserving network payloads (XHRs, etc).
	MaxTotalBufferSize int `json:"maxTotalBufferSize,omitempty"`
	// Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc).
	MaxResourceBufferSize int `json:"maxResourceBufferSize,omitempty"`
	// Longest post body size (in bytes) that would be included in requestWillBeSent notification
	MaxPostDataSize int `json:"maxPostDataSize,omitempty"`
}

type NetworkEventSourceMessageReceivedEvent

type NetworkEventSourceMessageReceivedEvent struct {
	Method string `json:"method"`
	Params struct {
		RequestId string  `json:"requestId"` // Request identifier.
		Timestamp float64 `json:"timestamp"` // Timestamp.
		EventName string  `json:"eventName"` // Message type.
		EventId   string  `json:"eventId"`   // Message identifier.
		Data      string  `json:"data"`      // Message content.
	} `json:"Params,omitempty"`
}

Fired when EventSource message is received.

type NetworkGetCertificateParams

type NetworkGetCertificateParams struct {
	// Origin to get certificate for.
	Origin string `json:"origin"`
}

type NetworkGetCookiesParams

type NetworkGetCookiesParams struct {
	// The list of URLs for which applicable cookies will be fetched
	Urls []string `json:"urls,omitempty"`
}

type NetworkGetRequestPostDataParams

type NetworkGetRequestPostDataParams struct {
	// Identifier of the network request to get content for.
	RequestId string `json:"requestId"`
}

type NetworkGetResponseBodyForInterceptionParams

type NetworkGetResponseBodyForInterceptionParams struct {
	// Identifier for the intercepted request to get body for.
	InterceptionId string `json:"interceptionId"`
}

type NetworkGetResponseBodyParams

type NetworkGetResponseBodyParams struct {
	// Identifier of the network request to get content for.
	RequestId string `json:"requestId"`
}

type NetworkInitiator

type NetworkInitiator struct {
	Type       string             `json:"type"`                 // Type of this initiator.
	Stack      *RuntimeStackTrace `json:"stack,omitempty"`      // Initiator JavaScript stack trace, set for Script only.
	Url        string             `json:"url,omitempty"`        // Initiator URL, set for Parser type or for Script type (when script is importing module) or for SignedExchange type.
	LineNumber float64            `json:"lineNumber,omitempty"` // Initiator line number, set for Parser type or for Script type (when script is importing module) (0-based).
}

Information about the request initiator.

type NetworkLoadingFailedEvent

type NetworkLoadingFailedEvent struct {
	Method string `json:"method"`
	Params struct {
		RequestId     string  `json:"requestId"`               // Request identifier.
		Timestamp     float64 `json:"timestamp"`               // Timestamp.
		Type          string  `json:"type"`                    // Resource type. enum values: Document, Stylesheet, Image, Media, Font, Script, TextTrack, XHR, Fetch, EventSource, WebSocket, Manifest, SignedExchange, Ping, CSPViolationReport, Other
		ErrorText     string  `json:"errorText"`               // User friendly error message.
		Canceled      bool    `json:"canceled,omitempty"`      // True if loading was canceled.
		BlockedReason string  `json:"blockedReason,omitempty"` // The reason why loading was blocked, if any. enum values: other, csp, mixed-content, origin, inspector, subresource-filter, content-type, collapsed-by-client, coep-frame-resource-needs-coep-header, coop-sandboxed-iframe-cannot-navigate-to-coop-page, corp-not-same-origin, corp-not-same-origin-after-defaulted-to-same-origin-by-coep, corp-not-same-site
	} `json:"Params,omitempty"`
}

Fired when HTTP request has failed to load.

type NetworkLoadingFinishedEvent

type NetworkLoadingFinishedEvent struct {
	Method string `json:"method"`
	Params struct {
		RequestId                string  `json:"requestId"`                          // Request identifier.
		Timestamp                float64 `json:"timestamp"`                          // Timestamp.
		EncodedDataLength        float64 `json:"encodedDataLength"`                  // Total number of bytes received for this request.
		ShouldReportCorbBlocking bool    `json:"shouldReportCorbBlocking,omitempty"` // Set when 1) response was blocked by Cross-Origin Read Blocking and also 2) this needs to be reported to the DevTools console.
	} `json:"Params,omitempty"`
}

Fired when HTTP request has finished loading.

type NetworkReplayXHRParams

type NetworkReplayXHRParams struct {
	// Identifier of XHR to replay.
	RequestId string `json:"requestId"`
}

type NetworkRequest

type NetworkRequest struct {
	Url              string                 `json:"url"`                        // Request URL (without fragment).
	UrlFragment      string                 `json:"urlFragment,omitempty"`      // Fragment of the requested URL starting with hash, if present.
	Method           string                 `json:"method"`                     // HTTP request method.
	Headers          map[string]interface{} `json:"headers"`                    // HTTP request headers.
	PostData         string                 `json:"postData,omitempty"`         // HTTP POST request data.
	HasPostData      bool                   `json:"hasPostData,omitempty"`      // True when the request has POST data. Note that postData might still be omitted when this flag is true when the data is too long.
	MixedContentType string                 `json:"mixedContentType,omitempty"` // The mixed content type of the request. enum values: blockable, optionally-blockable, none
	InitialPriority  string                 `json:"initialPriority"`            // Priority of the resource request at the time request is sent. enum values: VeryLow, Low, Medium, High, VeryHigh
	ReferrerPolicy   string                 `json:"referrerPolicy"`             // The referrer policy of the request, as defined in https://www.w3.org/TR/referrer-policy/
	IsLinkPreload    bool                   `json:"isLinkPreload,omitempty"`    // Whether is loaded via link preload.
}

HTTP request data.

type NetworkRequestInterceptedEvent

type NetworkRequestInterceptedEvent struct {
	Method string `json:"method"`
	Params struct {
		InterceptionId      string                 `json:"interceptionId"`                // Each request the page makes will have a unique id, however if any redirects are encountered while processing that fetch, they will be reported with the same id as the original fetch. Likewise if HTTP authentication is needed then the same fetch id will be used.
		Request             *NetworkRequest        `json:"request"`                       //
		FrameId             string                 `json:"frameId"`                       // The id of the frame that initiated the request.
		ResourceType        string                 `json:"resourceType"`                  // How the requested resource will be used. enum values: Document, Stylesheet, Image, Media, Font, Script, TextTrack, XHR, Fetch, EventSource, WebSocket, Manifest, SignedExchange, Ping, CSPViolationReport, Other
		IsNavigationRequest bool                   `json:"isNavigationRequest"`           // Whether this is a navigation request, which can abort the navigation completely.
		IsDownload          bool                   `json:"isDownload,omitempty"`          // Set if the request is a navigation that will result in a download. Only present after response is received from the server (i.e. HeadersReceived stage).
		RedirectUrl         string                 `json:"redirectUrl,omitempty"`         // Redirect location, only sent if a redirect was intercepted.
		AuthChallenge       *NetworkAuthChallenge  `json:"authChallenge,omitempty"`       // Details of the Authorization Challenge encountered. If this is set then continueInterceptedRequest must contain an authChallengeResponse.
		ResponseErrorReason string                 `json:"responseErrorReason,omitempty"` // Response error if intercepted at response stage or if redirect occurred while intercepting request. enum values: Failed, Aborted, TimedOut, AccessDenied, ConnectionClosed, ConnectionReset, ConnectionRefused, ConnectionAborted, ConnectionFailed, NameNotResolved, InternetDisconnected, AddressUnreachable, BlockedByClient, BlockedByResponse
		ResponseStatusCode  int                    `json:"responseStatusCode,omitempty"`  // Response code if intercepted at response stage or if redirect occurred while intercepting request or auth retry occurred.
		ResponseHeaders     map[string]interface{} `json:"responseHeaders,omitempty"`     // Response headers if intercepted at the response stage or if redirect occurred while intercepting request or auth retry occurred.
		RequestId           string                 `json:"requestId,omitempty"`           // If the intercepted request had a corresponding requestWillBeSent event fired for it, then this requestId will be the same as the requestId present in the requestWillBeSent event.
	} `json:"Params,omitempty"`
}

Details of an intercepted HTTP request, which must be either allowed, blocked, modified or mocked. Deprecated, use Fetch.requestPaused instead.

type NetworkRequestPattern

type NetworkRequestPattern struct {
	UrlPattern        string `json:"urlPattern,omitempty"`        // Wildcards ('*' -> zero or more, '?' -> exactly one) are allowed. Escape character is backslash. Omitting is equivalent to "*".
	ResourceType      string `json:"resourceType,omitempty"`      // If set, only requests for matching resource types will be intercepted. enum values: Document, Stylesheet, Image, Media, Font, Script, TextTrack, XHR, Fetch, EventSource, WebSocket, Manifest, SignedExchange, Ping, CSPViolationReport, Other
	InterceptionStage string `json:"interceptionStage,omitempty"` // Stage at wich to begin intercepting requests. Default is Request. enum values: Request, HeadersReceived
}

Request pattern for interception.

type NetworkRequestServedFromCacheEvent

type NetworkRequestServedFromCacheEvent struct {
	Method string `json:"method"`
	Params struct {
		RequestId string `json:"requestId"` // Request identifier.
	} `json:"Params,omitempty"`
}

Fired if request ended up loading from cache.

type NetworkRequestWillBeSentEvent

type NetworkRequestWillBeSentEvent struct {
	Method string `json:"method"`
	Params struct {
		RequestId        string            `json:"requestId"`                  // Request identifier.
		LoaderId         string            `json:"loaderId"`                   // Loader identifier. Empty string if the request is fetched from worker.
		DocumentURL      string            `json:"documentURL"`                // URL of the document this request is loaded for.
		Request          *NetworkRequest   `json:"request"`                    // Request data.
		Timestamp        float64           `json:"timestamp"`                  // Timestamp.
		WallTime         float64           `json:"wallTime"`                   // Timestamp.
		Initiator        *NetworkInitiator `json:"initiator"`                  // Request initiator.
		RedirectResponse *NetworkResponse  `json:"redirectResponse,omitempty"` // Redirect response data.
		Type             string            `json:"type,omitempty"`             // Type of this resource. enum values: Document, Stylesheet, Image, Media, Font, Script, TextTrack, XHR, Fetch, EventSource, WebSocket, Manifest, SignedExchange, Ping, CSPViolationReport, Other
		FrameId          string            `json:"frameId,omitempty"`          // Frame identifier.
		HasUserGesture   bool              `json:"hasUserGesture,omitempty"`   // Whether the request is initiated by a user gesture. Defaults to false.
	} `json:"Params,omitempty"`
}

Fired when page is about to send HTTP request.

type NetworkRequestWillBeSentExtraInfoEvent added in v1.0.7

type NetworkRequestWillBeSentExtraInfoEvent struct {
	Method string `json:"method"`
	Params struct {
		RequestId         string                            `json:"requestId"`         // Request identifier. Used to match this information to an existing requestWillBeSent event.
		AssociatedCookies []*NetworkBlockedCookieWithReason `json:"associatedCookies"` // A list of cookies potentially associated to the requested URL. This includes both cookies sent with the request and the ones not sent; the latter are distinguished by having blockedReason field set.
		Headers           map[string]interface{}            `json:"headers"`           // Raw request headers as they will be sent over the wire.
	} `json:"Params,omitempty"`
}

Fired when additional information about a requestWillBeSent event is available from the network stack. Not every requestWillBeSent event will have an additional requestWillBeSentExtraInfo fired for it, and there is no guarantee whether requestWillBeSent or requestWillBeSentExtraInfo will be fired first for the same request.

type NetworkResourceChangedPriorityEvent

type NetworkResourceChangedPriorityEvent struct {
	Method string `json:"method"`
	Params struct {
		RequestId   string  `json:"requestId"`   // Request identifier.
		NewPriority string  `json:"newPriority"` // New priority enum values: VeryLow, Low, Medium, High, VeryHigh
		Timestamp   float64 `json:"timestamp"`   // Timestamp.
	} `json:"Params,omitempty"`
}

Fired when resource loading priority is changed

type NetworkResourceTiming

type NetworkResourceTiming struct {
	RequestTime              float64 `json:"requestTime"`              // Timing's requestTime is a baseline in seconds, while the other numbers are ticks in milliseconds relatively to this requestTime.
	ProxyStart               float64 `json:"proxyStart"`               // Started resolving proxy.
	ProxyEnd                 float64 `json:"proxyEnd"`                 // Finished resolving proxy.
	DnsStart                 float64 `json:"dnsStart"`                 // Started DNS address resolve.
	DnsEnd                   float64 `json:"dnsEnd"`                   // Finished DNS address resolve.
	ConnectStart             float64 `json:"connectStart"`             // Started connecting to the remote host.
	ConnectEnd               float64 `json:"connectEnd"`               // Connected to the remote host.
	SslStart                 float64 `json:"sslStart"`                 // Started SSL handshake.
	SslEnd                   float64 `json:"sslEnd"`                   // Finished SSL handshake.
	WorkerStart              float64 `json:"workerStart"`              // Started running ServiceWorker.
	WorkerReady              float64 `json:"workerReady"`              // Finished Starting ServiceWorker.
	WorkerFetchStart         float64 `json:"workerFetchStart"`         // Started fetch event.
	WorkerRespondWithSettled float64 `json:"workerRespondWithSettled"` // Settled fetch event respondWith promise.
	SendStart                float64 `json:"sendStart"`                // Started sending request.
	SendEnd                  float64 `json:"sendEnd"`                  // Finished sending request.
	PushStart                float64 `json:"pushStart"`                // Time the server started pushing request.
	PushEnd                  float64 `json:"pushEnd"`                  // Time the server finished pushing request.
	ReceiveHeadersEnd        float64 `json:"receiveHeadersEnd"`        // Finished receiving response headers.
}

Timing information for the request.

type NetworkResponse

type NetworkResponse struct {
	Url                         string                  `json:"url"`                                   // Response URL. This URL can be different from CachedResource.url in case of redirect.
	Status                      int                     `json:"status"`                                // HTTP response status code.
	StatusText                  string                  `json:"statusText"`                            // HTTP response status text.
	Headers                     map[string]interface{}  `json:"headers"`                               // HTTP response headers.
	HeadersText                 string                  `json:"headersText,omitempty"`                 // HTTP response headers text.
	MimeType                    string                  `json:"mimeType"`                              // Resource mimeType as determined by the browser.
	RequestHeaders              map[string]interface{}  `json:"requestHeaders,omitempty"`              // Refined HTTP request headers that were actually transmitted over the network.
	RequestHeadersText          string                  `json:"requestHeadersText,omitempty"`          // HTTP request headers text.
	ConnectionReused            bool                    `json:"connectionReused"`                      // Specifies whether physical connection was actually reused for this request.
	ConnectionId                float64                 `json:"connectionId"`                          // Physical connection id that was actually used for this request.
	RemoteIPAddress             string                  `json:"remoteIPAddress,omitempty"`             // Remote IP address.
	RemotePort                  int                     `json:"remotePort,omitempty"`                  // Remote port.
	FromDiskCache               bool                    `json:"fromDiskCache,omitempty"`               // Specifies that the request was served from the disk cache.
	FromServiceWorker           bool                    `json:"fromServiceWorker,omitempty"`           // Specifies that the request was served from the ServiceWorker.
	FromPrefetchCache           bool                    `json:"fromPrefetchCache,omitempty"`           // Specifies that the request was served from the prefetch cache.
	EncodedDataLength           float64                 `json:"encodedDataLength"`                     // Total number of bytes received for this request so far.
	Timing                      *NetworkResourceTiming  `json:"timing,omitempty"`                      // Timing information for the given request.
	ServiceWorkerResponseSource string                  `json:"serviceWorkerResponseSource,omitempty"` // Response source of response from ServiceWorker. enum values: cache-storage, http-cache, fallback-code, network
	ResponseTime                float64                 `json:"responseTime,omitempty"`                // The time at which the returned response was generated.
	CacheStorageCacheName       string                  `json:"cacheStorageCacheName,omitempty"`       // Cache Storage Cache Name.
	Protocol                    string                  `json:"protocol,omitempty"`                    // Protocol used to fetch this request.
	SecurityState               string                  `json:"securityState"`                         // Security state of the request resource. enum values: unknown, neutral, insecure, secure, info, insecure-broken
	SecurityDetails             *NetworkSecurityDetails `json:"securityDetails,omitempty"`             // Security details for the request.
}

HTTP response data.

type NetworkResponseReceivedEvent

type NetworkResponseReceivedEvent struct {
	Method string `json:"method"`
	Params struct {
		RequestId string           `json:"requestId"`         // Request identifier.
		LoaderId  string           `json:"loaderId"`          // Loader identifier. Empty string if the request is fetched from worker.
		Timestamp float64          `json:"timestamp"`         // Timestamp.
		Type      string           `json:"type"`              // Resource type. enum values: Document, Stylesheet, Image, Media, Font, Script, TextTrack, XHR, Fetch, EventSource, WebSocket, Manifest, SignedExchange, Ping, CSPViolationReport, Other
		Response  *NetworkResponse `json:"response"`          // Response data.
		FrameId   string           `json:"frameId,omitempty"` // Frame identifier.
	} `json:"Params,omitempty"`
}

Fired when HTTP response is available.

type NetworkResponseReceivedExtraInfoEvent added in v1.0.7

type NetworkResponseReceivedExtraInfoEvent struct {
	Method string `json:"method"`
	Params struct {
		RequestId      string                               `json:"requestId"`             // Request identifier. Used to match this information to another responseReceived event.
		BlockedCookies []*NetworkBlockedSetCookieWithReason `json:"blockedCookies"`        // A list of cookies which were not stored from the response along with the corresponding reasons for blocking. The cookies here may not be valid due to syntax errors, which are represented by the invalid cookie line string instead of a proper cookie.
		Headers        map[string]interface{}               `json:"headers"`               // Raw response headers as they were received over the wire.
		HeadersText    string                               `json:"headersText,omitempty"` // Raw response header text as it was received over the wire. The raw text may not always be available, such as in the case of HTTP/2 or QUIC.
	} `json:"Params,omitempty"`
}

Fired when additional information about a responseReceived event is available from the network stack. Not every responseReceived event will have an additional responseReceivedExtraInfo for it, and responseReceivedExtraInfo may be fired before or after responseReceived.

type NetworkSearchInResponseBodyParams

type NetworkSearchInResponseBodyParams struct {
	// Identifier of the network response to search.
	RequestId string `json:"requestId"`
	// String to search for.
	Query string `json:"query"`
	// If true, search is case sensitive.
	CaseSensitive bool `json:"caseSensitive,omitempty"`
	// If true, treats string parameter as regex.
	IsRegex bool `json:"isRegex,omitempty"`
}

type NetworkSecurityDetails

type NetworkSecurityDetails struct {
	Protocol                          string                               `json:"protocol"`                          // Protocol name (e.g. "TLS 1.2" or "QUIC").
	KeyExchange                       string                               `json:"keyExchange"`                       // Key Exchange used by the connection, or the empty string if not applicable.
	KeyExchangeGroup                  string                               `json:"keyExchangeGroup,omitempty"`        // (EC)DH group used by the connection, if applicable.
	Cipher                            string                               `json:"cipher"`                            // Cipher name.
	Mac                               string                               `json:"mac,omitempty"`                     // TLS MAC. Note that AEAD ciphers do not have separate MACs.
	CertificateId                     int                                  `json:"certificateId"`                     // Certificate ID value.
	SubjectName                       string                               `json:"subjectName"`                       // Certificate subject name.
	SanList                           []string                             `json:"sanList"`                           // Subject Alternative Name (SAN) DNS names and IP addresses.
	Issuer                            string                               `json:"issuer"`                            // Name of the issuing CA.
	ValidFrom                         float64                              `json:"validFrom"`                         // Certificate valid from date.
	ValidTo                           float64                              `json:"validTo"`                           // Certificate valid to (expiration) date
	SignedCertificateTimestampList    []*NetworkSignedCertificateTimestamp `json:"signedCertificateTimestampList"`    // List of signed certificate timestamps (SCTs).
	CertificateTransparencyCompliance string                               `json:"certificateTransparencyCompliance"` // Whether the request complied with Certificate Transparency policy enum values: unknown, not-compliant, compliant
}

Security details about a request.

type NetworkSetBlockedURLsParams

type NetworkSetBlockedURLsParams struct {
	// URL patterns to block. Wildcards ('*') are allowed.
	Urls []string `json:"urls"`
}

type NetworkSetBypassServiceWorkerParams

type NetworkSetBypassServiceWorkerParams struct {
	// Bypass service worker and load from network.
	Bypass bool `json:"bypass"`
}

type NetworkSetCacheDisabledParams

type NetworkSetCacheDisabledParams struct {
	// Cache disabled state.
	CacheDisabled bool `json:"cacheDisabled"`
}

type NetworkSetCookieParams

type NetworkSetCookieParams struct {
	// Cookie name.
	Name string `json:"name"`
	// Cookie value.
	Value string `json:"value"`
	// The request-URI to associate with the setting of the cookie. This value can affect the default domain and path values of the created cookie.
	Url string `json:"url,omitempty"`
	// Cookie domain.
	Domain string `json:"domain,omitempty"`
	// Cookie path.
	Path string `json:"path,omitempty"`
	// True if cookie is secure.
	Secure bool `json:"secure,omitempty"`
	// True if cookie is http-only.
	HttpOnly bool `json:"httpOnly,omitempty"`
	// Cookie SameSite type. enum values: Strict, Lax, None
	SameSite string `json:"sameSite,omitempty"`
	// Cookie expiration date, session cookie if not set
	Expires float64 `json:"expires,omitempty"`
	// Cookie Priority type. enum values: Low, Medium, High
	Priority string `json:"priority,omitempty"`
}

type NetworkSetCookiesParams

type NetworkSetCookiesParams struct {
	// Cookies to be set.
	Cookies []*NetworkCookieParam `json:"cookies"`
}

type NetworkSetDataSizeLimitsForTestParams

type NetworkSetDataSizeLimitsForTestParams struct {
	// Maximum total buffer size.
	MaxTotalSize int `json:"maxTotalSize"`
	// Maximum per-resource size.
	MaxResourceSize int `json:"maxResourceSize"`
}

type NetworkSetExtraHTTPHeadersParams

type NetworkSetExtraHTTPHeadersParams struct {
	// Map with extra HTTP headers.
	Headers map[string]interface{} `json:"headers"`
}

type NetworkSetRequestInterceptionParams

type NetworkSetRequestInterceptionParams struct {
	// Requests matching any of these patterns will be forwarded and wait for the corresponding continueInterceptedRequest call.
	Patterns []*NetworkRequestPattern `json:"patterns"`
}

type NetworkSetUserAgentOverrideParams

type NetworkSetUserAgentOverrideParams struct {
	// User agent to use.
	UserAgent string `json:"userAgent"`
	// Browser langugage to emulate.
	AcceptLanguage string `json:"acceptLanguage,omitempty"`
	// The platform navigator.platform should return.
	Platform string `json:"platform,omitempty"`
	// To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData
	UserAgentMetadata *EmulationUserAgentMetadata `json:"userAgentMetadata,omitempty"`
}

type NetworkSignedCertificateTimestamp

type NetworkSignedCertificateTimestamp struct {
	Status             string  `json:"status"`             // Validation status.
	Origin             string  `json:"origin"`             // Origin.
	LogDescription     string  `json:"logDescription"`     // Log name / description.
	LogId              string  `json:"logId"`              // Log ID.
	Timestamp          float64 `json:"timestamp"`          // Issuance date.
	HashAlgorithm      string  `json:"hashAlgorithm"`      // Hash algorithm.
	SignatureAlgorithm string  `json:"signatureAlgorithm"` // Signature algorithm.
	SignatureData      string  `json:"signatureData"`      // Signature data.
}

Details of a signed certificate timestamp (SCT).

type NetworkSignedExchangeError

type NetworkSignedExchangeError struct {
	Message        string `json:"message"`                  // Error message.
	SignatureIndex int    `json:"signatureIndex,omitempty"` // The index of the signature which caused the error.
	ErrorField     string `json:"errorField,omitempty"`     // The field which caused the error. enum values: signatureSig, signatureIntegrity, signatureCertUrl, signatureCertSha256, signatureValidityUrl, signatureTimestamps
}

Information about a signed exchange response.

type NetworkSignedExchangeHeader

type NetworkSignedExchangeHeader struct {
	RequestUrl      string                            `json:"requestUrl"`      // Signed exchange request URL.
	ResponseCode    int                               `json:"responseCode"`    // Signed exchange response code.
	ResponseHeaders map[string]interface{}            `json:"responseHeaders"` // Signed exchange response headers.
	Signatures      []*NetworkSignedExchangeSignature `json:"signatures"`      // Signed exchange response signature.
	HeaderIntegrity string                            `json:"headerIntegrity"` // Signed exchange header integrity hash in the form of "sha256-<base64-hash-value>".
}

Information about a signed exchange header. https://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html#cbor-representation

type NetworkSignedExchangeInfo

type NetworkSignedExchangeInfo struct {
	OuterResponse   *NetworkResponse              `json:"outerResponse"`             // The outer response of signed HTTP exchange which was received from network.
	Header          *NetworkSignedExchangeHeader  `json:"header,omitempty"`          // Information about the signed exchange header.
	SecurityDetails *NetworkSecurityDetails       `json:"securityDetails,omitempty"` // Security details for the signed exchange header.
	Errors          []*NetworkSignedExchangeError `json:"errors,omitempty"`          // Errors occurred while handling the signed exchagne.
}

Information about a signed exchange response.

type NetworkSignedExchangeReceivedEvent

type NetworkSignedExchangeReceivedEvent struct {
	Method string `json:"method"`
	Params struct {
		RequestId string                     `json:"requestId"` // Request identifier.
		Info      *NetworkSignedExchangeInfo `json:"info"`      // Information about the signed exchange response.
	} `json:"Params,omitempty"`
}

Fired when a signed exchange was received over the network

type NetworkSignedExchangeSignature

type NetworkSignedExchangeSignature struct {
	Label        string   `json:"label"`                  // Signed exchange signature label.
	Signature    string   `json:"signature"`              // The hex string of signed exchange signature.
	Integrity    string   `json:"integrity"`              // Signed exchange signature integrity.
	CertUrl      string   `json:"certUrl,omitempty"`      // Signed exchange signature cert Url.
	CertSha256   string   `json:"certSha256,omitempty"`   // The hex string of signed exchange signature cert sha256.
	ValidityUrl  string   `json:"validityUrl"`            // Signed exchange signature validity Url.
	Date         int      `json:"date"`                   // Signed exchange signature date.
	Expires      int      `json:"expires"`                // Signed exchange signature expires.
	Certificates []string `json:"certificates,omitempty"` // The encoded certificates.
}

Information about a signed exchange signature. https://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html#rfc.section.3.1

type NetworkTakeResponseBodyForInterceptionAsStreamParams

type NetworkTakeResponseBodyForInterceptionAsStreamParams struct {
	//
	InterceptionId string `json:"interceptionId"`
}

type NetworkWebSocketClosedEvent

type NetworkWebSocketClosedEvent struct {
	Method string `json:"method"`
	Params struct {
		RequestId string  `json:"requestId"` // Request identifier.
		Timestamp float64 `json:"timestamp"` // Timestamp.
	} `json:"Params,omitempty"`
}

Fired when WebSocket is closed.

type NetworkWebSocketCreatedEvent

type NetworkWebSocketCreatedEvent struct {
	Method string `json:"method"`
	Params struct {
		RequestId string            `json:"requestId"`           // Request identifier.
		Url       string            `json:"url"`                 // WebSocket request URL.
		Initiator *NetworkInitiator `json:"initiator,omitempty"` // Request initiator.
	} `json:"Params,omitempty"`
}

Fired upon WebSocket creation.

type NetworkWebSocketFrame

type NetworkWebSocketFrame struct {
	Opcode      float64 `json:"opcode"`      // WebSocket message opcode.
	Mask        bool    `json:"mask"`        // WebSocket message mask.
	PayloadData string  `json:"payloadData"` // WebSocket message payload data. If the opcode is 1, this is a text message and payloadData is a UTF-8 string. If the opcode isn't 1, then payloadData is a base64 encoded string representing binary data.
}

WebSocket message data. This represents an entire WebSocket message, not just a fragmented frame as the name suggests.

type NetworkWebSocketFrameErrorEvent

type NetworkWebSocketFrameErrorEvent struct {
	Method string `json:"method"`
	Params struct {
		RequestId    string  `json:"requestId"`    // Request identifier.
		Timestamp    float64 `json:"timestamp"`    // Timestamp.
		ErrorMessage string  `json:"errorMessage"` // WebSocket error message.
	} `json:"Params,omitempty"`
}

Fired when WebSocket message error occurs.

type NetworkWebSocketFrameReceivedEvent

type NetworkWebSocketFrameReceivedEvent struct {
	Method string `json:"method"`
	Params struct {
		RequestId string                 `json:"requestId"` // Request identifier.
		Timestamp float64                `json:"timestamp"` // Timestamp.
		Response  *NetworkWebSocketFrame `json:"response"`  // WebSocket response data.
	} `json:"Params,omitempty"`
}

Fired when WebSocket message is received.

type NetworkWebSocketFrameSentEvent

type NetworkWebSocketFrameSentEvent struct {
	Method string `json:"method"`
	Params struct {
		RequestId string                 `json:"requestId"` // Request identifier.
		Timestamp float64                `json:"timestamp"` // Timestamp.
		Response  *NetworkWebSocketFrame `json:"response"`  // WebSocket response data.
	} `json:"Params,omitempty"`
}

Fired when WebSocket message is sent.

type NetworkWebSocketHandshakeResponseReceivedEvent

type NetworkWebSocketHandshakeResponseReceivedEvent struct {
	Method string `json:"method"`
	Params struct {
		RequestId string                    `json:"requestId"` // Request identifier.
		Timestamp float64                   `json:"timestamp"` // Timestamp.
		Response  *NetworkWebSocketResponse `json:"response"`  // WebSocket response data.
	} `json:"Params,omitempty"`
}

Fired when WebSocket handshake response becomes available.

type NetworkWebSocketRequest

type NetworkWebSocketRequest struct {
	Headers map[string]interface{} `json:"headers"` // HTTP request headers.
}

WebSocket request data.

type NetworkWebSocketResponse

type NetworkWebSocketResponse struct {
	Status             int                    `json:"status"`                       // HTTP response status code.
	StatusText         string                 `json:"statusText"`                   // HTTP response status text.
	Headers            map[string]interface{} `json:"headers"`                      // HTTP response headers.
	HeadersText        string                 `json:"headersText,omitempty"`        // HTTP response headers text.
	RequestHeaders     map[string]interface{} `json:"requestHeaders,omitempty"`     // HTTP request headers.
	RequestHeadersText string                 `json:"requestHeadersText,omitempty"` // HTTP request headers text.
}

WebSocket response data.

type NetworkWebSocketWillSendHandshakeRequestEvent

type NetworkWebSocketWillSendHandshakeRequestEvent struct {
	Method string `json:"method"`
	Params struct {
		RequestId string                   `json:"requestId"` // Request identifier.
		Timestamp float64                  `json:"timestamp"` // Timestamp.
		WallTime  float64                  `json:"wallTime"`  // UTC Timestamp.
		Request   *NetworkWebSocketRequest `json:"request"`   // WebSocket request data.
	} `json:"Params,omitempty"`
}

Fired when WebSocket is about to initiate handshake.

type Overlay

type Overlay struct {
	// contains filtered or unexported fields
}

func NewOverlay

func NewOverlay(target gcdmessage.ChromeTargeter) *Overlay

func (*Overlay) Disable

func (c *Overlay) Disable() (*gcdmessage.ChromeResponse, error)

Disables domain notifications.

func (*Overlay) Enable

func (c *Overlay) Enable() (*gcdmessage.ChromeResponse, error)

Enables domain notifications.

func (*Overlay) GetHighlightObjectForTest

func (c *Overlay) GetHighlightObjectForTest(nodeId int, includeDistance bool, includeStyle bool, colorFormat string, showAccessibilityInfo bool) (map[string]interface{}, error)

GetHighlightObjectForTest - For testing. nodeId - Id of the node to get highlight object for. includeDistance - Whether to include distance info. includeStyle - Whether to include style info. colorFormat - The color format to get config with (default: hex). enum values: rgb, hsl, hex showAccessibilityInfo - Whether to show accessibility info (default: true). Returns - highlight - Highlight data for the node.

func (*Overlay) GetHighlightObjectForTestWithParams

func (c *Overlay) GetHighlightObjectForTestWithParams(v *OverlayGetHighlightObjectForTestParams) (map[string]interface{}, error)

GetHighlightObjectForTestWithParams - For testing. Returns - highlight - Highlight data for the node.

func (*Overlay) HideHighlight

func (c *Overlay) HideHighlight() (*gcdmessage.ChromeResponse, error)

Hides any highlight.

func (*Overlay) HighlightFrame

func (c *Overlay) HighlightFrame(frameId string, contentColor *DOMRGBA, contentOutlineColor *DOMRGBA) (*gcdmessage.ChromeResponse, error)

HighlightFrame - Highlights owner element of the frame with given id. frameId - Identifier of the frame to highlight. contentColor - The content box highlight fill color (default: transparent). contentOutlineColor - The content box highlight outline color (default: transparent).

func (*Overlay) HighlightFrameWithParams

func (c *Overlay) HighlightFrameWithParams(v *OverlayHighlightFrameParams) (*gcdmessage.ChromeResponse, error)

HighlightFrameWithParams - Highlights owner element of the frame with given id.

func (*Overlay) HighlightNode

func (c *Overlay) HighlightNode(highlightConfig *OverlayHighlightConfig, nodeId int, backendNodeId int, objectId string, selector string) (*gcdmessage.ChromeResponse, error)

HighlightNode - Highlights DOM node with given id or with the given JavaScript object wrapper. Either nodeId or objectId must be specified. highlightConfig - A descriptor for the highlight appearance. nodeId - Identifier of the node to highlight. backendNodeId - Identifier of the backend node to highlight. objectId - JavaScript object id of the node to be highlighted. selector - Selectors to highlight relevant nodes.

func (*Overlay) HighlightNodeWithParams

func (c *Overlay) HighlightNodeWithParams(v *OverlayHighlightNodeParams) (*gcdmessage.ChromeResponse, error)

HighlightNodeWithParams - Highlights DOM node with given id or with the given JavaScript object wrapper. Either nodeId or objectId must be specified.

func (*Overlay) HighlightQuad

func (c *Overlay) HighlightQuad(quad []float64, color *DOMRGBA, outlineColor *DOMRGBA) (*gcdmessage.ChromeResponse, error)

HighlightQuad - Highlights given quad. Coordinates are absolute with respect to the main frame viewport. quad - Quad to highlight color - The highlight fill color (default: transparent). outlineColor - The highlight outline color (default: transparent).

func (*Overlay) HighlightQuadWithParams

func (c *Overlay) HighlightQuadWithParams(v *OverlayHighlightQuadParams) (*gcdmessage.ChromeResponse, error)

HighlightQuadWithParams - Highlights given quad. Coordinates are absolute with respect to the main frame viewport.

func (*Overlay) HighlightRect

func (c *Overlay) HighlightRect(x int, y int, width int, height int, color *DOMRGBA, outlineColor *DOMRGBA) (*gcdmessage.ChromeResponse, error)

HighlightRect - Highlights given rectangle. Coordinates are absolute with respect to the main frame viewport. x - X coordinate y - Y coordinate width - Rectangle width height - Rectangle height color - The highlight fill color (default: transparent). outlineColor - The highlight outline color (default: transparent).

func (*Overlay) HighlightRectWithParams

func (c *Overlay) HighlightRectWithParams(v *OverlayHighlightRectParams) (*gcdmessage.ChromeResponse, error)

HighlightRectWithParams - Highlights given rectangle. Coordinates are absolute with respect to the main frame viewport.

func (*Overlay) SetInspectMode

func (c *Overlay) SetInspectMode(mode string, highlightConfig *OverlayHighlightConfig) (*gcdmessage.ChromeResponse, error)

SetInspectMode - Enters the 'inspect' mode. In this mode, elements that user is hovering over are highlighted. Backend then generates 'inspectNodeRequested' event upon element selection. mode - Set an inspection mode. enum values: searchForNode, searchForUAShadowDOM, captureAreaScreenshot, showDistances, none highlightConfig - A descriptor for the highlight appearance of hovered-over nodes. May be omitted if `enabled == false`.

func (*Overlay) SetInspectModeWithParams

func (c *Overlay) SetInspectModeWithParams(v *OverlaySetInspectModeParams) (*gcdmessage.ChromeResponse, error)

SetInspectModeWithParams - Enters the 'inspect' mode. In this mode, elements that user is hovering over are highlighted. Backend then generates 'inspectNodeRequested' event upon element selection.

func (*Overlay) SetPausedInDebuggerMessage

func (c *Overlay) SetPausedInDebuggerMessage(message string) (*gcdmessage.ChromeResponse, error)

SetPausedInDebuggerMessage - message - The message to display, also triggers resume and step over controls.

func (*Overlay) SetPausedInDebuggerMessageWithParams

func (c *Overlay) SetPausedInDebuggerMessageWithParams(v *OverlaySetPausedInDebuggerMessageParams) (*gcdmessage.ChromeResponse, error)

SetPausedInDebuggerMessageWithParams -

func (*Overlay) SetShowAdHighlights added in v1.0.3

func (c *Overlay) SetShowAdHighlights(show bool) (*gcdmessage.ChromeResponse, error)

SetShowAdHighlights - Highlights owner element of all frames detected to be ads. show - True for showing ad highlights

func (*Overlay) SetShowAdHighlightsWithParams added in v1.0.3

func (c *Overlay) SetShowAdHighlightsWithParams(v *OverlaySetShowAdHighlightsParams) (*gcdmessage.ChromeResponse, error)

SetShowAdHighlightsWithParams - Highlights owner element of all frames detected to be ads.

func (*Overlay) SetShowDebugBorders

func (c *Overlay) SetShowDebugBorders(show bool) (*gcdmessage.ChromeResponse, error)

SetShowDebugBorders - Requests that backend shows debug borders on layers show - True for showing debug borders

func (*Overlay) SetShowDebugBordersWithParams

func (c *Overlay) SetShowDebugBordersWithParams(v *OverlaySetShowDebugBordersParams) (*gcdmessage.ChromeResponse, error)

SetShowDebugBordersWithParams - Requests that backend shows debug borders on layers

func (*Overlay) SetShowFPSCounter

func (c *Overlay) SetShowFPSCounter(show bool) (*gcdmessage.ChromeResponse, error)

SetShowFPSCounter - Requests that backend shows the FPS counter show - True for showing the FPS counter

func (*Overlay) SetShowFPSCounterWithParams

func (c *Overlay) SetShowFPSCounterWithParams(v *OverlaySetShowFPSCounterParams) (*gcdmessage.ChromeResponse, error)

SetShowFPSCounterWithParams - Requests that backend shows the FPS counter

func (*Overlay) SetShowHinge added in v1.0.10

func (c *Overlay) SetShowHinge(hingeConfig *OverlayHingeConfig) (*gcdmessage.ChromeResponse, error)

SetShowHinge - Add a dual screen device hinge hingeConfig - hinge data, null means hideHinge

func (*Overlay) SetShowHingeWithParams added in v1.0.10

func (c *Overlay) SetShowHingeWithParams(v *OverlaySetShowHingeParams) (*gcdmessage.ChromeResponse, error)

SetShowHingeWithParams - Add a dual screen device hinge

func (*Overlay) SetShowHitTestBorders added in v1.0.3

func (c *Overlay) SetShowHitTestBorders(show bool) (*gcdmessage.ChromeResponse, error)

SetShowHitTestBorders - Requests that backend shows hit-test borders on layers show - True for showing hit-test borders

func (*Overlay) SetShowHitTestBordersWithParams added in v1.0.3

func (c *Overlay) SetShowHitTestBordersWithParams(v *OverlaySetShowHitTestBordersParams) (*gcdmessage.ChromeResponse, error)

SetShowHitTestBordersWithParams - Requests that backend shows hit-test borders on layers

func (*Overlay) SetShowLayoutShiftRegions added in v1.0.7

func (c *Overlay) SetShowLayoutShiftRegions(result bool) (*gcdmessage.ChromeResponse, error)

SetShowLayoutShiftRegions - Requests that backend shows layout shift regions result - True for showing layout shift regions

func (*Overlay) SetShowLayoutShiftRegionsWithParams added in v1.0.7

func (c *Overlay) SetShowLayoutShiftRegionsWithParams(v *OverlaySetShowLayoutShiftRegionsParams) (*gcdmessage.ChromeResponse, error)

SetShowLayoutShiftRegionsWithParams - Requests that backend shows layout shift regions

func (*Overlay) SetShowPaintRects

func (c *Overlay) SetShowPaintRects(result bool) (*gcdmessage.ChromeResponse, error)

SetShowPaintRects - Requests that backend shows paint rectangles result - True for showing paint rectangles

func (*Overlay) SetShowPaintRectsWithParams

func (c *Overlay) SetShowPaintRectsWithParams(v *OverlaySetShowPaintRectsParams) (*gcdmessage.ChromeResponse, error)

SetShowPaintRectsWithParams - Requests that backend shows paint rectangles

func (*Overlay) SetShowScrollBottleneckRects

func (c *Overlay) SetShowScrollBottleneckRects(show bool) (*gcdmessage.ChromeResponse, error)

SetShowScrollBottleneckRects - Requests that backend shows scroll bottleneck rects show - True for showing scroll bottleneck rects

func (*Overlay) SetShowScrollBottleneckRectsWithParams

func (c *Overlay) SetShowScrollBottleneckRectsWithParams(v *OverlaySetShowScrollBottleneckRectsParams) (*gcdmessage.ChromeResponse, error)

SetShowScrollBottleneckRectsWithParams - Requests that backend shows scroll bottleneck rects

func (*Overlay) SetShowViewportSizeOnResize

func (c *Overlay) SetShowViewportSizeOnResize(show bool) (*gcdmessage.ChromeResponse, error)

SetShowViewportSizeOnResize - Paints viewport size upon main frame resize. show - Whether to paint size or not.

func (*Overlay) SetShowViewportSizeOnResizeWithParams

func (c *Overlay) SetShowViewportSizeOnResizeWithParams(v *OverlaySetShowViewportSizeOnResizeParams) (*gcdmessage.ChromeResponse, error)

SetShowViewportSizeOnResizeWithParams - Paints viewport size upon main frame resize.

type OverlayGetHighlightObjectForTestParams

type OverlayGetHighlightObjectForTestParams struct {
	// Id of the node to get highlight object for.
	NodeId int `json:"nodeId"`
	// Whether to include distance info.
	IncludeDistance bool `json:"includeDistance,omitempty"`
	// Whether to include style info.
	IncludeStyle bool `json:"includeStyle,omitempty"`
	// The color format to get config with (default: hex). enum values: rgb, hsl, hex
	ColorFormat string `json:"colorFormat,omitempty"`
	// Whether to show accessibility info (default: true).
	ShowAccessibilityInfo bool `json:"showAccessibilityInfo,omitempty"`
}

type OverlayGridHighlightConfig added in v1.0.10

type OverlayGridHighlightConfig struct {
	ShowGridExtensionLines  bool     `json:"showGridExtensionLines,omitempty"`  // Whether the extension lines from grid cells to the rulers should be shown (default: false).
	ShowPositiveLineNumbers bool     `json:"showPositiveLineNumbers,omitempty"` // Show Positive line number labels (default: false).
	ShowNegativeLineNumbers bool     `json:"showNegativeLineNumbers,omitempty"` // Show Negative line number labels (default: false).
	GridBorderColor         *DOMRGBA `json:"gridBorderColor,omitempty"`         // The grid container border highlight color (default: transparent).
	CellBorderColor         *DOMRGBA `json:"cellBorderColor,omitempty"`         // The cell border color (default: transparent).
	GridBorderDash          bool     `json:"gridBorderDash,omitempty"`          // Whether the grid border is dashed (default: false).
	CellBorderDash          bool     `json:"cellBorderDash,omitempty"`          // Whether the cell border is dashed (default: false).
	RowGapColor             *DOMRGBA `json:"rowGapColor,omitempty"`             // The row gap highlight fill color (default: transparent).
	RowHatchColor           *DOMRGBA `json:"rowHatchColor,omitempty"`           // The row gap hatching fill color (default: transparent).
	ColumnGapColor          *DOMRGBA `json:"columnGapColor,omitempty"`          // The column gap highlight fill color (default: transparent).
	ColumnHatchColor        *DOMRGBA `json:"columnHatchColor,omitempty"`        // The column gap hatching fill color (default: transparent).
}

Configuration data for the highlighting of Grid elements.

type OverlayHighlightConfig

type OverlayHighlightConfig struct {
	ShowInfo              bool                        `json:"showInfo,omitempty"`              // Whether the node info tooltip should be shown (default: false).
	ShowStyles            bool                        `json:"showStyles,omitempty"`            // Whether the node styles in the tooltip (default: false).
	ShowRulers            bool                        `json:"showRulers,omitempty"`            // Whether the rulers should be shown (default: false).
	ShowAccessibilityInfo bool                        `json:"showAccessibilityInfo,omitempty"` // Whether the a11y info should be shown (default: true).
	ShowExtensionLines    bool                        `json:"showExtensionLines,omitempty"`    // Whether the extension lines from node to the rulers should be shown (default: false).
	ContentColor          *DOMRGBA                    `json:"contentColor,omitempty"`          // The content box highlight fill color (default: transparent).
	PaddingColor          *DOMRGBA                    `json:"paddingColor,omitempty"`          // The padding highlight fill color (default: transparent).
	BorderColor           *DOMRGBA                    `json:"borderColor,omitempty"`           // The border highlight fill color (default: transparent).
	MarginColor           *DOMRGBA                    `json:"marginColor,omitempty"`           // The margin highlight fill color (default: transparent).
	EventTargetColor      *DOMRGBA                    `json:"eventTargetColor,omitempty"`      // The event target element highlight fill color (default: transparent).
	ShapeColor            *DOMRGBA                    `json:"shapeColor,omitempty"`            // The shape outside fill color (default: transparent).
	ShapeMarginColor      *DOMRGBA                    `json:"shapeMarginColor,omitempty"`      // The shape margin fill color (default: transparent).
	CssGridColor          *DOMRGBA                    `json:"cssGridColor,omitempty"`          // The grid layout color (default: transparent).
	ColorFormat           string                      `json:"colorFormat,omitempty"`           // The color format used to format color styles (default: hex). enum values: rgb, hsl, hex
	GridHighlightConfig   *OverlayGridHighlightConfig `json:"gridHighlightConfig,omitempty"`   // The grid layout highlight configuration (default: all transparent).
}

Configuration data for the highlighting of page elements.

type OverlayHighlightFrameParams

type OverlayHighlightFrameParams struct {
	// Identifier of the frame to highlight.
	FrameId string `json:"frameId"`
	// The content box highlight fill color (default: transparent).
	ContentColor *DOMRGBA `json:"contentColor,omitempty"`
	// The content box highlight outline color (default: transparent).
	ContentOutlineColor *DOMRGBA `json:"contentOutlineColor,omitempty"`
}

type OverlayHighlightNodeParams

type OverlayHighlightNodeParams struct {
	// A descriptor for the highlight appearance.
	HighlightConfig *OverlayHighlightConfig `json:"highlightConfig"`
	// Identifier of the node to highlight.
	NodeId int `json:"nodeId,omitempty"`
	// Identifier of the backend node to highlight.
	BackendNodeId int `json:"backendNodeId,omitempty"`
	// JavaScript object id of the node to be highlighted.
	ObjectId string `json:"objectId,omitempty"`
	// Selectors to highlight relevant nodes.
	Selector string `json:"selector,omitempty"`
}

type OverlayHighlightQuadParams

type OverlayHighlightQuadParams struct {
	// Quad to highlight
	Quad []float64 `json:"quad"`
	// The highlight fill color (default: transparent).
	Color *DOMRGBA `json:"color,omitempty"`
	// The highlight outline color (default: transparent).
	OutlineColor *DOMRGBA `json:"outlineColor,omitempty"`
}

type OverlayHighlightRectParams

type OverlayHighlightRectParams struct {
	// X coordinate
	X int `json:"x"`
	// Y coordinate
	Y int `json:"y"`
	// Rectangle width
	Width int `json:"width"`
	// Rectangle height
	Height int `json:"height"`
	// The highlight fill color (default: transparent).
	Color *DOMRGBA `json:"color,omitempty"`
	// The highlight outline color (default: transparent).
	OutlineColor *DOMRGBA `json:"outlineColor,omitempty"`
}

type OverlayHingeConfig added in v1.0.10

type OverlayHingeConfig struct {
	Rect         *DOMRect `json:"rect"`                   // A rectangle represent hinge
	ContentColor *DOMRGBA `json:"contentColor,omitempty"` // The content box highlight fill color (default: a dark color).
	OutlineColor *DOMRGBA `json:"outlineColor,omitempty"` // The content box highlight outline color (default: transparent).
}

Configuration for dual screen hinge

type OverlayInspectNodeRequestedEvent

type OverlayInspectNodeRequestedEvent struct {
	Method string `json:"method"`
	Params struct {
		BackendNodeId int `json:"backendNodeId"` // Id of the node to inspect.
	} `json:"Params,omitempty"`
}

Fired when the node should be inspected. This happens after call to `setInspectMode` or when user manually inspects an element.

type OverlayNodeHighlightRequestedEvent

type OverlayNodeHighlightRequestedEvent struct {
	Method string `json:"method"`
	Params struct {
		NodeId int `json:"nodeId"` //
	} `json:"Params,omitempty"`
}

Fired when the node should be highlighted. This happens after call to `setInspectMode`.

type OverlayScreenshotRequestedEvent

type OverlayScreenshotRequestedEvent struct {
	Method string `json:"method"`
	Params struct {
		Viewport *PageViewport `json:"viewport"` // Viewport to capture, in device independent pixels (dip).
	} `json:"Params,omitempty"`
}

Fired when user asks to capture screenshot of some area on the page.

type OverlaySetInspectModeParams

type OverlaySetInspectModeParams struct {
	// Set an inspection mode. enum values: searchForNode, searchForUAShadowDOM, captureAreaScreenshot, showDistances, none
	Mode string `json:"mode"`
	// A descriptor for the highlight appearance of hovered-over nodes. May be omitted if `enabled == false`.
	HighlightConfig *OverlayHighlightConfig `json:"highlightConfig,omitempty"`
}

type OverlaySetPausedInDebuggerMessageParams

type OverlaySetPausedInDebuggerMessageParams struct {
	// The message to display, also triggers resume and step over controls.
	Message string `json:"message,omitempty"`
}

type OverlaySetShowAdHighlightsParams added in v1.0.3

type OverlaySetShowAdHighlightsParams struct {
	// True for showing ad highlights
	Show bool `json:"show"`
}

type OverlaySetShowDebugBordersParams

type OverlaySetShowDebugBordersParams struct {
	// True for showing debug borders
	Show bool `json:"show"`
}

type OverlaySetShowFPSCounterParams

type OverlaySetShowFPSCounterParams struct {
	// True for showing the FPS counter
	Show bool `json:"show"`
}

type OverlaySetShowHingeParams added in v1.0.10

type OverlaySetShowHingeParams struct {
	// hinge data, null means hideHinge
	HingeConfig *OverlayHingeConfig `json:"hingeConfig,omitempty"`
}

type OverlaySetShowHitTestBordersParams added in v1.0.3

type OverlaySetShowHitTestBordersParams struct {
	// True for showing hit-test borders
	Show bool `json:"show"`
}

type OverlaySetShowLayoutShiftRegionsParams added in v1.0.7

type OverlaySetShowLayoutShiftRegionsParams struct {
	// True for showing layout shift regions
	Result bool `json:"result"`
}

type OverlaySetShowPaintRectsParams

type OverlaySetShowPaintRectsParams struct {
	// True for showing paint rectangles
	Result bool `json:"result"`
}

type OverlaySetShowScrollBottleneckRectsParams

type OverlaySetShowScrollBottleneckRectsParams struct {
	// True for showing scroll bottleneck rects
	Show bool `json:"show"`
}

type OverlaySetShowViewportSizeOnResizeParams

type OverlaySetShowViewportSizeOnResizeParams struct {
	// Whether to paint size or not.
	Show bool `json:"show"`
}

type Page

type Page struct {
	// contains filtered or unexported fields
}

func NewPage

func NewPage(target gcdmessage.ChromeTargeter) *Page

func (*Page) AddCompilationCache

func (c *Page) AddCompilationCache(url string, data string) (*gcdmessage.ChromeResponse, error)

AddCompilationCache - Seeds compilation cache for given url. Compilation cache does not survive cross-process navigation. url - data - Base64-encoded data

func (*Page) AddCompilationCacheWithParams

func (c *Page) AddCompilationCacheWithParams(v *PageAddCompilationCacheParams) (*gcdmessage.ChromeResponse, error)

AddCompilationCacheWithParams - Seeds compilation cache for given url. Compilation cache does not survive cross-process navigation.

func (*Page) AddScriptToEvaluateOnLoad

func (c *Page) AddScriptToEvaluateOnLoad(scriptSource string) (string, error)

AddScriptToEvaluateOnLoad - Deprecated, please use addScriptToEvaluateOnNewDocument instead. scriptSource - Returns - identifier - Identifier of the added script.

func (*Page) AddScriptToEvaluateOnLoadWithParams

func (c *Page) AddScriptToEvaluateOnLoadWithParams(v *PageAddScriptToEvaluateOnLoadParams) (string, error)

AddScriptToEvaluateOnLoadWithParams - Deprecated, please use addScriptToEvaluateOnNewDocument instead. Returns - identifier - Identifier of the added script.

func (*Page) AddScriptToEvaluateOnNewDocument

func (c *Page) AddScriptToEvaluateOnNewDocument(source string, worldName string) (string, error)

AddScriptToEvaluateOnNewDocument - Evaluates given script in every frame upon creation (before loading frame's scripts). source - worldName - If specified, creates an isolated world with the given name and evaluates given script in it. This world name will be used as the ExecutionContextDescription::name when the corresponding event is emitted. Returns - identifier - Identifier of the added script.

func (*Page) AddScriptToEvaluateOnNewDocumentWithParams

func (c *Page) AddScriptToEvaluateOnNewDocumentWithParams(v *PageAddScriptToEvaluateOnNewDocumentParams) (string, error)

AddScriptToEvaluateOnNewDocumentWithParams - Evaluates given script in every frame upon creation (before loading frame's scripts). Returns - identifier - Identifier of the added script.

func (*Page) BringToFront

func (c *Page) BringToFront() (*gcdmessage.ChromeResponse, error)

Brings page to front (activates tab).

func (*Page) CaptureScreenshot

func (c *Page) CaptureScreenshot(format string, quality int, clip *PageViewport, fromSurface bool) (string, error)

CaptureScreenshot - Capture page screenshot. format - Image compression format (defaults to png). quality - Compression quality from range [0..100] (jpeg only). clip - Capture the screenshot of a given region only. fromSurface - Capture the screenshot from the surface, rather than the view. Defaults to true. Returns - data - Base64-encoded image data.

func (*Page) CaptureScreenshotWithParams

func (c *Page) CaptureScreenshotWithParams(v *PageCaptureScreenshotParams) (string, error)

CaptureScreenshotWithParams - Capture page screenshot. Returns - data - Base64-encoded image data.

func (*Page) CaptureSnapshot added in v1.0.3

func (c *Page) CaptureSnapshot(format string) (string, error)

CaptureSnapshot - Returns a snapshot of the page as a string. For MHTML format, the serialization includes iframes, shadow DOM, external resources, and element-inline styles. format - Format (defaults to mhtml). Returns - data - Serialized page data.

func (*Page) CaptureSnapshotWithParams added in v1.0.3

func (c *Page) CaptureSnapshotWithParams(v *PageCaptureSnapshotParams) (string, error)

CaptureSnapshotWithParams - Returns a snapshot of the page as a string. For MHTML format, the serialization includes iframes, shadow DOM, external resources, and element-inline styles. Returns - data - Serialized page data.

func (*Page) ClearCompilationCache

func (c *Page) ClearCompilationCache() (*gcdmessage.ChromeResponse, error)

Clears seeded compilation cache.

func (*Page) ClearDeviceMetricsOverride

func (c *Page) ClearDeviceMetricsOverride() (*gcdmessage.ChromeResponse, error)

Clears the overriden device metrics.

func (*Page) ClearDeviceOrientationOverride

func (c *Page) ClearDeviceOrientationOverride() (*gcdmessage.ChromeResponse, error)

Clears the overridden Device Orientation.

func (*Page) ClearGeolocationOverride

func (c *Page) ClearGeolocationOverride() (*gcdmessage.ChromeResponse, error)

Clears the overriden Geolocation Position and Error.

func (*Page) Close

func (c *Page) Close() (*gcdmessage.ChromeResponse, error)

Tries to close page, running its beforeunload hooks, if any.

func (*Page) Crash

func (c *Page) Crash() (*gcdmessage.ChromeResponse, error)

Crashes renderer on the IO thread, generates minidumps.

func (*Page) CreateIsolatedWorld

func (c *Page) CreateIsolatedWorld(frameId string, worldName string, grantUniveralAccess bool) (int, error)

CreateIsolatedWorld - Creates an isolated world for the given frame. frameId - Id of the frame in which the isolated world should be created. worldName - An optional name which is reported in the Execution Context. grantUniveralAccess - Whether or not universal access should be granted to the isolated world. This is a powerful option, use with caution. Returns - executionContextId - Execution context of the isolated world.

func (*Page) CreateIsolatedWorldWithParams

func (c *Page) CreateIsolatedWorldWithParams(v *PageCreateIsolatedWorldParams) (int, error)

CreateIsolatedWorldWithParams - Creates an isolated world for the given frame. Returns - executionContextId - Execution context of the isolated world.

func (*Page) DeleteCookie

func (c *Page) DeleteCookie(cookieName string, url string) (*gcdmessage.ChromeResponse, error)

DeleteCookie - Deletes browser cookie with given name, domain and path. cookieName - Name of the cookie to remove. url - URL to match cooke domain and path.

func (*Page) DeleteCookieWithParams

func (c *Page) DeleteCookieWithParams(v *PageDeleteCookieParams) (*gcdmessage.ChromeResponse, error)

DeleteCookieWithParams - Deletes browser cookie with given name, domain and path.

func (*Page) Disable

func (c *Page) Disable() (*gcdmessage.ChromeResponse, error)

Disables page domain notifications.

func (*Page) Enable

func (c *Page) Enable() (*gcdmessage.ChromeResponse, error)

Enables page domain notifications.

func (*Page) GenerateTestReport

func (c *Page) GenerateTestReport(message string, group string) (*gcdmessage.ChromeResponse, error)

GenerateTestReport - Generates a report for testing. message - Message to be displayed in the report. group - Specifies the endpoint group to deliver the report to.

func (*Page) GenerateTestReportWithParams

func (c *Page) GenerateTestReportWithParams(v *PageGenerateTestReportParams) (*gcdmessage.ChromeResponse, error)

GenerateTestReportWithParams - Generates a report for testing.

func (*Page) GetAppManifest

GetAppManifest - Returns - url - Manifest location. errors - data - Manifest content. parsed - Parsed manifest properties

func (*Page) GetCookies

func (c *Page) GetCookies() ([]*NetworkCookie, error)

GetCookies - Returns all browser cookies. Depending on the backend support, will return detailed cookie information in the `cookies` field. Returns - cookies - Array of cookie objects.

func (*Page) GetFrameTree

func (c *Page) GetFrameTree() (*PageFrameTree, error)

GetFrameTree - Returns present frame tree structure. Returns - frameTree - Present frame tree structure.

func (*Page) GetInstallabilityErrors added in v1.0.6

func (c *Page) GetInstallabilityErrors() ([]*PageInstallabilityError, error)

GetInstallabilityErrors - Returns - installabilityErrors -

func (*Page) GetLayoutMetrics

func (c *Page) GetLayoutMetrics() (*PageLayoutViewport, *PageVisualViewport, *DOMRect, error)

GetLayoutMetrics - Returns metrics relating to the layouting of the page, such as viewport bounds/scale. Returns - layoutViewport - Metrics relating to the layout viewport. visualViewport - Metrics relating to the visual viewport. contentSize - Size of scrollable area.

func (*Page) GetManifestIcons added in v1.0.9

func (c *Page) GetManifestIcons() (string, error)

GetManifestIcons - Returns - primaryIcon -

func (*Page) GetNavigationHistory

func (c *Page) GetNavigationHistory() (int, []*PageNavigationEntry, error)

GetNavigationHistory - Returns navigation history for the current page. Returns - currentIndex - Index of the current navigation history entry. entries - Array of navigation history entries.

func (*Page) GetResourceContent

func (c *Page) GetResourceContent(frameId string, url string) (string, bool, error)

GetResourceContent - Returns content of the given resource. frameId - Frame id to get resource for. url - URL of the resource to get content for. Returns - content - Resource content. base64Encoded - True, if content was served as base64.

func (*Page) GetResourceContentWithParams

func (c *Page) GetResourceContentWithParams(v *PageGetResourceContentParams) (string, bool, error)

GetResourceContentWithParams - Returns content of the given resource. Returns - content - Resource content. base64Encoded - True, if content was served as base64.

func (*Page) GetResourceTree

func (c *Page) GetResourceTree() (*PageFrameResourceTree, error)

GetResourceTree - Returns present frame / resource tree structure. Returns - frameTree - Present frame / resource tree structure.

func (*Page) HandleJavaScriptDialog

func (c *Page) HandleJavaScriptDialog(accept bool, promptText string) (*gcdmessage.ChromeResponse, error)

HandleJavaScriptDialog - Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload). accept - Whether to accept or dismiss the dialog. promptText - The text to enter into the dialog prompt before accepting. Used only if this is a prompt dialog.

func (*Page) HandleJavaScriptDialogWithParams

func (c *Page) HandleJavaScriptDialogWithParams(v *PageHandleJavaScriptDialogParams) (*gcdmessage.ChromeResponse, error)

HandleJavaScriptDialogWithParams - Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).

func (*Page) Navigate

func (c *Page) Navigate(url string, referrer string, transitionType string, frameId string, referrerPolicy string) (string, string, string, error)

Navigate - Navigates current page to the given URL. url - URL to navigate the page to. referrer - Referrer URL. transitionType - Intended transition type. enum values: link, typed, address_bar, auto_bookmark, auto_subframe, manual_subframe, generated, auto_toplevel, form_submit, reload, keyword, keyword_generated, other frameId - Frame id to navigate, if not specified navigates the top frame. referrerPolicy - Referrer-policy used for the navigation. enum values: noReferrer, noReferrerWhenDowngrade, origin, originWhenCrossOrigin, sameOrigin, strictOrigin, strictOriginWhenCrossOrigin, unsafeUrl Returns - frameId - Frame id that has navigated (or failed to navigate) loaderId - Loader identifier. errorText - User friendly error message, present if and only if navigation has failed.

func (*Page) NavigateToHistoryEntry

func (c *Page) NavigateToHistoryEntry(entryId int) (*gcdmessage.ChromeResponse, error)

NavigateToHistoryEntry - Navigates current page to the given history entry. entryId - Unique id of the entry to navigate to.

func (*Page) NavigateToHistoryEntryWithParams

func (c *Page) NavigateToHistoryEntryWithParams(v *PageNavigateToHistoryEntryParams) (*gcdmessage.ChromeResponse, error)

NavigateToHistoryEntryWithParams - Navigates current page to the given history entry.

func (*Page) NavigateWithParams

func (c *Page) NavigateWithParams(v *PageNavigateParams) (string, string, string, error)

NavigateWithParams - Navigates current page to the given URL. Returns - frameId - Frame id that has navigated (or failed to navigate) loaderId - Loader identifier. errorText - User friendly error message, present if and only if navigation has failed.

func (*Page) PrintToPDF

func (c *Page) PrintToPDF(landscape bool, displayHeaderFooter bool, printBackground bool, scale float64, paperWidth float64, paperHeight float64, marginTop float64, marginBottom float64, marginLeft float64, marginRight float64, pageRanges string, ignoreInvalidPageRanges bool, headerTemplate string, footerTemplate string, preferCSSPageSize bool, transferMode string) (string, string, error)

PrintToPDF - Print page as PDF. landscape - Paper orientation. Defaults to false. displayHeaderFooter - Display header and footer. Defaults to false. printBackground - Print background graphics. Defaults to false. scale - Scale of the webpage rendering. Defaults to 1. paperWidth - Paper width in inches. Defaults to 8.5 inches. paperHeight - Paper height in inches. Defaults to 11 inches. marginTop - Top margin in inches. Defaults to 1cm (~0.4 inches). marginBottom - Bottom margin in inches. Defaults to 1cm (~0.4 inches). marginLeft - Left margin in inches. Defaults to 1cm (~0.4 inches). marginRight - Right margin in inches. Defaults to 1cm (~0.4 inches). pageRanges - Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages. ignoreInvalidPageRanges - Whether to silently ignore invalid but successfully parsed page ranges, such as '3-2'. Defaults to false. headerTemplate - HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them: - `date`: formatted print date - `title`: document title - `url`: document location - `pageNumber`: current page number - `totalPages`: total pages in the document For example, `<span class=title></span>` would generate span containing the title. footerTemplate - HTML template for the print footer. Should use the same format as the `headerTemplate`. preferCSSPageSize - Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size. transferMode - return as stream Returns - data - Base64-encoded pdf data. Empty if |returnAsStream| is specified. stream - A handle of the stream that holds resulting PDF data.

func (*Page) PrintToPDFWithParams

func (c *Page) PrintToPDFWithParams(v *PagePrintToPDFParams) (string, string, error)

PrintToPDFWithParams - Print page as PDF. Returns - data - Base64-encoded pdf data. Empty if |returnAsStream| is specified. stream - A handle of the stream that holds resulting PDF data.

func (*Page) Reload

func (c *Page) Reload(ignoreCache bool, scriptToEvaluateOnLoad string) (*gcdmessage.ChromeResponse, error)

Reload - Reloads given page optionally ignoring the cache. ignoreCache - If true, browser cache is ignored (as if the user pressed Shift+refresh). scriptToEvaluateOnLoad - If set, the script will be injected into all frames of the inspected page after reload. Argument will be ignored if reloading dataURL origin.

func (*Page) ReloadWithParams

func (c *Page) ReloadWithParams(v *PageReloadParams) (*gcdmessage.ChromeResponse, error)

ReloadWithParams - Reloads given page optionally ignoring the cache.

func (*Page) RemoveScriptToEvaluateOnLoad

func (c *Page) RemoveScriptToEvaluateOnLoad(identifier string) (*gcdmessage.ChromeResponse, error)

RemoveScriptToEvaluateOnLoad - Deprecated, please use removeScriptToEvaluateOnNewDocument instead. identifier -

func (*Page) RemoveScriptToEvaluateOnLoadWithParams

func (c *Page) RemoveScriptToEvaluateOnLoadWithParams(v *PageRemoveScriptToEvaluateOnLoadParams) (*gcdmessage.ChromeResponse, error)

RemoveScriptToEvaluateOnLoadWithParams - Deprecated, please use removeScriptToEvaluateOnNewDocument instead.

func (*Page) RemoveScriptToEvaluateOnNewDocument

func (c *Page) RemoveScriptToEvaluateOnNewDocument(identifier string) (*gcdmessage.ChromeResponse, error)

RemoveScriptToEvaluateOnNewDocument - Removes given script from the list. identifier -

func (*Page) RemoveScriptToEvaluateOnNewDocumentWithParams

func (c *Page) RemoveScriptToEvaluateOnNewDocumentWithParams(v *PageRemoveScriptToEvaluateOnNewDocumentParams) (*gcdmessage.ChromeResponse, error)

RemoveScriptToEvaluateOnNewDocumentWithParams - Removes given script from the list.

func (*Page) ResetNavigationHistory added in v1.0.3

func (c *Page) ResetNavigationHistory() (*gcdmessage.ChromeResponse, error)

Resets navigation history for the current page.

func (*Page) ScreencastFrameAck

func (c *Page) ScreencastFrameAck(sessionId int) (*gcdmessage.ChromeResponse, error)

ScreencastFrameAck - Acknowledges that a screencast frame has been received by the frontend. sessionId - Frame number.

func (*Page) ScreencastFrameAckWithParams

func (c *Page) ScreencastFrameAckWithParams(v *PageScreencastFrameAckParams) (*gcdmessage.ChromeResponse, error)

ScreencastFrameAckWithParams - Acknowledges that a screencast frame has been received by the frontend.

func (*Page) SearchInResource

func (c *Page) SearchInResource(frameId string, url string, query string, caseSensitive bool, isRegex bool) ([]*DebuggerSearchMatch, error)

SearchInResource - Searches for given string in resource content. frameId - Frame id for resource to search in. url - URL of the resource to search in. query - String to search for. caseSensitive - If true, search is case sensitive. isRegex - If true, treats string parameter as regex. Returns - result - List of search matches.

func (*Page) SearchInResourceWithParams

func (c *Page) SearchInResourceWithParams(v *PageSearchInResourceParams) ([]*DebuggerSearchMatch, error)

SearchInResourceWithParams - Searches for given string in resource content. Returns - result - List of search matches.

func (*Page) SetAdBlockingEnabled

func (c *Page) SetAdBlockingEnabled(enabled bool) (*gcdmessage.ChromeResponse, error)

SetAdBlockingEnabled - Enable Chrome's experimental ad filter on all sites. enabled - Whether to block ads.

func (*Page) SetAdBlockingEnabledWithParams

func (c *Page) SetAdBlockingEnabledWithParams(v *PageSetAdBlockingEnabledParams) (*gcdmessage.ChromeResponse, error)

SetAdBlockingEnabledWithParams - Enable Chrome's experimental ad filter on all sites.

func (*Page) SetBypassCSP

func (c *Page) SetBypassCSP(enabled bool) (*gcdmessage.ChromeResponse, error)

SetBypassCSP - Enable page Content Security Policy by-passing. enabled - Whether to bypass page CSP.

func (*Page) SetBypassCSPWithParams

func (c *Page) SetBypassCSPWithParams(v *PageSetBypassCSPParams) (*gcdmessage.ChromeResponse, error)

SetBypassCSPWithParams - Enable page Content Security Policy by-passing.

func (*Page) SetDeviceMetricsOverride

func (c *Page) SetDeviceMetricsOverride(width int, height int, deviceScaleFactor float64, mobile bool, scale float64, screenWidth int, screenHeight int, positionX int, positionY int, dontSetVisibleSize bool, screenOrientation *EmulationScreenOrientation, viewport *PageViewport) (*gcdmessage.ChromeResponse, error)

SetDeviceMetricsOverride - Overrides the values of device screen dimensions (window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media query results). width - Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override. height - Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override. deviceScaleFactor - Overriding device scale factor value. 0 disables the override. 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. screenWidth - Overriding screen width value in pixels (minimum 0, maximum 10000000). screenHeight - Overriding screen height value in pixels (minimum 0, maximum 10000000). positionX - Overriding view X position on screen in pixels (minimum 0, maximum 10000000). positionY - Overriding view Y position on screen in pixels (minimum 0, maximum 10000000). dontSetVisibleSize - Do not set visible view size, rely upon explicit setVisibleSize call. screenOrientation - Screen orientation override. viewport - The viewport dimensions and scale. If not set, the override is cleared.

func (*Page) SetDeviceMetricsOverrideWithParams

func (c *Page) SetDeviceMetricsOverrideWithParams(v *PageSetDeviceMetricsOverrideParams) (*gcdmessage.ChromeResponse, error)

SetDeviceMetricsOverrideWithParams - Overrides the values of device screen dimensions (window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media query results).

func (*Page) SetDeviceOrientationOverride

func (c *Page) SetDeviceOrientationOverride(alpha float64, beta float64, gamma float64) (*gcdmessage.ChromeResponse, error)

SetDeviceOrientationOverride - Overrides the Device Orientation. alpha - Mock alpha beta - Mock beta gamma - Mock gamma

func (*Page) SetDeviceOrientationOverrideWithParams

func (c *Page) SetDeviceOrientationOverrideWithParams(v *PageSetDeviceOrientationOverrideParams) (*gcdmessage.ChromeResponse, error)

SetDeviceOrientationOverrideWithParams - Overrides the Device Orientation.

func (*Page) SetDocumentContent

func (c *Page) SetDocumentContent(frameId string, html string) (*gcdmessage.ChromeResponse, error)

SetDocumentContent - Sets given markup as the document's HTML. frameId - Frame id to set HTML for. html - HTML content to set.

func (*Page) SetDocumentContentWithParams

func (c *Page) SetDocumentContentWithParams(v *PageSetDocumentContentParams) (*gcdmessage.ChromeResponse, error)

SetDocumentContentWithParams - Sets given markup as the document's HTML.

func (*Page) SetDownloadBehavior

func (c *Page) SetDownloadBehavior(behavior string, downloadPath string) (*gcdmessage.ChromeResponse, error)

SetDownloadBehavior - Set the behavior when downloading a file. behavior - Whether to allow all or deny all download requests, or use default Chrome behavior if available (otherwise deny). downloadPath - The default path to save downloaded files to. This is requred if behavior is set to 'allow'

func (*Page) SetDownloadBehaviorWithParams

func (c *Page) SetDownloadBehaviorWithParams(v *PageSetDownloadBehaviorParams) (*gcdmessage.ChromeResponse, error)

SetDownloadBehaviorWithParams - Set the behavior when downloading a file.

func (*Page) SetFontFamilies

func (c *Page) SetFontFamilies(fontFamilies *PageFontFamilies) (*gcdmessage.ChromeResponse, error)

SetFontFamilies - Set generic font families. fontFamilies - Specifies font families to set. If a font family is not specified, it won't be changed.

func (*Page) SetFontFamiliesWithParams

func (c *Page) SetFontFamiliesWithParams(v *PageSetFontFamiliesParams) (*gcdmessage.ChromeResponse, error)

SetFontFamiliesWithParams - Set generic font families.

func (*Page) SetFontSizes

func (c *Page) SetFontSizes(fontSizes *PageFontSizes) (*gcdmessage.ChromeResponse, error)

SetFontSizes - Set default font sizes. fontSizes - Specifies font sizes to set. If a font size is not specified, it won't be changed.

func (*Page) SetFontSizesWithParams

func (c *Page) SetFontSizesWithParams(v *PageSetFontSizesParams) (*gcdmessage.ChromeResponse, error)

SetFontSizesWithParams - Set default font sizes.

func (*Page) SetGeolocationOverride

func (c *Page) SetGeolocationOverride(latitude float64, longitude float64, accuracy float64) (*gcdmessage.ChromeResponse, error)

SetGeolocationOverride - Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position unavailable. latitude - Mock latitude longitude - Mock longitude accuracy - Mock accuracy

func (*Page) SetGeolocationOverrideWithParams

func (c *Page) SetGeolocationOverrideWithParams(v *PageSetGeolocationOverrideParams) (*gcdmessage.ChromeResponse, error)

SetGeolocationOverrideWithParams - Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position unavailable.

func (*Page) SetInterceptFileChooserDialog added in v1.0.7

func (c *Page) SetInterceptFileChooserDialog(enabled bool) (*gcdmessage.ChromeResponse, error)

SetInterceptFileChooserDialog - Intercept file chooser requests and transfer control to protocol clients. When file chooser interception is enabled, native file chooser dialog is not shown. Instead, a protocol event `Page.fileChooserOpened` is emitted. enabled -

func (*Page) SetInterceptFileChooserDialogWithParams added in v1.0.7

func (c *Page) SetInterceptFileChooserDialogWithParams(v *PageSetInterceptFileChooserDialogParams) (*gcdmessage.ChromeResponse, error)

SetInterceptFileChooserDialogWithParams - Intercept file chooser requests and transfer control to protocol clients. When file chooser interception is enabled, native file chooser dialog is not shown. Instead, a protocol event `Page.fileChooserOpened` is emitted.

func (*Page) SetLifecycleEventsEnabled

func (c *Page) SetLifecycleEventsEnabled(enabled bool) (*gcdmessage.ChromeResponse, error)

SetLifecycleEventsEnabled - Controls whether page will emit lifecycle events. enabled - If true, starts emitting lifecycle events.

func (*Page) SetLifecycleEventsEnabledWithParams

func (c *Page) SetLifecycleEventsEnabledWithParams(v *PageSetLifecycleEventsEnabledParams) (*gcdmessage.ChromeResponse, error)

SetLifecycleEventsEnabledWithParams - Controls whether page will emit lifecycle events.

func (*Page) SetProduceCompilationCache

func (c *Page) SetProduceCompilationCache(enabled bool) (*gcdmessage.ChromeResponse, error)

SetProduceCompilationCache - Forces compilation cache to be generated for every subresource script. enabled -

func (*Page) SetProduceCompilationCacheWithParams

func (c *Page) SetProduceCompilationCacheWithParams(v *PageSetProduceCompilationCacheParams) (*gcdmessage.ChromeResponse, error)

SetProduceCompilationCacheWithParams - Forces compilation cache to be generated for every subresource script.

func (*Page) SetTouchEmulationEnabled

func (c *Page) SetTouchEmulationEnabled(enabled bool, configuration string) (*gcdmessage.ChromeResponse, error)

SetTouchEmulationEnabled - Toggles mouse event-based touch event emulation. enabled - Whether the touch event emulation should be enabled. configuration - Touch/gesture events configuration. Default: current platform.

func (*Page) SetTouchEmulationEnabledWithParams

func (c *Page) SetTouchEmulationEnabledWithParams(v *PageSetTouchEmulationEnabledParams) (*gcdmessage.ChromeResponse, error)

SetTouchEmulationEnabledWithParams - Toggles mouse event-based touch event emulation.

func (*Page) SetWebLifecycleState

func (c *Page) SetWebLifecycleState(state string) (*gcdmessage.ChromeResponse, error)

SetWebLifecycleState - Tries to update the web lifecycle state of the page. It will transition the page to the given state according to: https://github.com/WICG/web-lifecycle/ state - Target lifecycle state

func (*Page) SetWebLifecycleStateWithParams

func (c *Page) SetWebLifecycleStateWithParams(v *PageSetWebLifecycleStateParams) (*gcdmessage.ChromeResponse, error)

SetWebLifecycleStateWithParams - Tries to update the web lifecycle state of the page. It will transition the page to the given state according to: https://github.com/WICG/web-lifecycle/

func (*Page) StartScreencast

func (c *Page) StartScreencast(format string, quality int, maxWidth int, maxHeight int, everyNthFrame int) (*gcdmessage.ChromeResponse, error)

StartScreencast - Starts sending each frame using the `screencastFrame` event. format - Image compression format. quality - Compression quality from range [0..100]. maxWidth - Maximum screenshot width. maxHeight - Maximum screenshot height. everyNthFrame - Send every n-th frame.

func (*Page) StartScreencastWithParams

func (c *Page) StartScreencastWithParams(v *PageStartScreencastParams) (*gcdmessage.ChromeResponse, error)

StartScreencastWithParams - Starts sending each frame using the `screencastFrame` event.

func (*Page) StopLoading

func (c *Page) StopLoading() (*gcdmessage.ChromeResponse, error)

Force the page stop all navigations and pending resource fetches.

func (*Page) StopScreencast

func (c *Page) StopScreencast() (*gcdmessage.ChromeResponse, error)

Stops sending each frame in the `screencastFrame`.

func (*Page) WaitForDebugger added in v1.0.3

func (c *Page) WaitForDebugger() (*gcdmessage.ChromeResponse, error)

Pauses page execution. Can be resumed using generic Runtime.runIfWaitingForDebugger.

type PageAddCompilationCacheParams

type PageAddCompilationCacheParams struct {
	//
	Url string `json:"url"`
	// Base64-encoded data
	Data string `json:"data"`
}

type PageAddScriptToEvaluateOnLoadParams

type PageAddScriptToEvaluateOnLoadParams struct {
	//
	ScriptSource string `json:"scriptSource"`
}

type PageAddScriptToEvaluateOnNewDocumentParams

type PageAddScriptToEvaluateOnNewDocumentParams struct {
	//
	Source string `json:"source"`
	// If specified, creates an isolated world with the given name and evaluates given script in it. This world name will be used as the ExecutionContextDescription::name when the corresponding event is emitted.
	WorldName string `json:"worldName,omitempty"`
}

type PageAppManifestError

type PageAppManifestError 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.
}

Error while paring app manifest.

type PageAppManifestParsedProperties added in v1.0.9

type PageAppManifestParsedProperties struct {
	Scope string `json:"scope"` // Computed scope value
}

Parsed app manifest properties.

type PageCaptureScreenshotParams

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

type PageCaptureSnapshotParams added in v1.0.3

type PageCaptureSnapshotParams struct {
	// Format (defaults to mhtml).
	Format string `json:"format,omitempty"`
}

type PageCompilationCacheProducedEvent

type PageCompilationCacheProducedEvent struct {
	Method string `json:"method"`
	Params struct {
		Url  string `json:"url"`  //
		Data string `json:"data"` // Base64-encoded data
	} `json:"Params,omitempty"`
}

Issued for every compilation cache generated. Is only available if Page.setGenerateCompilationCache is enabled.

type PageCreateIsolatedWorldParams

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

type PageDeleteCookieParams

type PageDeleteCookieParams struct {
	// Name of the cookie to remove.
	CookieName string `json:"cookieName"`
	// URL to match cooke domain and path.
	Url string `json:"url"`
}

type PageDomContentEventFiredEvent

type PageDomContentEventFiredEvent struct {
	Method string `json:"method"`
	Params struct {
		Timestamp float64 `json:"timestamp"` //
	} `json:"Params,omitempty"`
}

type PageDownloadProgressEvent added in v1.0.9

type PageDownloadProgressEvent struct {
	Method string `json:"method"`
	Params struct {
		Guid          string  `json:"guid"`          // Global unique identifier of the download.
		TotalBytes    float64 `json:"totalBytes"`    // Total expected bytes to download.
		ReceivedBytes float64 `json:"receivedBytes"` // Total bytes received.
		State         string  `json:"state"`         // Download status.
	} `json:"Params,omitempty"`
}

Fired when download makes progress. Last call has |done| == true.

type PageDownloadWillBeginEvent added in v1.0.6

type PageDownloadWillBeginEvent struct {
	Method string `json:"method"`
	Params struct {
		FrameId           string `json:"frameId"`           // Id of the frame that caused download to begin.
		Guid              string `json:"guid"`              // Global unique identifier of the download.
		Url               string `json:"url"`               // URL of the resource being downloaded.
		SuggestedFilename string `json:"suggestedFilename"` // Suggested file name of the resource (the actual name of the file saved on disk may differ).
	} `json:"Params,omitempty"`
}

Fired when page is about to start a download.

type PageFileChooserOpenedEvent added in v1.0.7

type PageFileChooserOpenedEvent struct {
	Method string `json:"method"`
	Params struct {
		FrameId       string `json:"frameId"`       // Id of the frame containing input node.
		BackendNodeId int    `json:"backendNodeId"` // Input node id.
		Mode          string `json:"mode"`          // Input mode.
	} `json:"Params,omitempty"`
}

Emitted only when `page.interceptFileChooser` is enabled.

type PageFontFamilies

type PageFontFamilies struct {
	Standard   string `json:"standard,omitempty"`   // The standard font-family.
	Fixed      string `json:"fixed,omitempty"`      // The fixed font-family.
	Serif      string `json:"serif,omitempty"`      // The serif font-family.
	SansSerif  string `json:"sansSerif,omitempty"`  // The sansSerif font-family.
	Cursive    string `json:"cursive,omitempty"`    // The cursive font-family.
	Fantasy    string `json:"fantasy,omitempty"`    // The fantasy font-family.
	Pictograph string `json:"pictograph,omitempty"` // The pictograph font-family.
}

Generic font families collection.

type PageFontSizes

type PageFontSizes struct {
	Standard int `json:"standard,omitempty"` // Default standard font size.
	Fixed    int `json:"fixed,omitempty"`    // Default fixed font size.
}

Default font sizes.

type PageFrame

type PageFrame struct {
	Id             string `json:"id"`                       // Frame unique identifier.
	ParentId       string `json:"parentId,omitempty"`       // Parent frame identifier.
	LoaderId       string `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 without fragment.
	UrlFragment    string `json:"urlFragment,omitempty"`    // Frame document's URL fragment including the '#'.
	SecurityOrigin string `json:"securityOrigin"`           // Frame document's security origin.
	MimeType       string `json:"mimeType"`                 // Frame document's mimeType as determined by the browser.
	UnreachableUrl string `json:"unreachableUrl,omitempty"` // If the frame failed to load, this contains the URL that could not be loaded. Note that unlike url above, this URL may contain a fragment.
}

Information about the Frame on the page.

type PageFrameAttachedEvent

type PageFrameAttachedEvent struct {
	Method string `json:"method"`
	Params struct {
		FrameId       string             `json:"frameId"`         // Id of the frame that has been attached.
		ParentFrameId string             `json:"parentFrameId"`   // Parent frame identifier.
		Stack         *RuntimeStackTrace `json:"stack,omitempty"` // JavaScript stack trace of when frame was attached, only set if frame initiated from script.
	} `json:"Params,omitempty"`
}

Fired when frame has been attached to its parent.

type PageFrameClearedScheduledNavigationEvent

type PageFrameClearedScheduledNavigationEvent struct {
	Method string `json:"method"`
	Params struct {
		FrameId string `json:"frameId"` // Id of the frame that has cleared its scheduled navigation.
	} `json:"Params,omitempty"`
}

Fired when frame no longer has a scheduled navigation.

type PageFrameDetachedEvent

type PageFrameDetachedEvent struct {
	Method string `json:"method"`
	Params struct {
		FrameId string `json:"frameId"` // Id of the frame that has been detached.
	} `json:"Params,omitempty"`
}

Fired when frame has been detached from its parent.

type PageFrameNavigatedEvent

type PageFrameNavigatedEvent struct {
	Method string `json:"method"`
	Params struct {
		Frame *PageFrame `json:"frame"` // Frame object.
	} `json:"Params,omitempty"`
}

Fired once navigation of the frame has completed. Frame is now associated with the new loader.

type PageFrameRequestedNavigationEvent added in v1.0.6

type PageFrameRequestedNavigationEvent struct {
	Method string `json:"method"`
	Params struct {
		FrameId     string `json:"frameId"`     // Id of the frame that is being navigated.
		Reason      string `json:"reason"`      // The reason for the navigation. enum values: formSubmissionGet, formSubmissionPost, httpHeaderRefresh, scriptInitiated, metaTagRefresh, pageBlockInterstitial, reload, anchorClick
		Url         string `json:"url"`         // The destination URL for the requested navigation.
		Disposition string `json:"disposition"` // The disposition for the navigation. enum values: currentTab, newTab, newWindow, download
	} `json:"Params,omitempty"`
}

Fired when a renderer-initiated navigation is requested. Navigation may still be cancelled after the event is issued.

type PageFrameResource

type PageFrameResource struct {
	Url          string  `json:"url"`                    // Resource URL.
	Type         string  `json:"type"`                   // Type of this resource. enum values: Document, Stylesheet, Image, Media, Font, Script, TextTrack, XHR, Fetch, EventSource, WebSocket, Manifest, SignedExchange, Ping, CSPViolationReport, Other
	MimeType     string  `json:"mimeType"`               // Resource mimeType as determined by the browser.
	LastModified float64 `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.
}

Information about the Resource on the page.

type PageFrameResourceTree

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

Information about the Frame hierarchy along with their cached resources.

type PageFrameScheduledNavigationEvent

type PageFrameScheduledNavigationEvent struct {
	Method string `json:"method"`
	Params struct {
		FrameId string  `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  string  `json:"reason"`  // The reason for the navigation. enum values: formSubmissionGet, formSubmissionPost, httpHeaderRefresh, scriptInitiated, metaTagRefresh, pageBlockInterstitial, reload, anchorClick
		Url     string  `json:"url"`     // The destination URL for the scheduled navigation.
	} `json:"Params,omitempty"`
}

Fired when frame schedules a potential navigation.

type PageFrameStartedLoadingEvent

type PageFrameStartedLoadingEvent struct {
	Method string `json:"method"`
	Params struct {
		FrameId string `json:"frameId"` // Id of the frame that has started loading.
	} `json:"Params,omitempty"`
}

Fired when frame has started loading.

type PageFrameStoppedLoadingEvent

type PageFrameStoppedLoadingEvent struct {
	Method string `json:"method"`
	Params struct {
		FrameId string `json:"frameId"` // Id of the frame that has stopped loading.
	} `json:"Params,omitempty"`
}

Fired when frame has stopped loading.

type PageFrameTree

type PageFrameTree struct {
	Frame       *PageFrame       `json:"frame"`                 // Frame information for this tree item.
	ChildFrames []*PageFrameTree `json:"childFrames,omitempty"` // Child frames.
}

Information about the Frame hierarchy.

type PageGenerateTestReportParams

type PageGenerateTestReportParams struct {
	// Message to be displayed in the report.
	Message string `json:"message"`
	// Specifies the endpoint group to deliver the report to.
	Group string `json:"group,omitempty"`
}

type PageGetResourceContentParams

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

type PageHandleJavaScriptDialogParams

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

type PageInstallabilityError added in v1.0.9

type PageInstallabilityError struct {
	ErrorId        string                             `json:"errorId"`        // The error id (e.g. 'manifest-missing-suitable-icon').
	ErrorArguments []*PageInstallabilityErrorArgument `json:"errorArguments"` // The list of error arguments (e.g. {name:'minimum-icon-size-in-pixels', value:'64'}).
}

The installability error

type PageInstallabilityErrorArgument added in v1.0.9

type PageInstallabilityErrorArgument struct {
	Name  string `json:"name"`  // Argument name (e.g. name:'minimum-icon-size-in-pixels').
	Value string `json:"value"` // Argument value (e.g. value:'64').
}

No Description.

type PageJavascriptDialogClosedEvent

type PageJavascriptDialogClosedEvent struct {
	Method string `json:"method"`
	Params struct {
		Result    bool   `json:"result"`    // Whether dialog was confirmed.
		UserInput string `json:"userInput"` // User input in case of prompt.
	} `json:"Params,omitempty"`
}

Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been closed.

type PageJavascriptDialogOpeningEvent

type PageJavascriptDialogOpeningEvent struct {
	Method string `json:"method"`
	Params struct {
		Url               string `json:"url"`                     // Frame url.
		Message           string `json:"message"`                 // Message that will be displayed by the dialog.
		Type              string `json:"type"`                    // Dialog type. enum values: alert, confirm, prompt, beforeunload
		HasBrowserHandler bool   `json:"hasBrowserHandler"`       // True iff browser is capable showing or acting on the given dialog. When browser has no dialog handler for given target, calling alert while Page domain is engaged will stall the page execution. Execution can be resumed via calling Page.handleJavaScriptDialog.
		DefaultPrompt     string `json:"defaultPrompt,omitempty"` // Default dialog prompt.
	} `json:"Params,omitempty"`
}

Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to open.

type PageLayoutViewport

type PageLayoutViewport 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.
}

Layout viewport position and dimensions.

type PageLifecycleEventEvent

type PageLifecycleEventEvent struct {
	Method string `json:"method"`
	Params struct {
		FrameId   string  `json:"frameId"`   // Id of the frame.
		LoaderId  string  `json:"loaderId"`  // Loader identifier. Empty string if the request is fetched from worker.
		Name      string  `json:"name"`      //
		Timestamp float64 `json:"timestamp"` //
	} `json:"Params,omitempty"`
}

Fired for top level page lifecycle events such as navigation, load, paint, etc.

type PageLoadEventFiredEvent

type PageLoadEventFiredEvent struct {
	Method string `json:"method"`
	Params struct {
		Timestamp float64 `json:"timestamp"` //
	} `json:"Params,omitempty"`
}
type PageNavigateParams struct {
	// URL to navigate the page to.
	Url string `json:"url"`
	// Referrer URL.
	Referrer string `json:"referrer,omitempty"`
	// Intended transition type. enum values: link, typed, address_bar, auto_bookmark, auto_subframe, manual_subframe, generated, auto_toplevel, form_submit, reload, keyword, keyword_generated, other
	TransitionType string `json:"transitionType,omitempty"`
	// Frame id to navigate, if not specified navigates the top frame.
	FrameId string `json:"frameId,omitempty"`
	// Referrer-policy used for the navigation. enum values: noReferrer, noReferrerWhenDowngrade, origin, originWhenCrossOrigin, sameOrigin, strictOrigin, strictOriginWhenCrossOrigin, unsafeUrl
	ReferrerPolicy string `json:"referrerPolicy,omitempty"`
}
type PageNavigateToHistoryEntryParams struct {
	// Unique id of the entry to navigate to.
	EntryId int `json:"entryId"`
}
type PageNavigatedWithinDocumentEvent struct {
	Method string `json:"method"`
	Params struct {
		FrameId string `json:"frameId"` // Id of the frame.
		Url     string `json:"url"`     // Frame's new url.
	} `json:"Params,omitempty"`
}

Fired when same-document navigation happens, e.g. due to history API usage or anchor navigation.

type PageNavigationEntry 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 string `json:"transitionType"` // Transition type. enum values: link, typed, address_bar, auto_bookmark, auto_subframe, manual_subframe, generated, auto_toplevel, form_submit, reload, keyword, keyword_generated, other
}

Navigation history entry.

type PagePrintToPDFParams

type PagePrintToPDFParams struct {
	// Paper orientation. Defaults to false.
	Landscape bool `json:"landscape,omitempty"`
	// Display header and footer. Defaults to false.
	DisplayHeaderFooter bool `json:"displayHeaderFooter,omitempty"`
	// Print background graphics. Defaults to false.
	PrintBackground bool `json:"printBackground,omitempty"`
	// Scale of the webpage rendering. Defaults to 1.
	Scale float64 `json:"scale,omitempty"`
	// Paper width in inches. Defaults to 8.5 inches.
	PaperWidth float64 `json:"paperWidth,omitempty"`
	// Paper height in inches. Defaults to 11 inches.
	PaperHeight float64 `json:"paperHeight,omitempty"`
	// Top margin in inches. Defaults to 1cm (~0.4 inches).
	MarginTop float64 `json:"marginTop,omitempty"`
	// Bottom margin in inches. Defaults to 1cm (~0.4 inches).
	MarginBottom float64 `json:"marginBottom,omitempty"`
	// Left margin in inches. Defaults to 1cm (~0.4 inches).
	MarginLeft float64 `json:"marginLeft,omitempty"`
	// Right margin in inches. Defaults to 1cm (~0.4 inches).
	MarginRight float64 `json:"marginRight,omitempty"`
	// Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.
	PageRanges string `json:"pageRanges,omitempty"`
	// Whether to silently ignore invalid but successfully parsed page ranges, such as '3-2'. Defaults to false.
	IgnoreInvalidPageRanges bool `json:"ignoreInvalidPageRanges,omitempty"`
	// HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them: - `date`: formatted print date - `title`: document title - `url`: document location - `pageNumber`: current page number - `totalPages`: total pages in the document  For example, `<span class=title></span>` would generate span containing the title.
	HeaderTemplate string `json:"headerTemplate,omitempty"`
	// HTML template for the print footer. Should use the same format as the `headerTemplate`.
	FooterTemplate string `json:"footerTemplate,omitempty"`
	// Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size.
	PreferCSSPageSize bool `json:"preferCSSPageSize,omitempty"`
	// return as stream
	TransferMode string `json:"transferMode,omitempty"`
}

type PageReloadParams

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

type PageRemoveScriptToEvaluateOnLoadParams

type PageRemoveScriptToEvaluateOnLoadParams struct {
	//
	Identifier string `json:"identifier"`
}

type PageRemoveScriptToEvaluateOnNewDocumentParams

type PageRemoveScriptToEvaluateOnNewDocumentParams struct {
	//
	Identifier string `json:"identifier"`
}

type PageScreencastFrameAckParams

type PageScreencastFrameAckParams struct {
	// Frame number.
	SessionId int `json:"sessionId"`
}

type PageScreencastFrameEvent

type PageScreencastFrameEvent struct {
	Method string `json:"method"`
	Params struct {
		Data      string                       `json:"data"`      // Base64-encoded compressed image.
		Metadata  *PageScreencastFrameMetadata `json:"metadata"`  // Screencast frame metadata.
		SessionId int                          `json:"sessionId"` // Frame number.
	} `json:"Params,omitempty"`
}

Compressed image data requested by the `startScreencast`.

type PageScreencastFrameMetadata

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

Screencast frame metadata.

type PageScreencastVisibilityChangedEvent

type PageScreencastVisibilityChangedEvent struct {
	Method string `json:"method"`
	Params struct {
		Visible bool `json:"visible"` // True if the page is visible.
	} `json:"Params,omitempty"`
}

Fired when the page with currently enabled screencast was shown or hidden `.

type PageSearchInResourceParams

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

type PageSetAdBlockingEnabledParams

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

type PageSetBypassCSPParams

type PageSetBypassCSPParams struct {
	// Whether to bypass page CSP.
	Enabled bool `json:"enabled"`
}

type PageSetDeviceMetricsOverrideParams

type PageSetDeviceMetricsOverrideParams struct {
	// Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.
	Width int `json:"width"`
	// Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.
	Height int `json:"height"`
	// Overriding device scale factor value. 0 disables the override.
	DeviceScaleFactor float64 `json:"deviceScaleFactor"`
	// Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more.
	Mobile bool `json:"mobile"`
	// Scale to apply to resulting view image.
	Scale float64 `json:"scale,omitempty"`
	// Overriding screen width value in pixels (minimum 0, maximum 10000000).
	ScreenWidth int `json:"screenWidth,omitempty"`
	// Overriding screen height value in pixels (minimum 0, maximum 10000000).
	ScreenHeight int `json:"screenHeight,omitempty"`
	// Overriding view X position on screen in pixels (minimum 0, maximum 10000000).
	PositionX int `json:"positionX,omitempty"`
	// Overriding view Y position on screen in pixels (minimum 0, maximum 10000000).
	PositionY int `json:"positionY,omitempty"`
	// Do not set visible view size, rely upon explicit setVisibleSize call.
	DontSetVisibleSize bool `json:"dontSetVisibleSize,omitempty"`
	// Screen orientation override.
	ScreenOrientation *EmulationScreenOrientation `json:"screenOrientation,omitempty"`
	// The viewport dimensions and scale. If not set, the override is cleared.
	Viewport *PageViewport `json:"viewport,omitempty"`
}

type PageSetDeviceOrientationOverrideParams

type PageSetDeviceOrientationOverrideParams struct {
	// Mock alpha
	Alpha float64 `json:"alpha"`
	// Mock beta
	Beta float64 `json:"beta"`
	// Mock gamma
	Gamma float64 `json:"gamma"`
}

type PageSetDocumentContentParams

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

type PageSetDownloadBehaviorParams

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

type PageSetFontFamiliesParams

type PageSetFontFamiliesParams struct {
	// Specifies font families to set. If a font family is not specified, it won't be changed.
	FontFamilies *PageFontFamilies `json:"fontFamilies"`
}

type PageSetFontSizesParams

type PageSetFontSizesParams struct {
	// Specifies font sizes to set. If a font size is not specified, it won't be changed.
	FontSizes *PageFontSizes `json:"fontSizes"`
}

type PageSetGeolocationOverrideParams

type PageSetGeolocationOverrideParams struct {
	// Mock latitude
	Latitude float64 `json:"latitude,omitempty"`
	// Mock longitude
	Longitude float64 `json:"longitude,omitempty"`
	// Mock accuracy
	Accuracy float64 `json:"accuracy,omitempty"`
}

type PageSetInterceptFileChooserDialogParams added in v1.0.7

type PageSetInterceptFileChooserDialogParams struct {
	//
	Enabled bool `json:"enabled"`
}

type PageSetLifecycleEventsEnabledParams

type PageSetLifecycleEventsEnabledParams struct {
	// If true, starts emitting lifecycle events.
	Enabled bool `json:"enabled"`
}

type PageSetProduceCompilationCacheParams

type PageSetProduceCompilationCacheParams struct {
	//
	Enabled bool `json:"enabled"`
}

type PageSetTouchEmulationEnabledParams

type PageSetTouchEmulationEnabledParams struct {
	// Whether the touch event emulation should be enabled.
	Enabled bool `json:"enabled"`
	// Touch/gesture events configuration. Default: current platform.
	Configuration string `json:"configuration,omitempty"`
}

type PageSetWebLifecycleStateParams

type PageSetWebLifecycleStateParams struct {
	// Target lifecycle state
	State string `json:"state"`
}

type PageStartScreencastParams

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

type PageViewport

type PageViewport struct {
	X      float64 `json:"x"`      // X offset in device independent pixels (dip).
	Y      float64 `json:"y"`      // Y offset in device independent pixels (dip).
	Width  float64 `json:"width"`  // Rectangle width in device independent pixels (dip).
	Height float64 `json:"height"` // Rectangle height in device independent pixels (dip).
	Scale  float64 `json:"scale"`  // Page scale factor.
}

Viewport for capturing screenshot.

type PageVisualViewport

type PageVisualViewport 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).
	Zoom         float64 `json:"zoom,omitempty"` // Page zoom factor (CSS to device independent pixels ratio).
}

Visual viewport position, dimensions, and scale.

type PageWindowOpenEvent

type PageWindowOpenEvent struct {
	Method string `json:"method"`
	Params struct {
		Url            string   `json:"url"`            // The URL for the new window.
		WindowName     string   `json:"windowName"`     // Window name.
		WindowFeatures []string `json:"windowFeatures"` // An array of enabled window features.
		UserGesture    bool     `json:"userGesture"`    // Whether or not it was triggered by user gesture.
	} `json:"Params,omitempty"`
}

Fired when a new window is going to be opened, via window.open(), link click, form submission, etc.

type Performance

type Performance struct {
	// contains filtered or unexported fields
}

func NewPerformance

func NewPerformance(target gcdmessage.ChromeTargeter) *Performance

func (*Performance) Disable

func (c *Performance) Disable() (*gcdmessage.ChromeResponse, error)

Disable collecting and reporting metrics.

func (*Performance) Enable

func (c *Performance) Enable(timeDomain string) (*gcdmessage.ChromeResponse, error)

Enable - Enable collecting and reporting metrics. timeDomain - Time domain to use for collecting and reporting duration metrics.

func (*Performance) EnableWithParams added in v1.0.9

EnableWithParams - Enable collecting and reporting metrics.

func (*Performance) GetMetrics

func (c *Performance) GetMetrics() ([]*PerformanceMetric, error)

GetMetrics - Retrieve current values of run-time metrics. Returns - metrics - Current values for run-time metrics.

func (*Performance) SetTimeDomain

func (c *Performance) SetTimeDomain(timeDomain string) (*gcdmessage.ChromeResponse, error)

SetTimeDomain - Sets time domain to use for collecting and reporting duration metrics. Note that this must be called before enabling metrics collection. Calling this method while metrics collection is enabled returns an error. timeDomain - Time domain

func (*Performance) SetTimeDomainWithParams

func (c *Performance) SetTimeDomainWithParams(v *PerformanceSetTimeDomainParams) (*gcdmessage.ChromeResponse, error)

SetTimeDomainWithParams - Sets time domain to use for collecting and reporting duration metrics. Note that this must be called before enabling metrics collection. Calling this method while metrics collection is enabled returns an error.

type PerformanceEnableParams added in v1.0.9

type PerformanceEnableParams struct {
	// Time domain to use for collecting and reporting duration metrics.
	TimeDomain string `json:"timeDomain,omitempty"`
}

type PerformanceMetric

type PerformanceMetric struct {
	Name  string  `json:"name"`  // Metric name.
	Value float64 `json:"value"` // Metric value.
}

Run-time execution metric.

type PerformanceMetricsEvent

type PerformanceMetricsEvent struct {
	Method string `json:"method"`
	Params struct {
		Metrics []*PerformanceMetric `json:"metrics"` // Current values of the metrics.
		Title   string               `json:"title"`   // Timestamp title.
	} `json:"Params,omitempty"`
}

Current values of the metrics.

type PerformanceSetTimeDomainParams

type PerformanceSetTimeDomainParams struct {
	// Time domain
	TimeDomain string `json:"timeDomain"`
}

type Profiler

type Profiler struct {
	// contains filtered or unexported fields
}

func NewProfiler

func NewProfiler(target gcdmessage.ChromeTargeter) *Profiler

func (*Profiler) Disable

func (c *Profiler) Disable() (*gcdmessage.ChromeResponse, error)

func (*Profiler) DisableRuntimeCallStats added in v1.0.9

func (c *Profiler) DisableRuntimeCallStats() (*gcdmessage.ChromeResponse, error)

Disable run time call stats collection.

func (*Profiler) Enable

func (c *Profiler) Enable() (*gcdmessage.ChromeResponse, error)

func (*Profiler) EnableRuntimeCallStats added in v1.0.9

func (c *Profiler) EnableRuntimeCallStats() (*gcdmessage.ChromeResponse, error)

Enable run time call stats collection.

func (*Profiler) GetBestEffortCoverage

func (c *Profiler) GetBestEffortCoverage() ([]*ProfilerScriptCoverage, error)

GetBestEffortCoverage - Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. Returns - result - Coverage data for the current isolate.

func (*Profiler) GetRuntimeCallStats added in v1.0.9

func (c *Profiler) GetRuntimeCallStats() ([]*ProfilerCounterInfo, error)

GetRuntimeCallStats - Retrieve run time call stats. Returns - result - Collected counter information.

func (*Profiler) SetSamplingInterval

func (c *Profiler) SetSamplingInterval(interval int) (*gcdmessage.ChromeResponse, error)

SetSamplingInterval - Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. interval - New sampling interval in microseconds.

func (*Profiler) SetSamplingIntervalWithParams

func (c *Profiler) SetSamplingIntervalWithParams(v *ProfilerSetSamplingIntervalParams) (*gcdmessage.ChromeResponse, error)

SetSamplingIntervalWithParams - Changes CPU profiler sampling interval. Must be called before CPU profiles recording started.

func (*Profiler) Start

func (c *Profiler) Start() (*gcdmessage.ChromeResponse, error)

func (*Profiler) StartPreciseCoverage

func (c *Profiler) StartPreciseCoverage(callCount bool, detailed bool, allowTriggeredUpdates bool) (float64, error)

StartPreciseCoverage - Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters. callCount - Collect accurate call counts beyond simple 'covered' or 'not covered'. detailed - Collect block-based coverage. allowTriggeredUpdates - Allow the backend to send updates on its own initiative Returns - timestamp - Monotonically increasing time (in seconds) when the coverage update was taken in the backend.

func (*Profiler) StartPreciseCoverageWithParams

func (c *Profiler) StartPreciseCoverageWithParams(v *ProfilerStartPreciseCoverageParams) (float64, error)

StartPreciseCoverageWithParams - Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters. Returns - timestamp - Monotonically increasing time (in seconds) when the coverage update was taken in the backend.

func (*Profiler) StartTypeProfile

func (c *Profiler) StartTypeProfile() (*gcdmessage.ChromeResponse, error)

Enable type profile.

func (*Profiler) Stop

func (c *Profiler) Stop() (*ProfilerProfile, error)

Stop - Returns - profile - Recorded profile.

func (*Profiler) StopPreciseCoverage

func (c *Profiler) StopPreciseCoverage() (*gcdmessage.ChromeResponse, error)

Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code.

func (*Profiler) StopTypeProfile

func (c *Profiler) StopTypeProfile() (*gcdmessage.ChromeResponse, error)

Disable type profile. Disabling releases type profile data collected so far.

func (*Profiler) TakePreciseCoverage

func (c *Profiler) TakePreciseCoverage() ([]*ProfilerScriptCoverage, float64, error)

TakePreciseCoverage - Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. Returns - result - Coverage data for the current isolate. timestamp - Monotonically increasing time (in seconds) when the coverage update was taken in the backend.

func (*Profiler) TakeTypeProfile

func (c *Profiler) TakeTypeProfile() ([]*ProfilerScriptTypeProfile, error)

TakeTypeProfile - Collect type profile. Returns - result - Type profile for all scripts since startTypeProfile() was turned on.

type ProfilerConsoleProfileFinishedEvent

type ProfilerConsoleProfileFinishedEvent struct {
	Method string `json:"method"`
	Params struct {
		Id       string            `json:"id"`              //
		Location *DebuggerLocation `json:"location"`        // Location of console.profileEnd().
		Profile  *ProfilerProfile  `json:"profile"`         //
		Title    string            `json:"title,omitempty"` // Profile title passed as an argument to console.profile().
	} `json:"Params,omitempty"`
}

type ProfilerConsoleProfileStartedEvent

type ProfilerConsoleProfileStartedEvent struct {
	Method string `json:"method"`
	Params struct {
		Id       string            `json:"id"`              //
		Location *DebuggerLocation `json:"location"`        // Location of console.profile().
		Title    string            `json:"title,omitempty"` // Profile title passed as an argument to console.profile().
	} `json:"Params,omitempty"`
}

Sent when new profile recording is started using console.profile() call.

type ProfilerCounterInfo added in v1.0.9

type ProfilerCounterInfo struct {
	Name  string `json:"name"`  // Counter name.
	Value int    `json:"value"` // Counter value.
}

Collected counter information.

type ProfilerCoverageRange

type ProfilerCoverageRange struct {
	StartOffset int `json:"startOffset"` // JavaScript script source offset for the range start.
	EndOffset   int `json:"endOffset"`   // JavaScript script source offset for the range end.
	Count       int `json:"count"`       // Collected execution count of the source range.
}

Coverage data for a source range.

type ProfilerFunctionCoverage

type ProfilerFunctionCoverage struct {
	FunctionName    string                   `json:"functionName"`    // JavaScript function name.
	Ranges          []*ProfilerCoverageRange `json:"ranges"`          // Source ranges inside the function with coverage data.
	IsBlockCoverage bool                     `json:"isBlockCoverage"` // Whether coverage data for this function has block granularity.
}

Coverage data for a JavaScript function.

type ProfilerPositionTickInfo

type ProfilerPositionTickInfo struct {
	Line  int `json:"line"`  // Source line number (1-based).
	Ticks int `json:"ticks"` // Number of samples attributed to the source line.
}

Specifies a number of samples attributed to a certain source position.

type ProfilerPreciseCoverageDeltaUpdateEvent added in v1.0.9

type ProfilerPreciseCoverageDeltaUpdateEvent struct {
	Method string `json:"method"`
	Params struct {
		Timestamp float64                   `json:"timestamp"` // Monotonically increasing time (in seconds) when the coverage update was taken in the backend.
		Occassion string                    `json:"occassion"` // Identifier for distinguishing coverage events.
		Result    []*ProfilerScriptCoverage `json:"result"`    // Coverage data for the current isolate.
	} `json:"Params,omitempty"`
}

Reports coverage delta since the last poll (either from an event like this, or from `takePreciseCoverage` for the current isolate. May only be sent if precise code coverage has been started. This event can be trigged by the embedder to, for example, trigger collection of coverage data immediatelly at a certain point in time.

type ProfilerProfile

type ProfilerProfile struct {
	Nodes      []*ProfilerProfileNode `json:"nodes"`                // The list of profile nodes. First item is the root node.
	StartTime  float64                `json:"startTime"`            // Profiling start timestamp in microseconds.
	EndTime    float64                `json:"endTime"`              // Profiling end timestamp in microseconds.
	Samples    []int                  `json:"samples,omitempty"`    // Ids of samples top nodes.
	TimeDeltas []int                  `json:"timeDeltas,omitempty"` // Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime.
}

Profile.

type ProfilerProfileNode

type ProfilerProfileNode struct {
	Id            int                         `json:"id"`                      // Unique id of the node.
	CallFrame     *RuntimeCallFrame           `json:"callFrame"`               // Function location.
	HitCount      int                         `json:"hitCount,omitempty"`      // Number of samples where this node was on top of the call stack.
	Children      []int                       `json:"children,omitempty"`      // Child node ids.
	DeoptReason   string                      `json:"deoptReason,omitempty"`   // The reason of being not optimized. The function may be deoptimized or marked as don't optimize.
	PositionTicks []*ProfilerPositionTickInfo `json:"positionTicks,omitempty"` // An array of source position ticks.
}

Profile node. Holds callsite information, execution statistics and child nodes.

type ProfilerScriptCoverage

type ProfilerScriptCoverage struct {
	ScriptId  string                      `json:"scriptId"`  // JavaScript script id.
	Url       string                      `json:"url"`       // JavaScript script name or url.
	Functions []*ProfilerFunctionCoverage `json:"functions"` // Functions contained in the script that has coverage data.
}

Coverage data for a JavaScript script.

type ProfilerScriptTypeProfile

type ProfilerScriptTypeProfile struct {
	ScriptId string                      `json:"scriptId"` // JavaScript script id.
	Url      string                      `json:"url"`      // JavaScript script name or url.
	Entries  []*ProfilerTypeProfileEntry `json:"entries"`  // Type profile entries for parameters and return values of the functions in the script.
}

Type profile data collected during runtime for a JavaScript script.

type ProfilerSetSamplingIntervalParams

type ProfilerSetSamplingIntervalParams struct {
	// New sampling interval in microseconds.
	Interval int `json:"interval"`
}

type ProfilerStartPreciseCoverageParams

type ProfilerStartPreciseCoverageParams struct {
	// Collect accurate call counts beyond simple 'covered' or 'not covered'.
	CallCount bool `json:"callCount,omitempty"`
	// Collect block-based coverage.
	Detailed bool `json:"detailed,omitempty"`
	// Allow the backend to send updates on its own initiative
	AllowTriggeredUpdates bool `json:"allowTriggeredUpdates,omitempty"`
}

type ProfilerTypeObject

type ProfilerTypeObject struct {
	Name string `json:"name"` // Name of a type collected with type profiling.
}

Describes a type collected during runtime.

type ProfilerTypeProfileEntry

type ProfilerTypeProfileEntry struct {
	Offset int                   `json:"offset"` // Source offset of the parameter or end of function for return values.
	Types  []*ProfilerTypeObject `json:"types"`  // The types for this parameter or return value.
}

Source offset and types for a parameter or return value.

type Runtime

type Runtime struct {
	// contains filtered or unexported fields
}

func NewRuntime

func NewRuntime(target gcdmessage.ChromeTargeter) *Runtime

func (*Runtime) AddBinding

func (c *Runtime) AddBinding(name string, executionContextId int) (*gcdmessage.ChromeResponse, error)

AddBinding - If executionContextId is empty, adds binding with the given name on the global objects of all inspected contexts, including those created later, bindings survive reloads. If executionContextId is specified, adds binding only on global object of given execution context. Binding function takes exactly one argument, this argument should be string, in case of any other input, function throws an exception. Each binding function call produces Runtime.bindingCalled notification. name - executionContextId -

func (*Runtime) AddBindingWithParams

func (c *Runtime) AddBindingWithParams(v *RuntimeAddBindingParams) (*gcdmessage.ChromeResponse, error)

AddBindingWithParams - If executionContextId is empty, adds binding with the given name on the global objects of all inspected contexts, including those created later, bindings survive reloads. If executionContextId is specified, adds binding only on global object of given execution context. Binding function takes exactly one argument, this argument should be string, in case of any other input, function throws an exception. Each binding function call produces Runtime.bindingCalled notification.

func (*Runtime) AwaitPromise

func (c *Runtime) AwaitPromise(promiseObjectId string, returnByValue bool, generatePreview bool) (*RuntimeRemoteObject, *RuntimeExceptionDetails, error)

AwaitPromise - Add handler to promise with given promise object id. promiseObjectId - Identifier of the promise. returnByValue - Whether the result is expected to be a JSON object that should be sent by value. generatePreview - Whether preview should be generated for the result. Returns - result - Promise result. Will contain rejected value if promise was rejected. exceptionDetails - Exception details if stack strace is available.

func (*Runtime) AwaitPromiseWithParams

AwaitPromiseWithParams - Add handler to promise with given promise object id. Returns - result - Promise result. Will contain rejected value if promise was rejected. exceptionDetails - Exception details if stack strace is available.

func (*Runtime) CallFunctionOn

func (c *Runtime) CallFunctionOn(functionDeclaration string, objectId string, arguments []*RuntimeCallArgument, silent bool, returnByValue bool, generatePreview bool, userGesture bool, awaitPromise bool, executionContextId int, objectGroup string) (*RuntimeRemoteObject, *RuntimeExceptionDetails, error)

CallFunctionOn - Calls function with given declaration on the given object. Object group of the result is inherited from the target object. functionDeclaration - Declaration of the function to call. objectId - Identifier of the object to call function on. Either objectId or executionContextId should be specified. arguments - Call arguments. All call arguments must belong to the same JavaScript world as the target object. silent - In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides `setPauseOnException` state. returnByValue - Whether the result is expected to be a JSON object which should be sent by value. generatePreview - Whether preview should be generated for the result. userGesture - Whether execution should be treated as initiated by user in the UI. awaitPromise - Whether execution should `await` for resulting value and return once awaited promise is resolved. executionContextId - Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified. objectGroup - Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object. Returns - result - Call result. exceptionDetails - Exception details.

func (*Runtime) CallFunctionOnWithParams

CallFunctionOnWithParams - Calls function with given declaration on the given object. Object group of the result is inherited from the target object. Returns - result - Call result. exceptionDetails - Exception details.

func (*Runtime) CompileScript

func (c *Runtime) CompileScript(expression string, sourceURL string, persistScript bool, executionContextId int) (string, *RuntimeExceptionDetails, error)

CompileScript - Compiles expression. expression - Expression to compile. sourceURL - Source url to be set for the script. persistScript - Specifies whether the compiled script should be persisted. executionContextId - Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. Returns - scriptId - Id of the script. exceptionDetails - Exception details.

func (*Runtime) CompileScriptWithParams

func (c *Runtime) CompileScriptWithParams(v *RuntimeCompileScriptParams) (string, *RuntimeExceptionDetails, error)

CompileScriptWithParams - Compiles expression. Returns - scriptId - Id of the script. exceptionDetails - Exception details.

func (*Runtime) Disable

func (c *Runtime) Disable() (*gcdmessage.ChromeResponse, error)

Disables reporting of execution contexts creation.

func (*Runtime) DiscardConsoleEntries

func (c *Runtime) DiscardConsoleEntries() (*gcdmessage.ChromeResponse, error)

Discards collected exceptions and console API calls.

func (*Runtime) Enable

func (c *Runtime) Enable() (*gcdmessage.ChromeResponse, error)

Enables reporting of execution contexts creation by means of `executionContextCreated` event. When the reporting gets enabled the event will be sent immediately for each existing execution context.

func (*Runtime) Evaluate

func (c *Runtime) Evaluate(expression string, objectGroup string, includeCommandLineAPI bool, silent bool, contextId int, returnByValue bool, generatePreview bool, userGesture bool, awaitPromise bool, throwOnSideEffect bool, timeout float64, disableBreaks bool, replMode bool, allowUnsafeEvalBlockedByCSP bool) (*RuntimeRemoteObject, *RuntimeExceptionDetails, error)

Evaluate - Evaluates expression on global object. expression - Expression to evaluate. objectGroup - Symbolic group name that can be used to release multiple objects. includeCommandLineAPI - Determines whether Command Line API should be available during the evaluation. silent - In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides `setPauseOnException` state. contextId - Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. returnByValue - Whether the result is expected to be a JSON object that should be sent by value. generatePreview - Whether preview should be generated for the result. userGesture - Whether execution should be treated as initiated by user in the UI. awaitPromise - Whether execution should `await` for resulting value and return once awaited promise is resolved. throwOnSideEffect - Whether to throw an exception if side effect cannot be ruled out during evaluation. This implies `disableBreaks` below. timeout - Terminate execution after timing out (number of milliseconds). disableBreaks - Disable breakpoints during execution. replMode - Setting this flag to true enables `let` re-declaration and top-level `await`. Note that `let` variables can only be re-declared if they originate from `replMode` themselves. allowUnsafeEvalBlockedByCSP - The Content Security Policy (CSP) for the target might block 'unsafe-eval' which includes eval(), Function(), setTimeout() and setInterval() when called with non-callable arguments. This flag bypasses CSP for this evaluation and allows unsafe-eval. Defaults to true. Returns - result - Evaluation result. exceptionDetails - Exception details.

func (*Runtime) EvaluateWithParams

EvaluateWithParams - Evaluates expression on global object. Returns - result - Evaluation result. exceptionDetails - Exception details.

func (*Runtime) GetHeapUsage

func (c *Runtime) GetHeapUsage() (float64, float64, error)

GetHeapUsage - Returns the JavaScript heap usage. It is the total usage of the corresponding isolate not scoped to a particular Runtime. Returns - usedSize - Used heap size in bytes. totalSize - Allocated heap size in bytes.

func (*Runtime) GetIsolateId

func (c *Runtime) GetIsolateId() (string, error)

GetIsolateId - Returns the isolate id. Returns - id - The isolate id.

func (*Runtime) GetProperties

func (c *Runtime) GetProperties(objectId string, ownProperties bool, accessorPropertiesOnly bool, generatePreview bool) ([]*RuntimePropertyDescriptor, []*RuntimeInternalPropertyDescriptor, []*RuntimePrivatePropertyDescriptor, *RuntimeExceptionDetails, error)

GetProperties - Returns properties of a given object. Object group of the result is inherited from the target object. objectId - Identifier of the object to return properties for. ownProperties - If true, returns properties belonging only to the element itself, not to its prototype chain. accessorPropertiesOnly - If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. generatePreview - Whether preview should be generated for the results. Returns - result - Object properties. internalProperties - Internal object properties (only of the element itself). privateProperties - Object private properties. exceptionDetails - Exception details.

func (*Runtime) GetPropertiesWithParams

GetPropertiesWithParams - Returns properties of a given object. Object group of the result is inherited from the target object. Returns - result - Object properties. internalProperties - Internal object properties (only of the element itself). privateProperties - Object private properties. exceptionDetails - Exception details.

func (*Runtime) GlobalLexicalScopeNames

func (c *Runtime) GlobalLexicalScopeNames(executionContextId int) ([]string, error)

GlobalLexicalScopeNames - Returns all let, const and class variables from global scope. executionContextId - Specifies in which execution context to lookup global scope variables. Returns - names -

func (*Runtime) GlobalLexicalScopeNamesWithParams

func (c *Runtime) GlobalLexicalScopeNamesWithParams(v *RuntimeGlobalLexicalScopeNamesParams) ([]string, error)

GlobalLexicalScopeNamesWithParams - Returns all let, const and class variables from global scope. Returns - names -

func (*Runtime) QueryObjects

func (c *Runtime) QueryObjects(prototypeObjectId string, objectGroup string) (*RuntimeRemoteObject, error)

QueryObjects - prototypeObjectId - Identifier of the prototype to return objects for. objectGroup - Symbolic group name that can be used to release the results. Returns - objects - Array with objects.

func (*Runtime) QueryObjectsWithParams

func (c *Runtime) QueryObjectsWithParams(v *RuntimeQueryObjectsParams) (*RuntimeRemoteObject, error)

QueryObjectsWithParams - Returns - objects - Array with objects.

func (*Runtime) ReleaseObject

func (c *Runtime) ReleaseObject(objectId string) (*gcdmessage.ChromeResponse, error)

ReleaseObject - Releases remote object with given id. objectId - Identifier of the object to release.

func (*Runtime) ReleaseObjectGroup

func (c *Runtime) ReleaseObjectGroup(objectGroup string) (*gcdmessage.ChromeResponse, error)

ReleaseObjectGroup - Releases all remote objects that belong to a given group. objectGroup - Symbolic object group name.

func (*Runtime) ReleaseObjectGroupWithParams

func (c *Runtime) ReleaseObjectGroupWithParams(v *RuntimeReleaseObjectGroupParams) (*gcdmessage.ChromeResponse, error)

ReleaseObjectGroupWithParams - Releases all remote objects that belong to a given group.

func (*Runtime) ReleaseObjectWithParams

func (c *Runtime) ReleaseObjectWithParams(v *RuntimeReleaseObjectParams) (*gcdmessage.ChromeResponse, error)

ReleaseObjectWithParams - Releases remote object with given id.

func (*Runtime) RemoveBinding

func (c *Runtime) RemoveBinding(name string) (*gcdmessage.ChromeResponse, error)

RemoveBinding - This method does not remove binding function from global object but unsubscribes current runtime agent from Runtime.bindingCalled notifications. name -

func (*Runtime) RemoveBindingWithParams

func (c *Runtime) RemoveBindingWithParams(v *RuntimeRemoveBindingParams) (*gcdmessage.ChromeResponse, error)

RemoveBindingWithParams - This method does not remove binding function from global object but unsubscribes current runtime agent from Runtime.bindingCalled notifications.

func (*Runtime) RunIfWaitingForDebugger

func (c *Runtime) RunIfWaitingForDebugger() (*gcdmessage.ChromeResponse, error)

Tells inspected instance to run if it was waiting for debugger to attach.

func (*Runtime) RunScript

func (c *Runtime) RunScript(scriptId string, executionContextId int, objectGroup string, silent bool, includeCommandLineAPI bool, returnByValue bool, generatePreview bool, awaitPromise bool) (*RuntimeRemoteObject, *RuntimeExceptionDetails, error)

RunScript - Runs script with given id in a given context. scriptId - Id of the script to run. executionContextId - Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. objectGroup - Symbolic group name that can be used to release multiple objects. silent - In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides `setPauseOnException` state. includeCommandLineAPI - Determines whether Command Line API should be available during the evaluation. returnByValue - Whether the result is expected to be a JSON object which should be sent by value. generatePreview - Whether preview should be generated for the result. awaitPromise - Whether execution should `await` for resulting value and return once awaited promise is resolved. Returns - result - Run result. exceptionDetails - Exception details.

func (*Runtime) RunScriptWithParams

RunScriptWithParams - Runs script with given id in a given context. Returns - result - Run result. exceptionDetails - Exception details.

func (*Runtime) SetAsyncCallStackDepth

func (c *Runtime) SetAsyncCallStackDepth(maxDepth int) (*gcdmessage.ChromeResponse, error)

SetAsyncCallStackDepth - Enables or disables async call stacks tracking. maxDepth - Maximum depth of async call stacks. Setting to `0` will effectively disable collecting async call stacks (default).

func (*Runtime) SetAsyncCallStackDepthWithParams

func (c *Runtime) SetAsyncCallStackDepthWithParams(v *RuntimeSetAsyncCallStackDepthParams) (*gcdmessage.ChromeResponse, error)

SetAsyncCallStackDepthWithParams - Enables or disables async call stacks tracking.

func (*Runtime) SetCustomObjectFormatterEnabled

func (c *Runtime) SetCustomObjectFormatterEnabled(enabled bool) (*gcdmessage.ChromeResponse, error)

SetCustomObjectFormatterEnabled - enabled -

func (*Runtime) SetCustomObjectFormatterEnabledWithParams

func (c *Runtime) SetCustomObjectFormatterEnabledWithParams(v *RuntimeSetCustomObjectFormatterEnabledParams) (*gcdmessage.ChromeResponse, error)

SetCustomObjectFormatterEnabledWithParams -

func (*Runtime) SetMaxCallStackSizeToCapture

func (c *Runtime) SetMaxCallStackSizeToCapture(size int) (*gcdmessage.ChromeResponse, error)

SetMaxCallStackSizeToCapture - size -

func (*Runtime) SetMaxCallStackSizeToCaptureWithParams

func (c *Runtime) SetMaxCallStackSizeToCaptureWithParams(v *RuntimeSetMaxCallStackSizeToCaptureParams) (*gcdmessage.ChromeResponse, error)

SetMaxCallStackSizeToCaptureWithParams -

func (*Runtime) TerminateExecution

func (c *Runtime) TerminateExecution() (*gcdmessage.ChromeResponse, error)

Terminate current or next JavaScript execution. Will cancel the termination when the outer-most script execution ends.

type RuntimeAddBindingParams

type RuntimeAddBindingParams struct {
	//
	Name string `json:"name"`
	//
	ExecutionContextId int `json:"executionContextId,omitempty"`
}

type RuntimeAwaitPromiseParams

type RuntimeAwaitPromiseParams struct {
	// Identifier of the promise.
	PromiseObjectId string `json:"promiseObjectId"`
	// Whether the result is expected to be a JSON object that should be sent by value.
	ReturnByValue bool `json:"returnByValue,omitempty"`
	// Whether preview should be generated for the result.
	GeneratePreview bool `json:"generatePreview,omitempty"`
}

type RuntimeBindingCalledEvent

type RuntimeBindingCalledEvent struct {
	Method string `json:"method"`
	Params struct {
		Name               string `json:"name"`               //
		Payload            string `json:"payload"`            //
		ExecutionContextId int    `json:"executionContextId"` // Identifier of the context where the call was made.
	} `json:"Params,omitempty"`
}

Notification is issued every time when binding is called.

type RuntimeCallArgument

type RuntimeCallArgument struct {
	Value               interface{} `json:"value,omitempty"`               // Primitive value or serializable javascript object.
	UnserializableValue string      `json:"unserializableValue,omitempty"` // Primitive value which can not be JSON-stringified.
	ObjectId            string      `json:"objectId,omitempty"`            // Remote object handle.
}

Represents function call argument. Either remote object id `objectId`, primitive `value`, unserializable primitive value or neither of (for undefined) them should be specified.

type RuntimeCallFrame

type RuntimeCallFrame struct {
	FunctionName string `json:"functionName"` // JavaScript function name.
	ScriptId     string `json:"scriptId"`     // JavaScript script id.
	Url          string `json:"url"`          // JavaScript script name or url.
	LineNumber   int    `json:"lineNumber"`   // JavaScript script line number (0-based).
	ColumnNumber int    `json:"columnNumber"` // JavaScript script column number (0-based).
}

Stack entry for runtime errors and assertions.

type RuntimeCallFunctionOnParams

type RuntimeCallFunctionOnParams struct {
	// Declaration of the function to call.
	FunctionDeclaration string `json:"functionDeclaration"`
	// Identifier of the object to call function on. Either objectId or executionContextId should be specified.
	ObjectId string `json:"objectId,omitempty"`
	// Call arguments. All call arguments must belong to the same JavaScript world as the target object.
	Arguments []*RuntimeCallArgument `json:"arguments,omitempty"`
	// In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides `setPauseOnException` state.
	Silent bool `json:"silent,omitempty"`
	// Whether the result is expected to be a JSON object which should be sent by value.
	ReturnByValue bool `json:"returnByValue,omitempty"`
	// Whether preview should be generated for the result.
	GeneratePreview bool `json:"generatePreview,omitempty"`
	// Whether execution should be treated as initiated by user in the UI.
	UserGesture bool `json:"userGesture,omitempty"`
	// Whether execution should `await` for resulting value and return once awaited promise is resolved.
	AwaitPromise bool `json:"awaitPromise,omitempty"`
	// Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified.
	ExecutionContextId int `json:"executionContextId,omitempty"`
	// Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object.
	ObjectGroup string `json:"objectGroup,omitempty"`
}

type RuntimeCompileScriptParams

type RuntimeCompileScriptParams struct {
	// Expression to compile.
	Expression string `json:"expression"`
	// Source url to be set for the script.
	SourceURL string `json:"sourceURL"`
	// Specifies whether the compiled script should be persisted.
	PersistScript bool `json:"persistScript"`
	// Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page.
	ExecutionContextId int `json:"executionContextId,omitempty"`
}

type RuntimeConsoleAPICalledEvent

type RuntimeConsoleAPICalledEvent struct {
	Method string `json:"method"`
	Params struct {
		Type               string                 `json:"type"`                 // Type of the call.
		Args               []*RuntimeRemoteObject `json:"args"`                 // Call arguments.
		ExecutionContextId int                    `json:"executionContextId"`   // Identifier of the context where the call was made.
		Timestamp          float64                `json:"timestamp"`            // Call timestamp.
		StackTrace         *RuntimeStackTrace     `json:"stackTrace,omitempty"` // Stack trace captured when the call was made. The async stack chain is automatically reported for the following call types: `assert`, `error`, `trace`, `warning`. For other types the async call chain can be retrieved using `Debugger.getStackTrace` and `stackTrace.parentId` field.
		Context            string                 `json:"context,omitempty"`    // Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context.
	} `json:"Params,omitempty"`
}

Issued when console API was called.

type RuntimeCustomPreview

type RuntimeCustomPreview struct {
	Header       string `json:"header"`                 // The JSON-stringified result of formatter.header(object, config) call. It contains json ML array that represents RemoteObject.
	BodyGetterId string `json:"bodyGetterId,omitempty"` // If formatter returns true as a result of formatter.hasBody call then bodyGetterId will contain RemoteObjectId for the function that returns result of formatter.body(object, config) call. The result value is json ML array.
}

No Description.

type RuntimeEntryPreview

type RuntimeEntryPreview struct {
	Key   *RuntimeObjectPreview `json:"key,omitempty"` // Preview of the key. Specified for map-like collection entries.
	Value *RuntimeObjectPreview `json:"value"`         // Preview of the value.
}

No Description.

type RuntimeEvaluateParams

type RuntimeEvaluateParams struct {
	// Expression to evaluate.
	Expression string `json:"expression"`
	// Symbolic group name that can be used to release multiple objects.
	ObjectGroup string `json:"objectGroup,omitempty"`
	// Determines whether Command Line API should be available during the evaluation.
	IncludeCommandLineAPI bool `json:"includeCommandLineAPI,omitempty"`
	// In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides `setPauseOnException` state.
	Silent bool `json:"silent,omitempty"`
	// Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page.
	ContextId int `json:"contextId,omitempty"`
	// Whether the result is expected to be a JSON object that should be sent by value.
	ReturnByValue bool `json:"returnByValue,omitempty"`
	// Whether preview should be generated for the result.
	GeneratePreview bool `json:"generatePreview,omitempty"`
	// Whether execution should be treated as initiated by user in the UI.
	UserGesture bool `json:"userGesture,omitempty"`
	// Whether execution should `await` for resulting value and return once awaited promise is resolved.
	AwaitPromise bool `json:"awaitPromise,omitempty"`
	// Whether to throw an exception if side effect cannot be ruled out during evaluation. This implies `disableBreaks` below.
	ThrowOnSideEffect bool `json:"throwOnSideEffect,omitempty"`
	// Terminate execution after timing out (number of milliseconds).
	Timeout float64 `json:"timeout,omitempty"`
	// Disable breakpoints during execution.
	DisableBreaks bool `json:"disableBreaks,omitempty"`
	// Setting this flag to true enables `let` re-declaration and top-level `await`. Note that `let` variables can only be re-declared if they originate from `replMode` themselves.
	ReplMode bool `json:"replMode,omitempty"`
	// The Content Security Policy (CSP) for the target might block 'unsafe-eval' which includes eval(), Function(), setTimeout() and setInterval() when called with non-callable arguments. This flag bypasses CSP for this evaluation and allows unsafe-eval. Defaults to true.
	AllowUnsafeEvalBlockedByCSP bool `json:"allowUnsafeEvalBlockedByCSP,omitempty"`
}

type RuntimeExceptionDetails

type RuntimeExceptionDetails struct {
	ExceptionId        int                  `json:"exceptionId"`                  // Exception id.
	Text               string               `json:"text"`                         // Exception text, which should be used together with exception object when available.
	LineNumber         int                  `json:"lineNumber"`                   // Line number of the exception location (0-based).
	ColumnNumber       int                  `json:"columnNumber"`                 // Column number of the exception location (0-based).
	ScriptId           string               `json:"scriptId,omitempty"`           // Script ID of the exception location.
	Url                string               `json:"url,omitempty"`                // URL of the exception location, to be used when the script was not reported.
	StackTrace         *RuntimeStackTrace   `json:"stackTrace,omitempty"`         // JavaScript stack trace if available.
	Exception          *RuntimeRemoteObject `json:"exception,omitempty"`          // Exception object if available.
	ExecutionContextId int                  `json:"executionContextId,omitempty"` // Identifier of the context where exception happened.
}

Detailed information about exception (or error) that was thrown during script compilation or execution.

type RuntimeExceptionRevokedEvent

type RuntimeExceptionRevokedEvent struct {
	Method string `json:"method"`
	Params struct {
		Reason      string `json:"reason"`      // Reason describing why exception was revoked.
		ExceptionId int    `json:"exceptionId"` // The id of revoked exception, as reported in `exceptionThrown`.
	} `json:"Params,omitempty"`
}

Issued when unhandled exception was revoked.

type RuntimeExceptionThrownEvent

type RuntimeExceptionThrownEvent struct {
	Method string `json:"method"`
	Params struct {
		Timestamp        float64                  `json:"timestamp"`        // Timestamp of the exception.
		ExceptionDetails *RuntimeExceptionDetails `json:"exceptionDetails"` //
	} `json:"Params,omitempty"`
}

Issued when exception was thrown and unhandled.

type RuntimeExecutionContextCreatedEvent

type RuntimeExecutionContextCreatedEvent struct {
	Method string `json:"method"`
	Params struct {
		Context *RuntimeExecutionContextDescription `json:"context"` // A newly created execution context.
	} `json:"Params,omitempty"`
}

Issued when new execution context is created.

type RuntimeExecutionContextDescription

type RuntimeExecutionContextDescription struct {
	Id      int                    `json:"id"`                // Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed.
	Origin  string                 `json:"origin"`            // Execution context origin.
	Name    string                 `json:"name"`              // Human readable name describing given context.
	AuxData map[string]interface{} `json:"auxData,omitempty"` // Embedder-specific auxiliary data.
}

Description of an isolated world.

type RuntimeExecutionContextDestroyedEvent

type RuntimeExecutionContextDestroyedEvent struct {
	Method string `json:"method"`
	Params struct {
		ExecutionContextId int `json:"executionContextId"` // Id of the destroyed context
	} `json:"Params,omitempty"`
}

Issued when execution context is destroyed.

type RuntimeGetPropertiesParams

type RuntimeGetPropertiesParams struct {
	// Identifier of the object to return properties for.
	ObjectId string `json:"objectId"`
	// If true, returns properties belonging only to the element itself, not to its prototype chain.
	OwnProperties bool `json:"ownProperties,omitempty"`
	// If true, returns accessor properties (with getter/setter) only; internal properties are not returned either.
	AccessorPropertiesOnly bool `json:"accessorPropertiesOnly,omitempty"`
	// Whether preview should be generated for the results.
	GeneratePreview bool `json:"generatePreview,omitempty"`
}

type RuntimeGlobalLexicalScopeNamesParams

type RuntimeGlobalLexicalScopeNamesParams struct {
	// Specifies in which execution context to lookup global scope variables.
	ExecutionContextId int `json:"executionContextId,omitempty"`
}

type RuntimeInspectRequestedEvent

type RuntimeInspectRequestedEvent struct {
	Method string `json:"method"`
	Params struct {
		Object *RuntimeRemoteObject   `json:"object"` //
		Hints  map[string]interface{} `json:"hints"`  //
	} `json:"Params,omitempty"`
}

Issued when object should be inspected (for example, as a result of inspect() command line API call).

type RuntimeInternalPropertyDescriptor

type RuntimeInternalPropertyDescriptor struct {
	Name  string               `json:"name"`            // Conventional property name.
	Value *RuntimeRemoteObject `json:"value,omitempty"` // The value associated with the property.
}

Object internal property descriptor. This property isn't normally visible in JavaScript code.

type RuntimeObjectPreview

type RuntimeObjectPreview struct {
	Type        string                    `json:"type"`                  // Object type.
	Subtype     string                    `json:"subtype,omitempty"`     // Object subtype hint. Specified for `object` type values only.
	Description string                    `json:"description,omitempty"` // String representation of the object.
	Overflow    bool                      `json:"overflow"`              // True iff some of the properties or entries of the original object did not fit.
	Properties  []*RuntimePropertyPreview `json:"properties"`            // List of the properties.
	Entries     []*RuntimeEntryPreview    `json:"entries,omitempty"`     // List of the entries. Specified for `map` and `set` subtype values only.
}

Object containing abbreviated remote object value.

type RuntimePrivatePropertyDescriptor added in v1.0.3

type RuntimePrivatePropertyDescriptor struct {
	Name  string               `json:"name"`            // Private property name.
	Value *RuntimeRemoteObject `json:"value,omitempty"` // The value associated with the private property.
	Get   *RuntimeRemoteObject `json:"get,omitempty"`   // A function which serves as a getter for the private property, or `undefined` if there is no getter (accessor descriptors only).
	Set   *RuntimeRemoteObject `json:"set,omitempty"`   // A function which serves as a setter for the private property, or `undefined` if there is no setter (accessor descriptors only).
}

Object private field descriptor.

type RuntimePropertyDescriptor

type RuntimePropertyDescriptor struct {
	Name         string               `json:"name"`                // Property name or symbol description.
	Value        *RuntimeRemoteObject `json:"value,omitempty"`     // The value associated with the property.
	Writable     bool                 `json:"writable,omitempty"`  // True if the value associated with the property may be changed (data descriptors only).
	Get          *RuntimeRemoteObject `json:"get,omitempty"`       // A function which serves as a getter for the property, or `undefined` if there is no getter (accessor descriptors only).
	Set          *RuntimeRemoteObject `json:"set,omitempty"`       // A function which serves as a setter for the property, or `undefined` if there is no setter (accessor descriptors only).
	Configurable bool                 `json:"configurable"`        // True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object.
	Enumerable   bool                 `json:"enumerable"`          // True if this property shows up during enumeration of the properties on the corresponding object.
	WasThrown    bool                 `json:"wasThrown,omitempty"` // True if the result was thrown during the evaluation.
	IsOwn        bool                 `json:"isOwn,omitempty"`     // True if the property is owned for the object.
	Symbol       *RuntimeRemoteObject `json:"symbol,omitempty"`    // Property symbol object, if the property is of the `symbol` type.
}

Object property descriptor.

type RuntimePropertyPreview

type RuntimePropertyPreview struct {
	Name         string                `json:"name"`                   // Property name.
	Type         string                `json:"type"`                   // Object type. Accessor means that the property itself is an accessor property.
	Value        string                `json:"value,omitempty"`        // User-friendly property value string.
	ValuePreview *RuntimeObjectPreview `json:"valuePreview,omitempty"` // Nested value preview.
	Subtype      string                `json:"subtype,omitempty"`      // Object subtype hint. Specified for `object` type values only.
}

No Description.

type RuntimeQueryObjectsParams

type RuntimeQueryObjectsParams struct {
	// Identifier of the prototype to return objects for.
	PrototypeObjectId string `json:"prototypeObjectId"`
	// Symbolic group name that can be used to release the results.
	ObjectGroup string `json:"objectGroup,omitempty"`
}

type RuntimeReleaseObjectGroupParams

type RuntimeReleaseObjectGroupParams struct {
	// Symbolic object group name.
	ObjectGroup string `json:"objectGroup"`
}

type RuntimeReleaseObjectParams

type RuntimeReleaseObjectParams struct {
	// Identifier of the object to release.
	ObjectId string `json:"objectId"`
}

type RuntimeRemoteObject

type RuntimeRemoteObject struct {
	Type                string                `json:"type"`                          // Object type.
	Subtype             string                `json:"subtype,omitempty"`             // Object subtype hint. Specified for `object` or `wasm` type values only.
	ClassName           string                `json:"className,omitempty"`           // Object class (constructor) name. Specified for `object` type values only.
	Value               interface{}           `json:"value,omitempty"`               // Remote object value in case of primitive values or JSON values (if it was requested).
	UnserializableValue string                `json:"unserializableValue,omitempty"` // Primitive value which can not be JSON-stringified does not have `value`, but gets this property.
	Description         string                `json:"description,omitempty"`         // String representation of the object.
	ObjectId            string                `json:"objectId,omitempty"`            // Unique object identifier (for non-primitive values).
	Preview             *RuntimeObjectPreview `json:"preview,omitempty"`             // Preview containing abbreviated property values. Specified for `object` type values only.
	CustomPreview       *RuntimeCustomPreview `json:"customPreview,omitempty"`       //
}

Mirror object referencing original JavaScript object.

type RuntimeRemoveBindingParams

type RuntimeRemoveBindingParams struct {
	//
	Name string `json:"name"`
}

type RuntimeRunScriptParams

type RuntimeRunScriptParams struct {
	// Id of the script to run.
	ScriptId string `json:"scriptId"`
	// Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page.
	ExecutionContextId int `json:"executionContextId,omitempty"`
	// Symbolic group name that can be used to release multiple objects.
	ObjectGroup string `json:"objectGroup,omitempty"`
	// In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides `setPauseOnException` state.
	Silent bool `json:"silent,omitempty"`
	// Determines whether Command Line API should be available during the evaluation.
	IncludeCommandLineAPI bool `json:"includeCommandLineAPI,omitempty"`
	// Whether the result is expected to be a JSON object which should be sent by value.
	ReturnByValue bool `json:"returnByValue,omitempty"`
	// Whether preview should be generated for the result.
	GeneratePreview bool `json:"generatePreview,omitempty"`
	// Whether execution should `await` for resulting value and return once awaited promise is resolved.
	AwaitPromise bool `json:"awaitPromise,omitempty"`
}

type RuntimeSetAsyncCallStackDepthParams

type RuntimeSetAsyncCallStackDepthParams struct {
	// Maximum depth of async call stacks. Setting to `0` will effectively disable collecting async call stacks (default).
	MaxDepth int `json:"maxDepth"`
}

type RuntimeSetCustomObjectFormatterEnabledParams

type RuntimeSetCustomObjectFormatterEnabledParams struct {
	//
	Enabled bool `json:"enabled"`
}

type RuntimeSetMaxCallStackSizeToCaptureParams

type RuntimeSetMaxCallStackSizeToCaptureParams struct {
	//
	Size int `json:"size"`
}

type RuntimeStackTrace

type RuntimeStackTrace struct {
	Description string               `json:"description,omitempty"` // String label of this stack trace. For async traces this may be a name of the function that initiated the async call.
	CallFrames  []*RuntimeCallFrame  `json:"callFrames"`            // JavaScript function name.
	Parent      *RuntimeStackTrace   `json:"parent,omitempty"`      // Asynchronous JavaScript stack trace that preceded this stack, if available.
	ParentId    *RuntimeStackTraceId `json:"parentId,omitempty"`    // Asynchronous JavaScript stack trace that preceded this stack, if available.
}

Call frames for assertions or error messages.

type RuntimeStackTraceId

type RuntimeStackTraceId struct {
	Id         string `json:"id"`                   //
	DebuggerId string `json:"debuggerId,omitempty"` //
}

If `debuggerId` is set stack trace comes from another debugger and can be resolved there. This allows to track cross-debugger calls. See `Runtime.StackTrace` and `Debugger.paused` for usages.

type Schema

type Schema struct {
	// contains filtered or unexported fields
}

func NewSchema

func NewSchema(target gcdmessage.ChromeTargeter) *Schema

func (*Schema) GetDomains

func (c *Schema) GetDomains() ([]*SchemaDomain, error)

GetDomains - Returns supported domains. Returns - domains - List of supported domains.

type SchemaDomain

type SchemaDomain struct {
	Name    string `json:"name"`    // Domain name.
	Version string `json:"version"` // Domain version.
}

Description of the protocol domain.

type Security

type Security struct {
	// contains filtered or unexported fields
}

func NewSecurity

func NewSecurity(target gcdmessage.ChromeTargeter) *Security

func (*Security) Disable

func (c *Security) Disable() (*gcdmessage.ChromeResponse, error)

Disables tracking security state changes.

func (*Security) Enable

func (c *Security) Enable() (*gcdmessage.ChromeResponse, error)

Enables tracking security state changes.

func (*Security) HandleCertificateError

func (c *Security) HandleCertificateError(eventId int, action string) (*gcdmessage.ChromeResponse, error)

HandleCertificateError - Handles a certificate error that fired a certificateError event. eventId - The ID of the event. action - The action to take on the certificate error. enum values: continue, cancel

func (*Security) HandleCertificateErrorWithParams

func (c *Security) HandleCertificateErrorWithParams(v *SecurityHandleCertificateErrorParams) (*gcdmessage.ChromeResponse, error)

HandleCertificateErrorWithParams - Handles a certificate error that fired a certificateError event.

func (*Security) SetIgnoreCertificateErrors

func (c *Security) SetIgnoreCertificateErrors(ignore bool) (*gcdmessage.ChromeResponse, error)

SetIgnoreCertificateErrors - Enable/disable whether all certificate errors should be ignored. ignore - If true, all certificate errors will be ignored.

func (*Security) SetIgnoreCertificateErrorsWithParams

func (c *Security) SetIgnoreCertificateErrorsWithParams(v *SecuritySetIgnoreCertificateErrorsParams) (*gcdmessage.ChromeResponse, error)

SetIgnoreCertificateErrorsWithParams - Enable/disable whether all certificate errors should be ignored.

func (*Security) SetOverrideCertificateErrors

func (c *Security) SetOverrideCertificateErrors(override bool) (*gcdmessage.ChromeResponse, error)

SetOverrideCertificateErrors - Enable/disable overriding certificate errors. If enabled, all certificate error events need to be handled by the DevTools client and should be answered with `handleCertificateError` commands. override - If true, certificate errors will be overridden.

func (*Security) SetOverrideCertificateErrorsWithParams

func (c *Security) SetOverrideCertificateErrorsWithParams(v *SecuritySetOverrideCertificateErrorsParams) (*gcdmessage.ChromeResponse, error)

SetOverrideCertificateErrorsWithParams - Enable/disable overriding certificate errors. If enabled, all certificate error events need to be handled by the DevTools client and should be answered with `handleCertificateError` commands.

type SecurityCertificateErrorEvent

type SecurityCertificateErrorEvent struct {
	Method string `json:"method"`
	Params struct {
		EventId    int    `json:"eventId"`    // The ID of the event.
		ErrorType  string `json:"errorType"`  // The type of the error.
		RequestURL string `json:"requestURL"` // The url that was requested.
	} `json:"Params,omitempty"`
}

There is a certificate error. If overriding certificate errors is enabled, then it should be handled with the `handleCertificateError` command. Note: this event does not fire if the certificate error has been allowed internally. Only one client per target should override certificate errors at the same time.

type SecurityCertificateSecurityState added in v1.0.9

type SecurityCertificateSecurityState struct {
	Protocol                    string   `json:"protocol"`                          // Protocol name (e.g. "TLS 1.2" or "QUIC").
	KeyExchange                 string   `json:"keyExchange"`                       // Key Exchange used by the connection, or the empty string if not applicable.
	KeyExchangeGroup            string   `json:"keyExchangeGroup,omitempty"`        // (EC)DH group used by the connection, if applicable.
	Cipher                      string   `json:"cipher"`                            // Cipher name.
	Mac                         string   `json:"mac,omitempty"`                     // TLS MAC. Note that AEAD ciphers do not have separate MACs.
	Certificate                 []string `json:"certificate"`                       // Page certificate.
	SubjectName                 string   `json:"subjectName"`                       // Certificate subject name.
	Issuer                      string   `json:"issuer"`                            // Name of the issuing CA.
	ValidFrom                   float64  `json:"validFrom"`                         // Certificate valid from date.
	ValidTo                     float64  `json:"validTo"`                           // Certificate valid to (expiration) date
	CertificateNetworkError     string   `json:"certificateNetworkError,omitempty"` // The highest priority network error code, if the certificate has an error.
	CertificateHasWeakSignature bool     `json:"certificateHasWeakSignature"`       // True if the certificate uses a weak signature aglorithm.
	CertificateHasSha1Signature bool     `json:"certificateHasSha1Signature"`       // True if the certificate has a SHA1 signature in the chain.
	ModernSSL                   bool     `json:"modernSSL"`                         // True if modern SSL
	ObsoleteSslProtocol         bool     `json:"obsoleteSslProtocol"`               // True if the connection is using an obsolete SSL protocol.
	ObsoleteSslKeyExchange      bool     `json:"obsoleteSslKeyExchange"`            // True if the connection is using an obsolete SSL key exchange.
	ObsoleteSslCipher           bool     `json:"obsoleteSslCipher"`                 // True if the connection is using an obsolete SSL cipher.
	ObsoleteSslSignature        bool     `json:"obsoleteSslSignature"`              // True if the connection is using an obsolete SSL signature.
}

Details about the security state of the page certificate.

type SecurityHandleCertificateErrorParams

type SecurityHandleCertificateErrorParams struct {
	// The ID of the event.
	EventId int `json:"eventId"`
	// The action to take on the certificate error. enum values: continue, cancel
	Action string `json:"action"`
}

type SecurityInsecureContentStatus

type SecurityInsecureContentStatus struct {
	RanMixedContent                bool   `json:"ranMixedContent"`                // Always false.
	DisplayedMixedContent          bool   `json:"displayedMixedContent"`          // Always false.
	ContainedMixedForm             bool   `json:"containedMixedForm"`             // Always false.
	RanContentWithCertErrors       bool   `json:"ranContentWithCertErrors"`       // Always false.
	DisplayedContentWithCertErrors bool   `json:"displayedContentWithCertErrors"` // Always false.
	RanInsecureContentStyle        string `json:"ranInsecureContentStyle"`        // Always set to unknown. enum values: unknown, neutral, insecure, secure, info, insecure-broken
	DisplayedInsecureContentStyle  string `json:"displayedInsecureContentStyle"`  // Always set to unknown. enum values: unknown, neutral, insecure, secure, info, insecure-broken
}

Information about insecure content on the page.

type SecuritySafetyTipInfo added in v1.0.9

type SecuritySafetyTipInfo struct {
	SafetyTipStatus string `json:"safetyTipStatus"`   // Describes whether the page triggers any safety tips or reputation warnings. Default is unknown. enum values: badReputation, lookalike
	SafeUrl         string `json:"safeUrl,omitempty"` // The URL the safety tip suggested ("Did you mean?"). Only filled in for lookalike matches.
}

No Description.

type SecuritySecurityStateChangedEvent

type SecuritySecurityStateChangedEvent struct {
	Method string `json:"method"`
	Params struct {
		SecurityState         string                              `json:"securityState"`         // Security state. enum values: unknown, neutral, insecure, secure, info, insecure-broken
		SchemeIsCryptographic bool                                `json:"schemeIsCryptographic"` // True if the page was loaded over cryptographic transport such as HTTPS.
		Explanations          []*SecuritySecurityStateExplanation `json:"explanations"`          // List of explanations for the security state. If the overall security state is `insecure` or `warning`, at least one corresponding explanation should be included.
		InsecureContentStatus *SecurityInsecureContentStatus      `json:"insecureContentStatus"` // Information about insecure content on the page.
		Summary               string                              `json:"summary,omitempty"`     // Overrides user-visible description of the state.
	} `json:"Params,omitempty"`
}

The security state of the page changed.

type SecuritySecurityStateExplanation

type SecuritySecurityStateExplanation struct {
	SecurityState    string   `json:"securityState"`             // Security state representing the severity of the factor being explained. enum values: unknown, neutral, insecure, secure, info, insecure-broken
	Title            string   `json:"title"`                     // Title describing the type of factor.
	Summary          string   `json:"summary"`                   // Short phrase describing the type of factor.
	Description      string   `json:"description"`               // Full text explanation of the factor.
	MixedContentType string   `json:"mixedContentType"`          // The type of mixed content described by the explanation. enum values: blockable, optionally-blockable, none
	Certificate      []string `json:"certificate"`               // Page certificate.
	Recommendations  []string `json:"recommendations,omitempty"` // Recommendations to fix any issues.
}

An explanation of an factor contributing to the security state.

type SecuritySetIgnoreCertificateErrorsParams

type SecuritySetIgnoreCertificateErrorsParams struct {
	// If true, all certificate errors will be ignored.
	Ignore bool `json:"ignore"`
}

type SecuritySetOverrideCertificateErrorsParams

type SecuritySetOverrideCertificateErrorsParams struct {
	// If true, certificate errors will be overridden.
	Override bool `json:"override"`
}

type SecurityVisibleSecurityState added in v1.0.9

type SecurityVisibleSecurityState struct {
	SecurityState            string                            `json:"securityState"`                      // The security level of the page. enum values: unknown, neutral, insecure, secure, info, insecure-broken
	CertificateSecurityState *SecurityCertificateSecurityState `json:"certificateSecurityState,omitempty"` // Security state details about the page certificate.
	SafetyTipInfo            *SecuritySafetyTipInfo            `json:"safetyTipInfo,omitempty"`            // The type of Safety Tip triggered on the page. Note that this field will be set even if the Safety Tip UI was not actually shown.
	SecurityStateIssueIds    []string                          `json:"securityStateIssueIds"`              // Array of security state issues ids.
}

Security state information about the page.

type SecurityVisibleSecurityStateChangedEvent added in v1.0.9

type SecurityVisibleSecurityStateChangedEvent struct {
	Method string `json:"method"`
	Params struct {
		VisibleSecurityState *SecurityVisibleSecurityState `json:"visibleSecurityState"` // Security state information about the page.
	} `json:"Params,omitempty"`
}

The security state of the page changed.

type ServiceWorker

type ServiceWorker struct {
	// contains filtered or unexported fields
}

func NewServiceWorker

func NewServiceWorker(target gcdmessage.ChromeTargeter) *ServiceWorker

func (*ServiceWorker) DeliverPushMessage

func (c *ServiceWorker) DeliverPushMessage(origin string, registrationId string, data string) (*gcdmessage.ChromeResponse, error)

DeliverPushMessage - origin - registrationId - data -

func (*ServiceWorker) DeliverPushMessageWithParams

func (c *ServiceWorker) DeliverPushMessageWithParams(v *ServiceWorkerDeliverPushMessageParams) (*gcdmessage.ChromeResponse, error)

DeliverPushMessageWithParams -

func (*ServiceWorker) Disable

func (c *ServiceWorker) Disable() (*gcdmessage.ChromeResponse, error)

func (*ServiceWorker) DispatchPeriodicSyncEvent added in v1.0.9

func (c *ServiceWorker) DispatchPeriodicSyncEvent(origin string, registrationId string, tag string) (*gcdmessage.ChromeResponse, error)

DispatchPeriodicSyncEvent - origin - registrationId - tag -

func (*ServiceWorker) DispatchPeriodicSyncEventWithParams added in v1.0.9

func (c *ServiceWorker) DispatchPeriodicSyncEventWithParams(v *ServiceWorkerDispatchPeriodicSyncEventParams) (*gcdmessage.ChromeResponse, error)

DispatchPeriodicSyncEventWithParams -

func (*ServiceWorker) DispatchSyncEvent

func (c *ServiceWorker) DispatchSyncEvent(origin string, registrationId string, tag string, lastChance bool) (*gcdmessage.ChromeResponse, error)

DispatchSyncEvent - origin - registrationId - tag - lastChance -

func (*ServiceWorker) DispatchSyncEventWithParams

func (c *ServiceWorker) DispatchSyncEventWithParams(v *ServiceWorkerDispatchSyncEventParams) (*gcdmessage.ChromeResponse, error)

DispatchSyncEventWithParams -

func (*ServiceWorker) Enable

func (c *ServiceWorker) Enable() (*gcdmessage.ChromeResponse, error)

func (*ServiceWorker) InspectWorker

func (c *ServiceWorker) InspectWorker(versionId string) (*gcdmessage.ChromeResponse, error)

InspectWorker - versionId -

func (*ServiceWorker) InspectWorkerWithParams

InspectWorkerWithParams -

func (*ServiceWorker) SetForceUpdateOnPageLoad

func (c *ServiceWorker) SetForceUpdateOnPageLoad(forceUpdateOnPageLoad bool) (*gcdmessage.ChromeResponse, error)

SetForceUpdateOnPageLoad - forceUpdateOnPageLoad -

func (*ServiceWorker) SetForceUpdateOnPageLoadWithParams

func (c *ServiceWorker) SetForceUpdateOnPageLoadWithParams(v *ServiceWorkerSetForceUpdateOnPageLoadParams) (*gcdmessage.ChromeResponse, error)

SetForceUpdateOnPageLoadWithParams -

func (*ServiceWorker) SkipWaiting

func (c *ServiceWorker) SkipWaiting(scopeURL string) (*gcdmessage.ChromeResponse, error)

SkipWaiting - scopeURL -

func (*ServiceWorker) SkipWaitingWithParams

SkipWaitingWithParams -

func (*ServiceWorker) StartWorker

func (c *ServiceWorker) StartWorker(scopeURL string) (*gcdmessage.ChromeResponse, error)

StartWorker - scopeURL -

func (*ServiceWorker) StartWorkerWithParams

StartWorkerWithParams -

func (*ServiceWorker) StopAllWorkers

func (c *ServiceWorker) StopAllWorkers() (*gcdmessage.ChromeResponse, error)

func (*ServiceWorker) StopWorker

func (c *ServiceWorker) StopWorker(versionId string) (*gcdmessage.ChromeResponse, error)

StopWorker - versionId -

func (*ServiceWorker) StopWorkerWithParams

StopWorkerWithParams -

func (*ServiceWorker) Unregister

func (c *ServiceWorker) Unregister(scopeURL string) (*gcdmessage.ChromeResponse, error)

Unregister - scopeURL -

func (*ServiceWorker) UnregisterWithParams

UnregisterWithParams -

func (*ServiceWorker) UpdateRegistration

func (c *ServiceWorker) UpdateRegistration(scopeURL string) (*gcdmessage.ChromeResponse, error)

UpdateRegistration - scopeURL -

func (*ServiceWorker) UpdateRegistrationWithParams

func (c *ServiceWorker) UpdateRegistrationWithParams(v *ServiceWorkerUpdateRegistrationParams) (*gcdmessage.ChromeResponse, error)

UpdateRegistrationWithParams -

type ServiceWorkerDeliverPushMessageParams

type ServiceWorkerDeliverPushMessageParams struct {
	//
	Origin string `json:"origin"`
	//
	RegistrationId string `json:"registrationId"`
	//
	Data string `json:"data"`
}

type ServiceWorkerDispatchPeriodicSyncEventParams added in v1.0.9

type ServiceWorkerDispatchPeriodicSyncEventParams struct {
	//
	Origin string `json:"origin"`
	//
	RegistrationId string `json:"registrationId"`
	//
	Tag string `json:"tag"`
}

type ServiceWorkerDispatchSyncEventParams

type ServiceWorkerDispatchSyncEventParams struct {
	//
	Origin string `json:"origin"`
	//
	RegistrationId string `json:"registrationId"`
	//
	Tag string `json:"tag"`
	//
	LastChance bool `json:"lastChance"`
}

type ServiceWorkerInspectWorkerParams

type ServiceWorkerInspectWorkerParams struct {
	//
	VersionId string `json:"versionId"`
}

type ServiceWorkerServiceWorkerErrorMessage

type ServiceWorkerServiceWorkerErrorMessage struct {
	ErrorMessage   string `json:"errorMessage"`   //
	RegistrationId string `json:"registrationId"` //
	VersionId      string `json:"versionId"`      //
	SourceURL      string `json:"sourceURL"`      //
	LineNumber     int    `json:"lineNumber"`     //
	ColumnNumber   int    `json:"columnNumber"`   //
}

ServiceWorker error message.

type ServiceWorkerServiceWorkerRegistration

type ServiceWorkerServiceWorkerRegistration struct {
	RegistrationId string `json:"registrationId"` //
	ScopeURL       string `json:"scopeURL"`       //
	IsDeleted      bool   `json:"isDeleted"`      //
}

ServiceWorker registration.

type ServiceWorkerServiceWorkerVersion

type ServiceWorkerServiceWorkerVersion struct {
	VersionId          string   `json:"versionId"`                    //
	RegistrationId     string   `json:"registrationId"`               //
	ScriptURL          string   `json:"scriptURL"`                    //
	RunningStatus      string   `json:"runningStatus"`                //  enum values: stopped, starting, running, stopping
	Status             string   `json:"status"`                       //  enum values: new, installing, installed, activating, activated, redundant
	ScriptLastModified float64  `json:"scriptLastModified,omitempty"` // The Last-Modified header value of the main script.
	ScriptResponseTime float64  `json:"scriptResponseTime,omitempty"` // The time at which the response headers of the main script were received from the server. For cached script it is the last time the cache entry was validated.
	ControlledClients  []string `json:"controlledClients,omitempty"`  //
	TargetId           string   `json:"targetId,omitempty"`           //
}

ServiceWorker version.

type ServiceWorkerSetForceUpdateOnPageLoadParams

type ServiceWorkerSetForceUpdateOnPageLoadParams struct {
	//
	ForceUpdateOnPageLoad bool `json:"forceUpdateOnPageLoad"`
}

type ServiceWorkerSkipWaitingParams

type ServiceWorkerSkipWaitingParams struct {
	//
	ScopeURL string `json:"scopeURL"`
}

type ServiceWorkerStartWorkerParams

type ServiceWorkerStartWorkerParams struct {
	//
	ScopeURL string `json:"scopeURL"`
}

type ServiceWorkerStopWorkerParams

type ServiceWorkerStopWorkerParams struct {
	//
	VersionId string `json:"versionId"`
}

type ServiceWorkerUnregisterParams

type ServiceWorkerUnregisterParams struct {
	//
	ScopeURL string `json:"scopeURL"`
}

type ServiceWorkerUpdateRegistrationParams

type ServiceWorkerUpdateRegistrationParams struct {
	//
	ScopeURL string `json:"scopeURL"`
}

type ServiceWorkerWorkerErrorReportedEvent

type ServiceWorkerWorkerErrorReportedEvent struct {
	Method string `json:"method"`
	Params struct {
		ErrorMessage *ServiceWorkerServiceWorkerErrorMessage `json:"errorMessage"` //
	} `json:"Params,omitempty"`
}

type ServiceWorkerWorkerRegistrationUpdatedEvent

type ServiceWorkerWorkerRegistrationUpdatedEvent struct {
	Method string `json:"method"`
	Params struct {
		Registrations []*ServiceWorkerServiceWorkerRegistration `json:"registrations"` //
	} `json:"Params,omitempty"`
}

type ServiceWorkerWorkerVersionUpdatedEvent

type ServiceWorkerWorkerVersionUpdatedEvent struct {
	Method string `json:"method"`
	Params struct {
		Versions []*ServiceWorkerServiceWorkerVersion `json:"versions"` //
	} `json:"Params,omitempty"`
}

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

func NewStorage

func NewStorage(target gcdmessage.ChromeTargeter) *Storage

func (*Storage) ClearCookies added in v1.0.9

func (c *Storage) ClearCookies(browserContextId string) (*gcdmessage.ChromeResponse, error)

ClearCookies - Clears cookies. browserContextId - Browser context to use when called on the browser endpoint.

func (*Storage) ClearCookiesWithParams added in v1.0.9

func (c *Storage) ClearCookiesWithParams(v *StorageClearCookiesParams) (*gcdmessage.ChromeResponse, error)

ClearCookiesWithParams - Clears cookies.

func (*Storage) ClearDataForOrigin

func (c *Storage) ClearDataForOrigin(origin string, storageTypes string) (*gcdmessage.ChromeResponse, error)

ClearDataForOrigin - Clears storage for origin. origin - Security origin. storageTypes - Comma separated list of StorageType to clear.

func (*Storage) ClearDataForOriginWithParams

func (c *Storage) ClearDataForOriginWithParams(v *StorageClearDataForOriginParams) (*gcdmessage.ChromeResponse, error)

ClearDataForOriginWithParams - Clears storage for origin.

func (*Storage) GetCookies added in v1.0.9

func (c *Storage) GetCookies(browserContextId string) ([]*NetworkCookie, error)

GetCookies - Returns all browser cookies. browserContextId - Browser context to use when called on the browser endpoint. Returns - cookies - Array of cookie objects.

func (*Storage) GetCookiesWithParams added in v1.0.9

func (c *Storage) GetCookiesWithParams(v *StorageGetCookiesParams) ([]*NetworkCookie, error)

GetCookiesWithParams - Returns all browser cookies. Returns - cookies - Array of cookie objects.

func (*Storage) GetUsageAndQuota

func (c *Storage) GetUsageAndQuota(origin string) (float64, float64, []*StorageUsageForType, error)

GetUsageAndQuota - Returns usage and quota in bytes. origin - Security origin. Returns - usage - Storage usage (bytes). quota - Storage quota (bytes). usageBreakdown - Storage usage per type (bytes).

func (*Storage) GetUsageAndQuotaWithParams

func (c *Storage) GetUsageAndQuotaWithParams(v *StorageGetUsageAndQuotaParams) (float64, float64, []*StorageUsageForType, error)

GetUsageAndQuotaWithParams - Returns usage and quota in bytes. Returns - usage - Storage usage (bytes). quota - Storage quota (bytes). usageBreakdown - Storage usage per type (bytes).

func (*Storage) SetCookies added in v1.0.9

func (c *Storage) SetCookies(cookies []*NetworkCookieParam, browserContextId string) (*gcdmessage.ChromeResponse, error)

SetCookies - Sets given cookies. cookies - Cookies to be set. browserContextId - Browser context to use when called on the browser endpoint.

func (*Storage) SetCookiesWithParams added in v1.0.9

func (c *Storage) SetCookiesWithParams(v *StorageSetCookiesParams) (*gcdmessage.ChromeResponse, error)

SetCookiesWithParams - Sets given cookies.

func (*Storage) TrackCacheStorageForOrigin

func (c *Storage) TrackCacheStorageForOrigin(origin string) (*gcdmessage.ChromeResponse, error)

TrackCacheStorageForOrigin - Registers origin to be notified when an update occurs to its cache storage list. origin - Security origin.

func (*Storage) TrackCacheStorageForOriginWithParams

func (c *Storage) TrackCacheStorageForOriginWithParams(v *StorageTrackCacheStorageForOriginParams) (*gcdmessage.ChromeResponse, error)

TrackCacheStorageForOriginWithParams - Registers origin to be notified when an update occurs to its cache storage list.

func (*Storage) TrackIndexedDBForOrigin

func (c *Storage) TrackIndexedDBForOrigin(origin string) (*gcdmessage.ChromeResponse, error)

TrackIndexedDBForOrigin - Registers origin to be notified when an update occurs to its IndexedDB. origin - Security origin.

func (*Storage) TrackIndexedDBForOriginWithParams

func (c *Storage) TrackIndexedDBForOriginWithParams(v *StorageTrackIndexedDBForOriginParams) (*gcdmessage.ChromeResponse, error)

TrackIndexedDBForOriginWithParams - Registers origin to be notified when an update occurs to its IndexedDB.

func (*Storage) UntrackCacheStorageForOrigin

func (c *Storage) UntrackCacheStorageForOrigin(origin string) (*gcdmessage.ChromeResponse, error)

UntrackCacheStorageForOrigin - Unregisters origin from receiving notifications for cache storage. origin - Security origin.

func (*Storage) UntrackCacheStorageForOriginWithParams

func (c *Storage) UntrackCacheStorageForOriginWithParams(v *StorageUntrackCacheStorageForOriginParams) (*gcdmessage.ChromeResponse, error)

UntrackCacheStorageForOriginWithParams - Unregisters origin from receiving notifications for cache storage.

func (*Storage) UntrackIndexedDBForOrigin

func (c *Storage) UntrackIndexedDBForOrigin(origin string) (*gcdmessage.ChromeResponse, error)

UntrackIndexedDBForOrigin - Unregisters origin from receiving notifications for IndexedDB. origin - Security origin.

func (*Storage) UntrackIndexedDBForOriginWithParams

func (c *Storage) UntrackIndexedDBForOriginWithParams(v *StorageUntrackIndexedDBForOriginParams) (*gcdmessage.ChromeResponse, error)

UntrackIndexedDBForOriginWithParams - Unregisters origin from receiving notifications for IndexedDB.

type StorageCacheStorageContentUpdatedEvent

type StorageCacheStorageContentUpdatedEvent struct {
	Method string `json:"method"`
	Params struct {
		Origin    string `json:"origin"`    // Origin to update.
		CacheName string `json:"cacheName"` // Name of cache in origin.
	} `json:"Params,omitempty"`
}

A cache's contents have been modified.

type StorageCacheStorageListUpdatedEvent

type StorageCacheStorageListUpdatedEvent struct {
	Method string `json:"method"`
	Params struct {
		Origin string `json:"origin"` // Origin to update.
	} `json:"Params,omitempty"`
}

A cache has been added/deleted.

type StorageClearCookiesParams added in v1.0.9

type StorageClearCookiesParams struct {
	// Browser context to use when called on the browser endpoint.
	BrowserContextId string `json:"browserContextId,omitempty"`
}

type StorageClearDataForOriginParams

type StorageClearDataForOriginParams struct {
	// Security origin.
	Origin string `json:"origin"`
	// Comma separated list of StorageType to clear.
	StorageTypes string `json:"storageTypes"`
}

type StorageGetCookiesParams added in v1.0.9

type StorageGetCookiesParams struct {
	// Browser context to use when called on the browser endpoint.
	BrowserContextId string `json:"browserContextId,omitempty"`
}

type StorageGetUsageAndQuotaParams

type StorageGetUsageAndQuotaParams struct {
	// Security origin.
	Origin string `json:"origin"`
}

type StorageIndexedDBContentUpdatedEvent

type StorageIndexedDBContentUpdatedEvent struct {
	Method string `json:"method"`
	Params struct {
		Origin          string `json:"origin"`          // Origin to update.
		DatabaseName    string `json:"databaseName"`    // Database to update.
		ObjectStoreName string `json:"objectStoreName"` // ObjectStore to update.
	} `json:"Params,omitempty"`
}

The origin's IndexedDB object store has been modified.

type StorageIndexedDBListUpdatedEvent

type StorageIndexedDBListUpdatedEvent struct {
	Method string `json:"method"`
	Params struct {
		Origin string `json:"origin"` // Origin to update.
	} `json:"Params,omitempty"`
}

The origin's IndexedDB database list has been modified.

type StorageSetCookiesParams added in v1.0.9

type StorageSetCookiesParams struct {
	// Cookies to be set.
	Cookies []*NetworkCookieParam `json:"cookies"`
	// Browser context to use when called on the browser endpoint.
	BrowserContextId string `json:"browserContextId,omitempty"`
}

type StorageTrackCacheStorageForOriginParams

type StorageTrackCacheStorageForOriginParams struct {
	// Security origin.
	Origin string `json:"origin"`
}

type StorageTrackIndexedDBForOriginParams

type StorageTrackIndexedDBForOriginParams struct {
	// Security origin.
	Origin string `json:"origin"`
}

type StorageUntrackCacheStorageForOriginParams

type StorageUntrackCacheStorageForOriginParams struct {
	// Security origin.
	Origin string `json:"origin"`
}

type StorageUntrackIndexedDBForOriginParams

type StorageUntrackIndexedDBForOriginParams struct {
	// Security origin.
	Origin string `json:"origin"`
}

type StorageUsageForType

type StorageUsageForType struct {
	StorageType string  `json:"storageType"` // Name of storage type. enum values: appcache, cookies, file_systems, indexeddb, local_storage, shader_cache, websql, service_workers, cache_storage, all, other
	Usage       float64 `json:"usage"`       // Storage usage (bytes).
}

Usage for a storage type.

type SystemInfo

type SystemInfo struct {
	// contains filtered or unexported fields
}

func NewSystemInfo

func NewSystemInfo(target gcdmessage.ChromeTargeter) *SystemInfo

func (*SystemInfo) GetInfo

func (c *SystemInfo) GetInfo() (*SystemInfoGPUInfo, string, string, string, error)

GetInfo - Returns information about the system. Returns - gpu - Information about the GPUs on the system. modelName - A platform-dependent description of the model of the machine. On Mac OS, this is, for example, 'MacBookPro'. Will be the empty string if not supported. modelVersion - A platform-dependent description of the version of the machine. On Mac OS, this is, for example, '10.1'. Will be the empty string if not supported. commandLine - The command line string used to launch the browser. Will be the empty string if not supported.

func (*SystemInfo) GetProcessInfo added in v1.0.3

func (c *SystemInfo) GetProcessInfo() ([]*SystemInfoProcessInfo, error)

GetProcessInfo - Returns information about all running processes. Returns - processInfo - An array of process info blocks.

type SystemInfoGPUDevice

type SystemInfoGPUDevice struct {
	VendorId      float64 `json:"vendorId"`           // PCI ID of the GPU vendor, if available; 0 otherwise.
	DeviceId      float64 `json:"deviceId"`           // PCI ID of the GPU device, if available; 0 otherwise.
	SubSysId      float64 `json:"subSysId,omitempty"` // Sub sys ID of the GPU, only available on Windows.
	Revision      float64 `json:"revision,omitempty"` // Revision of the GPU, only available on Windows.
	VendorString  string  `json:"vendorString"`       // String description of the GPU vendor, if the PCI ID is not available.
	DeviceString  string  `json:"deviceString"`       // String description of the GPU device, if the PCI ID is not available.
	DriverVendor  string  `json:"driverVendor"`       // String description of the GPU driver vendor.
	DriverVersion string  `json:"driverVersion"`      // String description of the GPU driver version.
}

Describes a single graphics processor (GPU).

type SystemInfoGPUInfo

type SystemInfoGPUInfo struct {
	Devices              []*SystemInfoGPUDevice                        `json:"devices"`                 // The graphics devices on the system. Element 0 is the primary GPU.
	AuxAttributes        map[string]interface{}                        `json:"auxAttributes,omitempty"` // An optional dictionary of additional GPU related attributes.
	FeatureStatus        map[string]interface{}                        `json:"featureStatus,omitempty"` // An optional dictionary of graphics features and their status.
	DriverBugWorkarounds []string                                      `json:"driverBugWorkarounds"`    // An optional array of GPU driver bug workarounds.
	VideoDecoding        []*SystemInfoVideoDecodeAcceleratorCapability `json:"videoDecoding"`           // Supported accelerated video decoding capabilities.
	VideoEncoding        []*SystemInfoVideoEncodeAcceleratorCapability `json:"videoEncoding"`           // Supported accelerated video encoding capabilities.
	ImageDecoding        []*SystemInfoImageDecodeAcceleratorCapability `json:"imageDecoding"`           // Supported accelerated image decoding capabilities.
}

Provides information about the GPU(s) on the system.

type SystemInfoImageDecodeAcceleratorCapability added in v1.0.7

type SystemInfoImageDecodeAcceleratorCapability struct {
	ImageType     string          `json:"imageType"`     // Image coded, e.g. Jpeg. enum values: jpeg, webp, unknown
	MaxDimensions *SystemInfoSize `json:"maxDimensions"` // Maximum supported dimensions of the image in pixels.
	MinDimensions *SystemInfoSize `json:"minDimensions"` // Minimum supported dimensions of the image in pixels.
	Subsamplings  []string        `json:"subsamplings"`  // Optional array of supported subsampling formats, e.g. 4:2:0, if known. enum values: yuv420, yuv422, yuv444
}

Describes a supported image decoding profile with its associated minimum and maximum resolutions and subsampling.

type SystemInfoProcessInfo added in v1.0.3

type SystemInfoProcessInfo struct {
	Type    string  `json:"type"`    // Specifies process type.
	Id      int     `json:"id"`      // Specifies process id.
	CpuTime float64 `json:"cpuTime"` // Specifies cumulative CPU usage in seconds across all threads of the process since the process start.
}

Represents process info.

type SystemInfoSize added in v1.0.7

type SystemInfoSize struct {
	Width  int `json:"width"`  // Width in pixels.
	Height int `json:"height"` // Height in pixels.
}

Describes the width and height dimensions of an entity.

type SystemInfoVideoDecodeAcceleratorCapability added in v1.0.7

type SystemInfoVideoDecodeAcceleratorCapability struct {
	Profile       string          `json:"profile"`       // Video codec profile that is supported, e.g. VP9 Profile 2.
	MaxResolution *SystemInfoSize `json:"maxResolution"` // Maximum video dimensions in pixels supported for this |profile|.
	MinResolution *SystemInfoSize `json:"minResolution"` // Minimum video dimensions in pixels supported for this |profile|.
}

Describes a supported video decoding profile with its associated minimum and maximum resolutions.

type SystemInfoVideoEncodeAcceleratorCapability added in v1.0.7

type SystemInfoVideoEncodeAcceleratorCapability struct {
	Profile                 string          `json:"profile"`                 // Video codec profile that is supported, e.g H264 Main.
	MaxResolution           *SystemInfoSize `json:"maxResolution"`           // Maximum video dimensions in pixels supported for this |profile|.
	MaxFramerateNumerator   int             `json:"maxFramerateNumerator"`   // Maximum encoding framerate in frames per second supported for this |profile|, as fraction's numerator and denominator, e.g. 24/1 fps, 24000/1001 fps, etc.
	MaxFramerateDenominator int             `json:"maxFramerateDenominator"` //
}

Describes a supported video encoding profile with its associated maximum resolution and maximum framerate.

type Target

type Target struct {
	// contains filtered or unexported fields
}

func NewTarget

func NewTarget(target gcdmessage.ChromeTargeter) *Target

func (*Target) ActivateTarget

func (c *Target) ActivateTarget(targetId string) (*gcdmessage.ChromeResponse, error)

ActivateTarget - Activates (focuses) the target. targetId -

func (*Target) ActivateTargetWithParams

func (c *Target) ActivateTargetWithParams(v *TargetActivateTargetParams) (*gcdmessage.ChromeResponse, error)

ActivateTargetWithParams - Activates (focuses) the target.

func (*Target) AttachToBrowserTarget

func (c *Target) AttachToBrowserTarget() (string, error)

AttachToBrowserTarget - Attaches to the browser target, only uses flat sessionId mode. Returns - sessionId - Id assigned to the session.

func (*Target) AttachToTarget

func (c *Target) AttachToTarget(targetId string, flatten bool) (string, error)

AttachToTarget - Attaches to the target with given id. targetId - flatten - Enables "flat" access to the session via specifying sessionId attribute in the commands. We plan to make this the default, deprecate non-flattened mode, and eventually retire it. See crbug.com/991325. Returns - sessionId - Id assigned to the session.

func (*Target) AttachToTargetWithParams

func (c *Target) AttachToTargetWithParams(v *TargetAttachToTargetParams) (string, error)

AttachToTargetWithParams - Attaches to the target with given id. Returns - sessionId - Id assigned to the session.

func (*Target) CloseTarget

func (c *Target) CloseTarget(targetId string) (bool, error)

CloseTarget - Closes the target. If the target is a page that gets closed too. targetId - Returns - success -

func (*Target) CloseTargetWithParams

func (c *Target) CloseTargetWithParams(v *TargetCloseTargetParams) (bool, error)

CloseTargetWithParams - Closes the target. If the target is a page that gets closed too. Returns - success -

func (*Target) CreateBrowserContext

func (c *Target) CreateBrowserContext(disposeOnDetach bool, proxyServer string, proxyBypassList string) (string, error)

CreateBrowserContext - Creates a new empty BrowserContext. Similar to an incognito profile but you can have more than one. disposeOnDetach - If specified, disposes this context when debugging session disconnects. proxyServer - Proxy server, similar to the one passed to --proxy-server proxyBypassList - Proxy bypass list, similar to the one passed to --proxy-bypass-list Returns - browserContextId - The id of the context created.

func (*Target) CreateBrowserContextWithParams added in v1.0.9

func (c *Target) CreateBrowserContextWithParams(v *TargetCreateBrowserContextParams) (string, error)

CreateBrowserContextWithParams - Creates a new empty BrowserContext. Similar to an incognito profile but you can have more than one. Returns - browserContextId - The id of the context created.

func (*Target) CreateTarget

func (c *Target) CreateTarget(url string, width int, height int, browserContextId string, enableBeginFrameControl bool, newWindow bool, background bool) (string, error)

CreateTarget - Creates a new page. url - The initial URL the page will be navigated to. width - Frame width in DIP (headless chrome only). height - Frame height in DIP (headless chrome only). browserContextId - The browser context to create the page in. enableBeginFrameControl - Whether BeginFrames for this target will be controlled via DevTools (headless chrome only, not supported on MacOS yet, false by default). newWindow - Whether to create a new Window or Tab (chrome-only, false by default). background - Whether to create the target in background or foreground (chrome-only, false by default). Returns - targetId - The id of the page opened.

func (*Target) CreateTargetWithParams

func (c *Target) CreateTargetWithParams(v *TargetCreateTargetParams) (string, error)

CreateTargetWithParams - Creates a new page. Returns - targetId - The id of the page opened.

func (*Target) DetachFromTarget

func (c *Target) DetachFromTarget(sessionId string, targetId string) (*gcdmessage.ChromeResponse, error)

DetachFromTarget - Detaches session with given id. sessionId - Session to detach. targetId - Deprecated.

func (*Target) DetachFromTargetWithParams

func (c *Target) DetachFromTargetWithParams(v *TargetDetachFromTargetParams) (*gcdmessage.ChromeResponse, error)

DetachFromTargetWithParams - Detaches session with given id.

func (*Target) DisposeBrowserContext

func (c *Target) DisposeBrowserContext(browserContextId string) (*gcdmessage.ChromeResponse, error)

DisposeBrowserContext - Deletes a BrowserContext. All the belonging pages will be closed without calling their beforeunload hooks. browserContextId -

func (*Target) DisposeBrowserContextWithParams

func (c *Target) DisposeBrowserContextWithParams(v *TargetDisposeBrowserContextParams) (*gcdmessage.ChromeResponse, error)

DisposeBrowserContextWithParams - Deletes a BrowserContext. All the belonging pages will be closed without calling their beforeunload hooks.

func (*Target) ExposeDevToolsProtocol

func (c *Target) ExposeDevToolsProtocol(targetId string, bindingName string) (*gcdmessage.ChromeResponse, error)

ExposeDevToolsProtocol - Inject object to the target's main frame that provides a communication channel with browser target. Injected object will be available as `window[bindingName]`. The object has the follwing API: - `binding.send(json)` - a method to send messages over the remote debugging protocol - `binding.onmessage = json => handleMessage(json)` - a callback that will be called for the protocol notifications and command responses. targetId - bindingName - Binding name, 'cdp' if not specified.

func (*Target) ExposeDevToolsProtocolWithParams

func (c *Target) ExposeDevToolsProtocolWithParams(v *TargetExposeDevToolsProtocolParams) (*gcdmessage.ChromeResponse, error)

ExposeDevToolsProtocolWithParams - Inject object to the target's main frame that provides a communication channel with browser target. Injected object will be available as `window[bindingName]`. The object has the follwing API: - `binding.send(json)` - a method to send messages over the remote debugging protocol - `binding.onmessage = json => handleMessage(json)` - a callback that will be called for the protocol notifications and command responses.

func (*Target) GetBrowserContexts

func (c *Target) GetBrowserContexts() ([]string, error)

GetBrowserContexts - Returns all browser contexts created with `Target.createBrowserContext` method. Returns - browserContextIds - An array of browser context ids.

func (*Target) GetTargetInfo

func (c *Target) GetTargetInfo(targetId string) (*TargetTargetInfo, error)

GetTargetInfo - Returns information about a target. targetId - Returns - targetInfo -

func (*Target) GetTargetInfoWithParams

func (c *Target) GetTargetInfoWithParams(v *TargetGetTargetInfoParams) (*TargetTargetInfo, error)

GetTargetInfoWithParams - Returns information about a target. Returns - targetInfo -

func (*Target) GetTargets

func (c *Target) GetTargets() ([]*TargetTargetInfo, error)

GetTargets - Retrieves a list of available targets. Returns - targetInfos - The list of targets.

func (*Target) SendMessageToTarget

func (c *Target) SendMessageToTarget(message string, sessionId string, targetId string) (*gcdmessage.ChromeResponse, error)

SendMessageToTarget - Sends protocol message over session with given id. Consider using flat mode instead; see commands attachToTarget, setAutoAttach, and crbug.com/991325. message - sessionId - Identifier of the session. targetId - Deprecated.

func (*Target) SendMessageToTargetWithParams

func (c *Target) SendMessageToTargetWithParams(v *TargetSendMessageToTargetParams) (*gcdmessage.ChromeResponse, error)

SendMessageToTargetWithParams - Sends protocol message over session with given id. Consider using flat mode instead; see commands attachToTarget, setAutoAttach, and crbug.com/991325.

func (*Target) SetAutoAttach

func (c *Target) SetAutoAttach(autoAttach bool, waitForDebuggerOnStart bool, flatten bool) (*gcdmessage.ChromeResponse, error)

SetAutoAttach - Controls whether to automatically attach to new targets which are considered to be related to this one. When turned on, attaches to all existing related targets as well. When turned off, automatically detaches from all currently attached targets. autoAttach - Whether to auto-attach to related targets. waitForDebuggerOnStart - Whether to pause new targets when attaching to them. Use `Runtime.runIfWaitingForDebugger` to run paused targets. flatten - Enables "flat" access to the session via specifying sessionId attribute in the commands. We plan to make this the default, deprecate non-flattened mode, and eventually retire it. See crbug.com/991325.

func (*Target) SetAutoAttachWithParams

func (c *Target) SetAutoAttachWithParams(v *TargetSetAutoAttachParams) (*gcdmessage.ChromeResponse, error)

SetAutoAttachWithParams - Controls whether to automatically attach to new targets which are considered to be related to this one. When turned on, attaches to all existing related targets as well. When turned off, automatically detaches from all currently attached targets.

func (*Target) SetDiscoverTargets

func (c *Target) SetDiscoverTargets(discover bool) (*gcdmessage.ChromeResponse, error)

SetDiscoverTargets - Controls whether to discover available targets and notify via `targetCreated/targetInfoChanged/targetDestroyed` events. discover - Whether to discover available targets.

func (*Target) SetDiscoverTargetsWithParams

func (c *Target) SetDiscoverTargetsWithParams(v *TargetSetDiscoverTargetsParams) (*gcdmessage.ChromeResponse, error)

SetDiscoverTargetsWithParams - Controls whether to discover available targets and notify via `targetCreated/targetInfoChanged/targetDestroyed` events.

func (*Target) SetRemoteLocations

func (c *Target) SetRemoteLocations(locations []*TargetRemoteLocation) (*gcdmessage.ChromeResponse, error)

SetRemoteLocations - Enables target discovery for the specified locations, when `setDiscoverTargets` was set to `true`. locations - List of remote locations.

func (*Target) SetRemoteLocationsWithParams

func (c *Target) SetRemoteLocationsWithParams(v *TargetSetRemoteLocationsParams) (*gcdmessage.ChromeResponse, error)

SetRemoteLocationsWithParams - Enables target discovery for the specified locations, when `setDiscoverTargets` was set to `true`.

type TargetActivateTargetParams

type TargetActivateTargetParams struct {
	//
	TargetId string `json:"targetId"`
}

type TargetAttachToTargetParams

type TargetAttachToTargetParams struct {
	//
	TargetId string `json:"targetId"`
	// Enables "flat" access to the session via specifying sessionId attribute in the commands. We plan to make this the default, deprecate non-flattened mode, and eventually retire it. See crbug.com/991325.
	Flatten bool `json:"flatten,omitempty"`
}

type TargetAttachedToTargetEvent

type TargetAttachedToTargetEvent struct {
	Method string `json:"method"`
	Params struct {
		SessionId          string            `json:"sessionId"`          // Identifier assigned to the session used to send/receive messages.
		TargetInfo         *TargetTargetInfo `json:"targetInfo"`         //
		WaitingForDebugger bool              `json:"waitingForDebugger"` //
	} `json:"Params,omitempty"`
}

Issued when attached to target because of auto-attach or `attachToTarget` command.

type TargetCloseTargetParams

type TargetCloseTargetParams struct {
	//
	TargetId string `json:"targetId"`
}

type TargetCreateBrowserContextParams added in v1.0.9

type TargetCreateBrowserContextParams struct {
	// If specified, disposes this context when debugging session disconnects.
	DisposeOnDetach bool `json:"disposeOnDetach,omitempty"`
	// Proxy server, similar to the one passed to --proxy-server
	ProxyServer string `json:"proxyServer,omitempty"`
	// Proxy bypass list, similar to the one passed to --proxy-bypass-list
	ProxyBypassList string `json:"proxyBypassList,omitempty"`
}

type TargetCreateTargetParams

type TargetCreateTargetParams struct {
	// The initial URL the page will be navigated to.
	Url string `json:"url"`
	// Frame width in DIP (headless chrome only).
	Width int `json:"width,omitempty"`
	// Frame height in DIP (headless chrome only).
	Height int `json:"height,omitempty"`
	// The browser context to create the page in.
	BrowserContextId string `json:"browserContextId,omitempty"`
	// Whether BeginFrames for this target will be controlled via DevTools (headless chrome only, not supported on MacOS yet, false by default).
	EnableBeginFrameControl bool `json:"enableBeginFrameControl,omitempty"`
	// Whether to create a new Window or Tab (chrome-only, false by default).
	NewWindow bool `json:"newWindow,omitempty"`
	// Whether to create the target in background or foreground (chrome-only, false by default).
	Background bool `json:"background,omitempty"`
}

type TargetDetachFromTargetParams

type TargetDetachFromTargetParams struct {
	// Session to detach.
	SessionId string `json:"sessionId,omitempty"`
	// Deprecated.
	TargetId string `json:"targetId,omitempty"`
}

type TargetDetachedFromTargetEvent

type TargetDetachedFromTargetEvent struct {
	Method string `json:"method"`
	Params struct {
		SessionId string `json:"sessionId"`          // Detached session identifier.
		TargetId  string `json:"targetId,omitempty"` // Deprecated.
	} `json:"Params,omitempty"`
}

Issued when detached from target for any reason (including `detachFromTarget` command). Can be issued multiple times per target if multiple sessions have been attached to it.

type TargetDisposeBrowserContextParams

type TargetDisposeBrowserContextParams struct {
	//
	BrowserContextId string `json:"browserContextId"`
}

type TargetExposeDevToolsProtocolParams

type TargetExposeDevToolsProtocolParams struct {
	//
	TargetId string `json:"targetId"`
	// Binding name, 'cdp' if not specified.
	BindingName string `json:"bindingName,omitempty"`
}

type TargetGetTargetInfoParams

type TargetGetTargetInfoParams struct {
	//
	TargetId string `json:"targetId,omitempty"`
}

type TargetReceivedMessageFromTargetEvent

type TargetReceivedMessageFromTargetEvent struct {
	Method string `json:"method"`
	Params struct {
		SessionId string `json:"sessionId"`          // Identifier of a session which sends a message.
		Message   string `json:"message"`            //
		TargetId  string `json:"targetId,omitempty"` // Deprecated.
	} `json:"Params,omitempty"`
}

Notifies about a new protocol message received from the session (as reported in `attachedToTarget` event).

type TargetRemoteLocation

type TargetRemoteLocation struct {
	Host string `json:"host"` //
	Port int    `json:"port"` //
}

No Description.

type TargetSendMessageToTargetParams

type TargetSendMessageToTargetParams struct {
	//
	Message string `json:"message"`
	// Identifier of the session.
	SessionId string `json:"sessionId,omitempty"`
	// Deprecated.
	TargetId string `json:"targetId,omitempty"`
}

type TargetSetAutoAttachParams

type TargetSetAutoAttachParams struct {
	// Whether to auto-attach to related targets.
	AutoAttach bool `json:"autoAttach"`
	// Whether to pause new targets when attaching to them. Use `Runtime.runIfWaitingForDebugger` to run paused targets.
	WaitForDebuggerOnStart bool `json:"waitForDebuggerOnStart"`
	// Enables "flat" access to the session via specifying sessionId attribute in the commands. We plan to make this the default, deprecate non-flattened mode, and eventually retire it. See crbug.com/991325.
	Flatten bool `json:"flatten,omitempty"`
}

type TargetSetDiscoverTargetsParams

type TargetSetDiscoverTargetsParams struct {
	// Whether to discover available targets.
	Discover bool `json:"discover"`
}

type TargetSetRemoteLocationsParams

type TargetSetRemoteLocationsParams struct {
	// List of remote locations.
	Locations []*TargetRemoteLocation `json:"locations"`
}

type TargetTargetCrashedEvent

type TargetTargetCrashedEvent struct {
	Method string `json:"method"`
	Params struct {
		TargetId  string `json:"targetId"`  //
		Status    string `json:"status"`    // Termination status type.
		ErrorCode int    `json:"errorCode"` // Termination error code.
	} `json:"Params,omitempty"`
}

Issued when a target has crashed.

type TargetTargetCreatedEvent

type TargetTargetCreatedEvent struct {
	Method string `json:"method"`
	Params struct {
		TargetInfo *TargetTargetInfo `json:"targetInfo"` //
	} `json:"Params,omitempty"`
}

Issued when a possible inspection target is created.

type TargetTargetDestroyedEvent

type TargetTargetDestroyedEvent struct {
	Method string `json:"method"`
	Params struct {
		TargetId string `json:"targetId"` //
	} `json:"Params,omitempty"`
}

Issued when a target is destroyed.

type TargetTargetInfo

type TargetTargetInfo struct {
	TargetId         string `json:"targetId"`                   //
	Type             string `json:"type"`                       //
	Title            string `json:"title"`                      //
	Url              string `json:"url"`                        //
	Attached         bool   `json:"attached"`                   // Whether the target has an attached client.
	OpenerId         string `json:"openerId,omitempty"`         // Opener target Id
	BrowserContextId string `json:"browserContextId,omitempty"` //
}

No Description.

type TargetTargetInfoChangedEvent

type TargetTargetInfoChangedEvent struct {
	Method string `json:"method"`
	Params struct {
		TargetInfo *TargetTargetInfo `json:"targetInfo"` //
	} `json:"Params,omitempty"`
}

Issued when some information about a target has changed. This only happens between `targetCreated` and `targetDestroyed`.

type Tethering

type Tethering struct {
	// contains filtered or unexported fields
}

func NewTethering

func NewTethering(target gcdmessage.ChromeTargeter) *Tethering

func (*Tethering) Bind

func (c *Tethering) Bind(port int) (*gcdmessage.ChromeResponse, error)

Bind - Request browser port binding. port - Port number to bind.

func (*Tethering) BindWithParams

func (c *Tethering) BindWithParams(v *TetheringBindParams) (*gcdmessage.ChromeResponse, error)

BindWithParams - Request browser port binding.

func (*Tethering) Unbind

func (c *Tethering) Unbind(port int) (*gcdmessage.ChromeResponse, error)

Unbind - Request browser port unbinding. port - Port number to unbind.

func (*Tethering) UnbindWithParams

func (c *Tethering) UnbindWithParams(v *TetheringUnbindParams) (*gcdmessage.ChromeResponse, error)

UnbindWithParams - Request browser port unbinding.

type TetheringAcceptedEvent

type TetheringAcceptedEvent struct {
	Method string `json:"method"`
	Params struct {
		Port         int    `json:"port"`         // Port number that was successfully bound.
		ConnectionId string `json:"connectionId"` // Connection id to be used.
	} `json:"Params,omitempty"`
}

Informs that port was successfully bound and got a specified connection id.

type TetheringBindParams

type TetheringBindParams struct {
	// Port number to bind.
	Port int `json:"port"`
}

type TetheringUnbindParams

type TetheringUnbindParams struct {
	// Port number to unbind.
	Port int `json:"port"`
}

type Tracing

type Tracing struct {
	// contains filtered or unexported fields
}

func NewTracing

func NewTracing(target gcdmessage.ChromeTargeter) *Tracing

func (*Tracing) End

func (c *Tracing) End() (*gcdmessage.ChromeResponse, error)

Stop trace events collection.

func (*Tracing) GetCategories

func (c *Tracing) GetCategories() ([]string, error)

GetCategories - Gets supported tracing categories. Returns - categories - A list of supported tracing categories.

func (*Tracing) RecordClockSyncMarker

func (c *Tracing) RecordClockSyncMarker(syncId string) (*gcdmessage.ChromeResponse, error)

RecordClockSyncMarker - Record a clock sync marker in the trace. syncId - The ID of this clock sync marker

func (*Tracing) RecordClockSyncMarkerWithParams

func (c *Tracing) RecordClockSyncMarkerWithParams(v *TracingRecordClockSyncMarkerParams) (*gcdmessage.ChromeResponse, error)

RecordClockSyncMarkerWithParams - Record a clock sync marker in the trace.

func (*Tracing) RequestMemoryDump

func (c *Tracing) RequestMemoryDump(deterministic bool) (string, bool, error)

RequestMemoryDump - Request a global memory dump. deterministic - Enables more deterministic results by forcing garbage collection Returns - dumpGuid - GUID of the resulting global memory dump. success - True iff the global memory dump succeeded.

func (*Tracing) RequestMemoryDumpWithParams added in v1.0.9

func (c *Tracing) RequestMemoryDumpWithParams(v *TracingRequestMemoryDumpParams) (string, bool, error)

RequestMemoryDumpWithParams - Request a global memory dump. Returns - dumpGuid - GUID of the resulting global memory dump. success - True iff the global memory dump succeeded.

func (*Tracing) Start

func (c *Tracing) Start(categories string, options string, bufferUsageReportingInterval float64, transferMode string, streamFormat string, streamCompression string, traceConfig *TracingTraceConfig) (*gcdmessage.ChromeResponse, error)

Start - Start trace events collection. categories - Category/tag filter options - Tracing options bufferUsageReportingInterval - If set, the agent will issue bufferUsage events at this interval, specified in milliseconds transferMode - Whether to report trace events as series of dataCollected events or to save trace to a stream (defaults to `ReportEvents`). streamFormat - Trace data format to use. This only applies when using `ReturnAsStream` transfer mode (defaults to `json`). enum values: json, proto streamCompression - Compression format to use. This only applies when using `ReturnAsStream` transfer mode (defaults to `none`) enum values: none, gzip traceConfig -

func (*Tracing) StartWithParams

func (c *Tracing) StartWithParams(v *TracingStartParams) (*gcdmessage.ChromeResponse, error)

StartWithParams - Start trace events collection.

type TracingBufferUsageEvent

type TracingBufferUsageEvent struct {
	Method string `json:"method"`
	Params struct {
		PercentFull float64 `json:"percentFull,omitempty"` // A number in range [0..1] that indicates the used size of event buffer as a fraction of its total size.
		EventCount  float64 `json:"eventCount,omitempty"`  // An approximate number of events in the trace log.
		Value       float64 `json:"value,omitempty"`       // A number in range [0..1] that indicates the used size of event buffer as a fraction of its total size.
	} `json:"Params,omitempty"`
}

type TracingRecordClockSyncMarkerParams

type TracingRecordClockSyncMarkerParams struct {
	// The ID of this clock sync marker
	SyncId string `json:"syncId"`
}

type TracingRequestMemoryDumpParams added in v1.0.9

type TracingRequestMemoryDumpParams struct {
	// Enables more deterministic results by forcing garbage collection
	Deterministic bool `json:"deterministic,omitempty"`
}

type TracingStartParams

type TracingStartParams struct {
	// Category/tag filter
	Categories string `json:"categories,omitempty"`
	// Tracing options
	Options string `json:"options,omitempty"`
	// If set, the agent will issue bufferUsage events at this interval, specified in milliseconds
	BufferUsageReportingInterval float64 `json:"bufferUsageReportingInterval,omitempty"`
	// Whether to report trace events as series of dataCollected events or to save trace to a stream (defaults to `ReportEvents`).
	TransferMode string `json:"transferMode,omitempty"`
	// Trace data format to use. This only applies when using `ReturnAsStream` transfer mode (defaults to `json`). enum values: json, proto
	StreamFormat string `json:"streamFormat,omitempty"`
	// Compression format to use. This only applies when using `ReturnAsStream` transfer mode (defaults to `none`) enum values: none, gzip
	StreamCompression string `json:"streamCompression,omitempty"`
	//
	TraceConfig *TracingTraceConfig `json:"traceConfig,omitempty"`
}

type TracingTraceConfig

type TracingTraceConfig struct {
	RecordMode           string                 `json:"recordMode,omitempty"`           // Controls how the trace buffer stores data.
	EnableSampling       bool                   `json:"enableSampling,omitempty"`       // Turns on JavaScript stack sampling.
	EnableSystrace       bool                   `json:"enableSystrace,omitempty"`       // Turns on system tracing.
	EnableArgumentFilter bool                   `json:"enableArgumentFilter,omitempty"` // Turns on argument filter.
	IncludedCategories   []string               `json:"includedCategories,omitempty"`   // Included category filters.
	ExcludedCategories   []string               `json:"excludedCategories,omitempty"`   // Excluded category filters.
	SyntheticDelays      []string               `json:"syntheticDelays,omitempty"`      // Configuration to synthesize the delays in tracing.
	MemoryDumpConfig     map[string]interface{} `json:"memoryDumpConfig,omitempty"`     // Configuration for memory dump triggers. Used only when "memory-infra" category is enabled.
}

No Description.

type TracingTracingCompleteEvent

type TracingTracingCompleteEvent struct {
	Method string `json:"method"`
	Params struct {
		DataLossOccurred  bool   `json:"dataLossOccurred"`            // Indicates whether some trace data is known to have been lost, e.g. because the trace ring buffer wrapped around.
		Stream            string `json:"stream,omitempty"`            // A handle of the stream that holds resulting trace data.
		TraceFormat       string `json:"traceFormat,omitempty"`       // Trace data format of returned stream. enum values: json, proto
		StreamCompression string `json:"streamCompression,omitempty"` // Compression format of returned stream. enum values: none, gzip
	} `json:"Params,omitempty"`
}

Signals that tracing is stopped and there is no trace buffers pending flush, all data were delivered via dataCollected events.

type WebAudio added in v1.0.6

type WebAudio struct {
	// contains filtered or unexported fields
}

func NewWebAudio added in v1.0.6

func NewWebAudio(target gcdmessage.ChromeTargeter) *WebAudio

func (*WebAudio) Disable added in v1.0.6

func (c *WebAudio) Disable() (*gcdmessage.ChromeResponse, error)

Disables the WebAudio domain.

func (*WebAudio) Enable added in v1.0.6

func (c *WebAudio) Enable() (*gcdmessage.ChromeResponse, error)

Enables the WebAudio domain and starts sending context lifetime events.

func (*WebAudio) GetRealtimeData added in v1.0.6

func (c *WebAudio) GetRealtimeData(contextId string) (*WebAudioContextRealtimeData, error)

GetRealtimeData - Fetch the realtime data from the registered contexts. contextId - Returns - realtimeData -

func (*WebAudio) GetRealtimeDataWithParams added in v1.0.6

func (c *WebAudio) GetRealtimeDataWithParams(v *WebAudioGetRealtimeDataParams) (*WebAudioContextRealtimeData, error)

GetRealtimeDataWithParams - Fetch the realtime data from the registered contexts. Returns - realtimeData -

type WebAudioAudioListener added in v1.0.9

type WebAudioAudioListener struct {
	ListenerId string `json:"listenerId"` //
	ContextId  string `json:"contextId"`  //
}

Protocol object for AudioListner

type WebAudioAudioListenerCreatedEvent added in v1.0.9

type WebAudioAudioListenerCreatedEvent struct {
	Method string `json:"method"`
	Params struct {
		Listener *WebAudioAudioListener `json:"listener"` //
	} `json:"Params,omitempty"`
}

Notifies that the construction of an AudioListener has finished.

type WebAudioAudioListenerWillBeDestroyedEvent added in v1.0.9

type WebAudioAudioListenerWillBeDestroyedEvent struct {
	Method string `json:"method"`
	Params struct {
		ContextId  string `json:"contextId"`  //
		ListenerId string `json:"listenerId"` //
	} `json:"Params,omitempty"`
}

Notifies that a new AudioListener has been created.

type WebAudioAudioNode added in v1.0.9

type WebAudioAudioNode struct {
	NodeId                string  `json:"nodeId"`                //
	ContextId             string  `json:"contextId"`             //
	NodeType              string  `json:"nodeType"`              //
	NumberOfInputs        float64 `json:"numberOfInputs"`        //
	NumberOfOutputs       float64 `json:"numberOfOutputs"`       //
	ChannelCount          float64 `json:"channelCount"`          //
	ChannelCountMode      string  `json:"channelCountMode"`      //  enum values: clamped-max, explicit, max
	ChannelInterpretation string  `json:"channelInterpretation"` //  enum values: discrete, speakers
}

Protocol object for AudioNode

type WebAudioAudioNodeCreatedEvent added in v1.0.9

type WebAudioAudioNodeCreatedEvent struct {
	Method string `json:"method"`
	Params struct {
		Node *WebAudioAudioNode `json:"node"` //
	} `json:"Params,omitempty"`
}

Notifies that a new AudioNode has been created.

type WebAudioAudioNodeWillBeDestroyedEvent added in v1.0.9

type WebAudioAudioNodeWillBeDestroyedEvent struct {
	Method string `json:"method"`
	Params struct {
		ContextId string `json:"contextId"` //
		NodeId    string `json:"nodeId"`    //
	} `json:"Params,omitempty"`
}

Notifies that an existing AudioNode has been destroyed.

type WebAudioAudioParam added in v1.0.9

type WebAudioAudioParam struct {
	ParamId      string  `json:"paramId"`      //
	NodeId       string  `json:"nodeId"`       //
	ContextId    string  `json:"contextId"`    //
	ParamType    string  `json:"paramType"`    //
	Rate         string  `json:"rate"`         //  enum values: a-rate, k-rate
	DefaultValue float64 `json:"defaultValue"` //
	MinValue     float64 `json:"minValue"`     //
	MaxValue     float64 `json:"maxValue"`     //
}

Protocol object for AudioParam

type WebAudioAudioParamCreatedEvent added in v1.0.9

type WebAudioAudioParamCreatedEvent struct {
	Method string `json:"method"`
	Params struct {
		Param *WebAudioAudioParam `json:"param"` //
	} `json:"Params,omitempty"`
}

Notifies that a new AudioParam has been created.

type WebAudioAudioParamWillBeDestroyedEvent added in v1.0.9

type WebAudioAudioParamWillBeDestroyedEvent struct {
	Method string `json:"method"`
	Params struct {
		ContextId string `json:"contextId"` //
		NodeId    string `json:"nodeId"`    //
		ParamId   string `json:"paramId"`   //
	} `json:"Params,omitempty"`
}

Notifies that an existing AudioParam has been destroyed.

type WebAudioBaseAudioContext added in v1.0.6

type WebAudioBaseAudioContext struct {
	ContextId             string                       `json:"contextId"`              //
	ContextType           string                       `json:"contextType"`            //  enum values: realtime, offline
	ContextState          string                       `json:"contextState"`           //  enum values: suspended, running, closed
	RealtimeData          *WebAudioContextRealtimeData `json:"realtimeData,omitempty"` //
	CallbackBufferSize    float64                      `json:"callbackBufferSize"`     // Platform-dependent callback buffer size.
	MaxOutputChannelCount float64                      `json:"maxOutputChannelCount"`  // Number of output channels supported by audio hardware in use.
	SampleRate            float64                      `json:"sampleRate"`             // Context sample rate.
}

Protocol object for BaseAudioContext

type WebAudioContextChangedEvent added in v1.0.6

type WebAudioContextChangedEvent struct {
	Method string `json:"method"`
	Params struct {
		Context *WebAudioBaseAudioContext `json:"context"` //
	} `json:"Params,omitempty"`
}

Notifies that existing BaseAudioContext has changed some properties (id stays the same)..

type WebAudioContextCreatedEvent added in v1.0.6

type WebAudioContextCreatedEvent struct {
	Method string `json:"method"`
	Params struct {
		Context *WebAudioBaseAudioContext `json:"context"` //
	} `json:"Params,omitempty"`
}

Notifies that a new BaseAudioContext has been created.

type WebAudioContextRealtimeData added in v1.0.6

type WebAudioContextRealtimeData struct {
	CurrentTime              float64 `json:"currentTime"`              // The current context time in second in BaseAudioContext.
	RenderCapacity           float64 `json:"renderCapacity"`           // The time spent on rendering graph divided by render qunatum duration, and multiplied by 100. 100 means the audio renderer reached the full capacity and glitch may occur.
	CallbackIntervalMean     float64 `json:"callbackIntervalMean"`     // A running mean of callback interval.
	CallbackIntervalVariance float64 `json:"callbackIntervalVariance"` // A running variance of callback interval.
}

Fields in AudioContext that change in real-time.

type WebAudioContextWillBeDestroyedEvent added in v1.0.9

type WebAudioContextWillBeDestroyedEvent struct {
	Method string `json:"method"`
	Params struct {
		ContextId string `json:"contextId"` //
	} `json:"Params,omitempty"`
}

Notifies that an existing BaseAudioContext will be destroyed.

type WebAudioGetRealtimeDataParams added in v1.0.6

type WebAudioGetRealtimeDataParams struct {
	//
	ContextId string `json:"contextId"`
}

type WebAudioNodeParamConnectedEvent added in v1.0.9

type WebAudioNodeParamConnectedEvent struct {
	Method string `json:"method"`
	Params struct {
		ContextId         string  `json:"contextId"`                   //
		SourceId          string  `json:"sourceId"`                    //
		DestinationId     string  `json:"destinationId"`               //
		SourceOutputIndex float64 `json:"sourceOutputIndex,omitempty"` //
	} `json:"Params,omitempty"`
}

Notifies that an AudioNode is connected to an AudioParam.

type WebAudioNodeParamDisconnectedEvent added in v1.0.9

type WebAudioNodeParamDisconnectedEvent struct {
	Method string `json:"method"`
	Params struct {
		ContextId         string  `json:"contextId"`                   //
		SourceId          string  `json:"sourceId"`                    //
		DestinationId     string  `json:"destinationId"`               //
		SourceOutputIndex float64 `json:"sourceOutputIndex,omitempty"` //
	} `json:"Params,omitempty"`
}

Notifies that an AudioNode is disconnected to an AudioParam.

type WebAudioNodesConnectedEvent added in v1.0.9

type WebAudioNodesConnectedEvent struct {
	Method string `json:"method"`
	Params struct {
		ContextId             string  `json:"contextId"`                       //
		SourceId              string  `json:"sourceId"`                        //
		DestinationId         string  `json:"destinationId"`                   //
		SourceOutputIndex     float64 `json:"sourceOutputIndex,omitempty"`     //
		DestinationInputIndex float64 `json:"destinationInputIndex,omitempty"` //
	} `json:"Params,omitempty"`
}

Notifies that two AudioNodes are connected.

type WebAudioNodesDisconnectedEvent added in v1.0.9

type WebAudioNodesDisconnectedEvent struct {
	Method string `json:"method"`
	Params struct {
		ContextId             string  `json:"contextId"`                       //
		SourceId              string  `json:"sourceId"`                        //
		DestinationId         string  `json:"destinationId"`                   //
		SourceOutputIndex     float64 `json:"sourceOutputIndex,omitempty"`     //
		DestinationInputIndex float64 `json:"destinationInputIndex,omitempty"` //
	} `json:"Params,omitempty"`
}

Notifies that AudioNodes are disconnected. The destination can be null, and it means all the outgoing connections from the source are disconnected.

type WebAuthn added in v1.0.7

type WebAuthn struct {
	// contains filtered or unexported fields
}

func NewWebAuthn added in v1.0.7

func NewWebAuthn(target gcdmessage.ChromeTargeter) *WebAuthn

func (*WebAuthn) AddCredential added in v1.0.7

func (c *WebAuthn) AddCredential(authenticatorId string, credential *WebAuthnCredential) (*gcdmessage.ChromeResponse, error)

AddCredential - Adds the credential to the specified authenticator. authenticatorId - credential -

func (*WebAuthn) AddCredentialWithParams added in v1.0.7

func (c *WebAuthn) AddCredentialWithParams(v *WebAuthnAddCredentialParams) (*gcdmessage.ChromeResponse, error)

AddCredentialWithParams - Adds the credential to the specified authenticator.

func (*WebAuthn) AddVirtualAuthenticator added in v1.0.7

func (c *WebAuthn) AddVirtualAuthenticator(options *WebAuthnVirtualAuthenticatorOptions) (string, error)

AddVirtualAuthenticator - Creates and adds a virtual authenticator. options - Returns - authenticatorId -

func (*WebAuthn) AddVirtualAuthenticatorWithParams added in v1.0.7

func (c *WebAuthn) AddVirtualAuthenticatorWithParams(v *WebAuthnAddVirtualAuthenticatorParams) (string, error)

AddVirtualAuthenticatorWithParams - Creates and adds a virtual authenticator. Returns - authenticatorId -

func (*WebAuthn) ClearCredentials added in v1.0.7

func (c *WebAuthn) ClearCredentials(authenticatorId string) (*gcdmessage.ChromeResponse, error)

ClearCredentials - Clears all the credentials from the specified device. authenticatorId -

func (*WebAuthn) ClearCredentialsWithParams added in v1.0.7

func (c *WebAuthn) ClearCredentialsWithParams(v *WebAuthnClearCredentialsParams) (*gcdmessage.ChromeResponse, error)

ClearCredentialsWithParams - Clears all the credentials from the specified device.

func (*WebAuthn) Disable added in v1.0.7

func (c *WebAuthn) Disable() (*gcdmessage.ChromeResponse, error)

Disable the WebAuthn domain.

func (*WebAuthn) Enable added in v1.0.7

func (c *WebAuthn) Enable() (*gcdmessage.ChromeResponse, error)

Enable the WebAuthn domain and start intercepting credential storage and retrieval with a virtual authenticator.

func (*WebAuthn) GetCredential added in v1.0.9

func (c *WebAuthn) GetCredential(authenticatorId string, credentialId string) (*WebAuthnCredential, error)

GetCredential - Returns a single credential stored in the given virtual authenticator that matches the credential ID. authenticatorId - credentialId - Returns - credential -

func (*WebAuthn) GetCredentialWithParams added in v1.0.9

func (c *WebAuthn) GetCredentialWithParams(v *WebAuthnGetCredentialParams) (*WebAuthnCredential, error)

GetCredentialWithParams - Returns a single credential stored in the given virtual authenticator that matches the credential ID. Returns - credential -

func (*WebAuthn) GetCredentials added in v1.0.7

func (c *WebAuthn) GetCredentials(authenticatorId string) ([]*WebAuthnCredential, error)

GetCredentials - Returns all the credentials stored in the given virtual authenticator. authenticatorId - Returns - credentials -

func (*WebAuthn) GetCredentialsWithParams added in v1.0.7

func (c *WebAuthn) GetCredentialsWithParams(v *WebAuthnGetCredentialsParams) ([]*WebAuthnCredential, error)

GetCredentialsWithParams - Returns all the credentials stored in the given virtual authenticator. Returns - credentials -

func (*WebAuthn) RemoveCredential added in v1.0.9

func (c *WebAuthn) RemoveCredential(authenticatorId string, credentialId string) (*gcdmessage.ChromeResponse, error)

RemoveCredential - Removes a credential from the authenticator. authenticatorId - credentialId -

func (*WebAuthn) RemoveCredentialWithParams added in v1.0.9

func (c *WebAuthn) RemoveCredentialWithParams(v *WebAuthnRemoveCredentialParams) (*gcdmessage.ChromeResponse, error)

RemoveCredentialWithParams - Removes a credential from the authenticator.

func (*WebAuthn) RemoveVirtualAuthenticator added in v1.0.7

func (c *WebAuthn) RemoveVirtualAuthenticator(authenticatorId string) (*gcdmessage.ChromeResponse, error)

RemoveVirtualAuthenticator - Removes the given authenticator. authenticatorId -

func (*WebAuthn) RemoveVirtualAuthenticatorWithParams added in v1.0.7

func (c *WebAuthn) RemoveVirtualAuthenticatorWithParams(v *WebAuthnRemoveVirtualAuthenticatorParams) (*gcdmessage.ChromeResponse, error)

RemoveVirtualAuthenticatorWithParams - Removes the given authenticator.

func (*WebAuthn) SetUserVerified added in v1.0.7

func (c *WebAuthn) SetUserVerified(authenticatorId string, isUserVerified bool) (*gcdmessage.ChromeResponse, error)

SetUserVerified - Sets whether User Verification succeeds or fails for an authenticator. The default is true. authenticatorId - isUserVerified -

func (*WebAuthn) SetUserVerifiedWithParams added in v1.0.7

func (c *WebAuthn) SetUserVerifiedWithParams(v *WebAuthnSetUserVerifiedParams) (*gcdmessage.ChromeResponse, error)

SetUserVerifiedWithParams - Sets whether User Verification succeeds or fails for an authenticator. The default is true.

type WebAuthnAddCredentialParams added in v1.0.7

type WebAuthnAddCredentialParams struct {
	//
	AuthenticatorId string `json:"authenticatorId"`
	//
	Credential *WebAuthnCredential `json:"credential"`
}

type WebAuthnAddVirtualAuthenticatorParams added in v1.0.7

type WebAuthnAddVirtualAuthenticatorParams struct {
	//
	Options *WebAuthnVirtualAuthenticatorOptions `json:"options"`
}

type WebAuthnClearCredentialsParams added in v1.0.7

type WebAuthnClearCredentialsParams struct {
	//
	AuthenticatorId string `json:"authenticatorId"`
}

type WebAuthnCredential added in v1.0.7

type WebAuthnCredential struct {
	CredentialId         string `json:"credentialId"`         //
	IsResidentCredential bool   `json:"isResidentCredential"` //
	RpId                 string `json:"rpId,omitempty"`       // Relying Party ID the credential is scoped to. Must be set when adding a credential.
	PrivateKey           string `json:"privateKey"`           // The ECDSA P-256 private key in PKCS#8 format.
	UserHandle           string `json:"userHandle,omitempty"` // An opaque byte sequence with a maximum size of 64 bytes mapping the credential to a specific user.
	SignCount            int    `json:"signCount"`            // Signature counter. This is incremented by one for each successful assertion. See https://w3c.github.io/webauthn/#signature-counter
}

No Description.

type WebAuthnGetCredentialParams added in v1.0.9

type WebAuthnGetCredentialParams struct {
	//
	AuthenticatorId string `json:"authenticatorId"`
	//
	CredentialId string `json:"credentialId"`
}

type WebAuthnGetCredentialsParams added in v1.0.7

type WebAuthnGetCredentialsParams struct {
	//
	AuthenticatorId string `json:"authenticatorId"`
}

type WebAuthnRemoveCredentialParams added in v1.0.9

type WebAuthnRemoveCredentialParams struct {
	//
	AuthenticatorId string `json:"authenticatorId"`
	//
	CredentialId string `json:"credentialId"`
}

type WebAuthnRemoveVirtualAuthenticatorParams added in v1.0.7

type WebAuthnRemoveVirtualAuthenticatorParams struct {
	//
	AuthenticatorId string `json:"authenticatorId"`
}

type WebAuthnSetUserVerifiedParams added in v1.0.7

type WebAuthnSetUserVerifiedParams struct {
	//
	AuthenticatorId string `json:"authenticatorId"`
	//
	IsUserVerified bool `json:"isUserVerified"`
}

type WebAuthnVirtualAuthenticatorOptions added in v1.0.7

type WebAuthnVirtualAuthenticatorOptions struct {
	Protocol                    string `json:"protocol"`                              //  enum values: u2f, ctap2
	Transport                   string `json:"transport"`                             //  enum values: usb, nfc, ble, cable, internal
	HasResidentKey              bool   `json:"hasResidentKey,omitempty"`              // Defaults to false.
	HasUserVerification         bool   `json:"hasUserVerification,omitempty"`         // Defaults to false.
	AutomaticPresenceSimulation bool   `json:"automaticPresenceSimulation,omitempty"` // If set to true, tests of user presence will succeed immediately. Otherwise, they will not be resolved. Defaults to true.
	IsUserVerified              bool   `json:"isUserVerified,omitempty"`              // Sets whether User Verification succeeds or fails for an authenticator. Defaults to false.
}

No Description.

Jump to

Keyboard shortcuts

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