socket

package
v1.0.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2018 License: BSD-2-Clause Imports: 47 Imported by: 0

Documentation

Overview

Package socket allows for tools to instrument, inspect, debug and profile Chromium, Chrome and other Blink-based browsers. Many existing projects currently use the protocol. The Chrome DevTools team maintains the protocol API.

See https://chromedevtools.github.io/devtools-protocol/ for details.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NextSocketID

func NextSocketID() int

NextSocketID increments and returns the socket ID for mapping Commander structs to socket responses.

Types

type AccessibilityProtocol

type AccessibilityProtocol struct {
	Socket Socketer
}

AccessibilityProtocol provides a namespace for the Chrome Accessibility protocol methods.

https://chromedevtools.github.io/devtools-protocol/tot/Accessibility/ EXPERIMENTAL.

func (*AccessibilityProtocol) GetPartialAXTree

func (protocol *AccessibilityProtocol) GetPartialAXTree(
	params *accessibility.PartialAXTreeParams,
) <-chan *accessibility.PartialAXTreeResult

GetPartialAXTree fetches the accessibility node and partial accessibility tree for this DOM node, if it exists.

https://chromedevtools.github.io/devtools-protocol/tot/Accessibility/#method-getPartialAXTree

type AnimationProtocol

type AnimationProtocol struct {
	Socket Socketer
}

AnimationProtocol provides a namespace for the Chrome Animation protocol methods.

https://chromedevtools.github.io/devtools-protocol/tot/Animation/ EXPERIMENTAL.

func (*AnimationProtocol) Disable

func (protocol *AnimationProtocol) Disable() <-chan *animation.DisableResult

Disable animation domain notifications.

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

func (*AnimationProtocol) Enable

func (protocol *AnimationProtocol) Enable() <-chan *animation.EnableResult

Enable animation domain notifications.

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

func (*AnimationProtocol) GetCurrentTime

func (protocol *AnimationProtocol) GetCurrentTime(
	params *animation.GetCurrentTimeParams,
) <-chan *animation.GetCurrentTimeResult

GetCurrentTime returns the current time of the an animation.

https://chromedevtools.github.io/devtools-protocol/tot/Animation/#method-getCurrentTime

func (*AnimationProtocol) GetPlaybackRate

func (protocol *AnimationProtocol) GetPlaybackRate() <-chan *animation.GetPlaybackRateResult

GetPlaybackRate gets the playback rate of the document timeline.

https://chromedevtools.github.io/devtools-protocol/tot/Animation/#method-getPlaybackRate

func (*AnimationProtocol) OnAnimationCanceled

func (protocol *AnimationProtocol) OnAnimationCanceled(
	callback func(event *animation.CanceledEvent),
)

OnAnimationCanceled adds a handler to the Animation.Canceled event. Animation.Canceled fires when when an animation has been cancelled.

https://chromedevtools.github.io/devtools-protocol/tot/Animation/#event-animationCanceled

func (*AnimationProtocol) OnAnimationCreated

func (protocol *AnimationProtocol) OnAnimationCreated(
	callback func(event *animation.CreatedEvent),
)

OnAnimationCreated adds a handler to the Animation.Created event. Animation.Created fires for each animation that has been created.

https://chromedevtools.github.io/devtools-protocol/tot/Animation/#event-animationCreated

func (*AnimationProtocol) OnAnimationStarted

func (protocol *AnimationProtocol) OnAnimationStarted(
	callback func(event *animation.StartedEvent),
)

OnAnimationStarted adds a handler to the Animation.Started event. Animation.Started fires for each animation that has been started.

https://chromedevtools.github.io/devtools-protocol/tot/Animation/#event-animationStarted

func (*AnimationProtocol) ReleaseAnimations

func (protocol *AnimationProtocol) ReleaseAnimations(
	params *animation.ReleaseAnimationsParams,
) <-chan *animation.ReleaseAnimationsResult

ReleaseAnimations releases a set of animations to no longer be manipulated.

https://chromedevtools.github.io/devtools-protocol/tot/Animation/#method-releaseAnimations

func (*AnimationProtocol) ResolveAnimation

func (protocol *AnimationProtocol) ResolveAnimation(
	params *animation.ResolveAnimationParams,
) <-chan *animation.ResolveAnimationResult

ResolveAnimation gets the remote object of the Animation.

https://chromedevtools.github.io/devtools-protocol/tot/Animation/#method-resolveAnimation

func (*AnimationProtocol) SeekAnimations

func (protocol *AnimationProtocol) SeekAnimations(
	params *animation.SeekAnimationsParams,
) <-chan *animation.SeekAnimationsResult

SeekAnimations seeks a set of animations to a particular time within each animation.

https://chromedevtools.github.io/devtools-protocol/tot/Animation/#method-seekAnimations

func (*AnimationProtocol) SetPaused

func (protocol *AnimationProtocol) SetPaused(
	params *animation.SetPausedParams,
) <-chan *animation.SetPausedResult

SetPaused sets the paused state of a set of animations.

https://chromedevtools.github.io/devtools-protocol/tot/Animation/#method-setPaused

func (*AnimationProtocol) SetPlaybackRate

func (protocol *AnimationProtocol) SetPlaybackRate(
	params *animation.SetPlaybackRateParams,
) <-chan *animation.SetPlaybackRateResult

SetPlaybackRate sets the playback rate of the document timeline.

https://chromedevtools.github.io/devtools-protocol/tot/Animation/#method-setPlaybackRate

func (*AnimationProtocol) SetTiming

func (protocol *AnimationProtocol) SetTiming(
	params *animation.SetTimingParams,
) <-chan *animation.SetTimingResult

SetTiming sets the timing of an animation node.

https://chromedevtools.github.io/devtools-protocol/tot/Animation/#method-setTiming

type ApplicationCacheProtocol

type ApplicationCacheProtocol struct {
	Socket Socketer
}

ApplicationCacheProtocol provides a namespace for the Chrome Animation protocol methods.

https://chromedevtools.github.io/devtools-protocol/tot/ApplicationCache/ EXPERIMENTAL.

func (*ApplicationCacheProtocol) Enable

func (protocol *ApplicationCacheProtocol) Enable() <-chan *cache.EnableResult

Enable enables application cache domain notifications.

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

func (*ApplicationCacheProtocol) GetForFrame

func (protocol *ApplicationCacheProtocol) GetForFrame(
	params *cache.GetForFrameParams,
) <-chan *cache.GetForFrameResult

GetForFrame returns relevant application cache data for the document in given frame.

https://chromedevtools.github.io/devtools-protocol/tot/ApplicationCache/#method-getApplicationCacheForFrame

func (*ApplicationCacheProtocol) GetFramesWithManifests

func (protocol *ApplicationCacheProtocol) GetFramesWithManifests() <-chan *cache.GetFramesWithManifestsResult

GetFramesWithManifests returns array of frame identifiers with manifest urls for each frame containing a document associated with some application cache.

https://chromedevtools.github.io/devtools-protocol/tot/ApplicationCache/#method-getFramesWithManifests

func (*ApplicationCacheProtocol) GetManifestForFrame

func (protocol *ApplicationCacheProtocol) GetManifestForFrame(
	params *cache.GetManifestForFrameParams,
) <-chan *cache.GetManifestForFrameResult

GetManifestForFrame returns manifest URL for document in the given frame.

https://chromedevtools.github.io/devtools-protocol/tot/ApplicationCache/#method-getManifestForFrame

func (*ApplicationCacheProtocol) OnApplicationCacheStatusUpdated

func (protocol *ApplicationCacheProtocol) OnApplicationCacheStatusUpdated(
	callback func(event *cache.StatusUpdatedEvent),
)

OnApplicationCacheStatusUpdated adds a handler to the ApplicationCache.StatusUpdated event.

https://chromedevtools.github.io/devtools-protocol/tot/ApplicationCache/#event-applicationCacheStatusUpdated

func (*ApplicationCacheProtocol) OnNetworkStateUpdated

func (protocol *ApplicationCacheProtocol) OnNetworkStateUpdated(
	callback func(event *cache.NetworkStateUpdatedEvent),
)

OnNetworkStateUpdated adds a handler to the ApplicationCache.StatusUpdated event.

https://chromedevtools.github.io/devtools-protocol/tot/ApplicationCache/#event-networkStateUpdated

type AuditsProtocol

type AuditsProtocol struct {
	Socket Socketer
}

AuditsProtocol provides a namespace for the Chrome Audits protocol methods. The Audits protocol allows investigation of page violations and possible improvements.

https://chromedevtools.github.io/devtools-protocol/tot/Audits/ EXPERIMENTAL.

func (*AuditsProtocol) GetEncodedResponse

func (protocol *AuditsProtocol) GetEncodedResponse(
	params *audits.GetEncodedResponseParams,
) <-chan *audits.GetEncodedResponseResult

GetEncodedResponse returns the response body and size if it were re-encoded with the specified settings. Only applies to images.

https://chromedevtools.github.io/devtools-protocol/tot/Audits/#method-getEncodedResponse

type BrowserProtocol

type BrowserProtocol struct {
	Socket Socketer
}

BrowserProtocol provides a namespace for the Chrome Browser protocol methods. The Browser protocol defines methods and events for browser management.

https://chromedevtools.github.io/devtools-protocol/tot/Browser/

func (*BrowserProtocol) Close

func (protocol *BrowserProtocol) Close() <-chan *browser.CloseResult

Close closes the browser gracefully.

https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-close

func (*BrowserProtocol) GetVersion

func (protocol *BrowserProtocol) GetVersion() <-chan *browser.GetVersionResult

GetVersion returns version information.

https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-getVersion

func (*BrowserProtocol) GetWindowBounds

func (protocol *BrowserProtocol) GetWindowBounds(
	params *browser.GetWindowBoundsParams,
) <-chan *browser.GetWindowBoundsResult

GetWindowBounds sets the position and/or size of the browser window.

https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-getWindowBounds EXPERIMENTAL.

func (*BrowserProtocol) GetWindowForTarget

func (protocol *BrowserProtocol) GetWindowForTarget(
	params *browser.GetWindowForTargetParams,
) <-chan *browser.GetWindowForTargetResult

GetWindowForTarget gets the browser window that contains the devtools target.

https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-getWindowForTarget EXPERIMENTAL.

func (*BrowserProtocol) SetWindowBounds

func (protocol *BrowserProtocol) SetWindowBounds(
	params *browser.SetWindowBoundsParams,
) <-chan *browser.SetWindowBoundsResult

SetWindowBounds sets the position and/or size of the browser window.

https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-setWindowBounds EXPERIMENTAL.

type CSSProtocol

type CSSProtocol struct {
	Socket Socketer
}

CSSProtocol provides a namespace for the Chrome CSS protocol methods. The CSS protocol exposes CSS read/write operations. All CSS objects (stylesheets, rules, and styles) have an associated id used in subsequent operations on the related object. Each object type has a specific ID structure, and those are not interchangeable between objects of different kinds. CSS objects can be loaded using the get*ForNode() calls (which accept a DOM node id). A client can also keep track of stylesheets via the styleSheetAdded/styleSheetRemoved events and subsequently load the required stylesheet contents using the getStyleSheet[Text]() methods.

https://chromedevtools.github.io/devtools-protocol/tot/CSS/

func (*CSSProtocol) AddRule

func (protocol *CSSProtocol) AddRule(
	params *css.AddRuleParams,
) <-chan *css.AddRuleResult

AddRule inserts a new rule with the given ruleText in a stylesheet with given styleSheetId, at the position specified by location.

https://chromedevtools.github.io/devtools-protocol/tot/CSS/#method-addRule

func (*CSSProtocol) CollectClassNames

func (protocol *CSSProtocol) CollectClassNames(
	params *css.CollectClassNamesParams,
) <-chan *css.CollectClassNamesResult

CollectClassNames returns all class names from specified stylesheet.

https://chromedevtools.github.io/devtools-protocol/tot/CSS/#method-collectClassNames

func (*CSSProtocol) CreateStyleSheet

func (protocol *CSSProtocol) CreateStyleSheet(
	params *css.CreateStyleSheetParams,
) <-chan *css.CreateStyleSheetResult

CreateStyleSheet creates a new special "via-inspector" stylesheet in the frame with given frameId.

https://chromedevtools.github.io/devtools-protocol/tot/CSS/#method-createStyleSheet

func (*CSSProtocol) Disable

func (protocol *CSSProtocol) Disable() <-chan *css.DisableResult

Disable disables the CSS agent for the given page.

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

func (*CSSProtocol) Enable

func (protocol *CSSProtocol) Enable() <-chan *css.EnableResult

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

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

func (*CSSProtocol) ForcePseudoState

func (protocol *CSSProtocol) ForcePseudoState(
	params *css.ForcePseudoStateParams,
) <-chan *css.ForcePseudoStateResult

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

https://chromedevtools.github.io/devtools-protocol/tot/CSS/#method-forcePseudoState

func (*CSSProtocol) GetBackgroundColors

func (protocol *CSSProtocol) GetBackgroundColors(
	params *css.GetBackgroundColorsParams,
) <-chan *css.GetBackgroundColorsResult

GetBackgroundColors gets background colors for a node.

https://chromedevtools.github.io/devtools-protocol/tot/CSS/#method-getBackgroundColors

func (*CSSProtocol) GetComputedStyleForNode

func (protocol *CSSProtocol) GetComputedStyleForNode(
	params *css.GetComputedStyleForNodeParams,
) <-chan *css.GetComputedStyleForNodeResult

GetComputedStyleForNode returns the computed style for a DOM node identified by nodeId.

https://chromedevtools.github.io/devtools-protocol/tot/CSS/#method-getComputedStyleForNode

func (*CSSProtocol) GetInlineStylesForNode

func (protocol *CSSProtocol) GetInlineStylesForNode(
	params *css.GetInlineStylesForNodeParams,
) <-chan *css.GetInlineStylesForNodeResult

GetInlineStylesForNode returns the styles defined inline (explicitly in the "style" attribute and implicitly, using DOM attributes) for a DOM node identified by nodeId.

https://chromedevtools.github.io/devtools-protocol/tot/CSS/#method-getInlineStylesForNode

func (*CSSProtocol) GetMatchedStylesForNode

func (protocol *CSSProtocol) GetMatchedStylesForNode(
	params *css.GetMatchedStylesForNodeParams,
) <-chan *css.GetMatchedStylesForNodeResult

GetMatchedStylesForNode returns requested styles for a DOM node identified by nodeId.

https://chromedevtools.github.io/devtools-protocol/tot/CSS/#method-getMatchedStylesForNode

func (*CSSProtocol) GetMediaQueries

func (protocol *CSSProtocol) GetMediaQueries() <-chan *css.GetMediaQueriesResult

GetMediaQueries returns all media queries parsed by the rendering engine.

https://chromedevtools.github.io/devtools-protocol/tot/CSS/#method-getMediaQueries

func (*CSSProtocol) GetPlatformFontsForNode

func (protocol *CSSProtocol) GetPlatformFontsForNode(
	params *css.GetPlatformFontsForNodeParams,
) <-chan *css.GetPlatformFontsForNodeResult

GetPlatformFontsForNode requests information about platform fonts which we used to render child TextNodes in the given node.

https://chromedevtools.github.io/devtools-protocol/tot/CSS/#method-getPlatformFontsForNode

func (*CSSProtocol) GetStyleSheetText

func (protocol *CSSProtocol) GetStyleSheetText(
	params *css.GetStyleSheetTextParams,
) <-chan *css.GetStyleSheetTextResult

GetStyleSheetText returns the current textual content and the URL for a stylesheet.

https://chromedevtools.github.io/devtools-protocol/tot/CSS/#method-getStyleSheetText

func (*CSSProtocol) OnFontsUpdated

func (protocol *CSSProtocol) OnFontsUpdated(
	callback func(event *css.FontsUpdatedEvent),
)

OnFontsUpdated adds a handler to the CSS.fontsUpdated event. CSS.fontsUpdated fires whenever a web font gets loaded.

https://chromedevtools.github.io/devtools-protocol/tot/CSS/#event-fontsUpdated

func (*CSSProtocol) OnMediaQueryResultChanged

func (protocol *CSSProtocol) OnMediaQueryResultChanged(
	callback func(event *css.MediaQueryResultChangedEvent),
)

OnMediaQueryResultChanged adds a handler to the CSS.mediaQueryResultChanged event. CSS.mediaQueryResultChanged fires whenever a MediaQuery result changes (for example, after a browser window has been resized.) The current implementation considers only viewport-dependent media features.

https://chromedevtools.github.io/devtools-protocol/tot/CSS/#event-mediaQueryResultChanged

func (*CSSProtocol) OnStyleSheetAdded

func (protocol *CSSProtocol) OnStyleSheetAdded(
	callback func(event *css.StyleSheetAddedEvent),
)

OnStyleSheetAdded adds a handler to the CSS.styleSheetAdded event. CSS.styleSheetAdded fires whenever an active document stylesheet is added.

https://chromedevtools.github.io/devtools-protocol/tot/CSS/#event-styleSheetAdded

func (*CSSProtocol) OnStyleSheetChanged

func (protocol *CSSProtocol) OnStyleSheetChanged(
	callback func(event *css.StyleSheetChangedEvent),
)

OnStyleSheetChanged adds a handler to the CSS.styleSheetChanged event. CSS.styleSheetChanged fires whenever a stylesheet is changed as a result of the client operation.

https://chromedevtools.github.io/devtools-protocol/tot/CSS/#event-styleSheetChanged

func (*CSSProtocol) OnStyleSheetRemoved

func (protocol *CSSProtocol) OnStyleSheetRemoved(
	callback func(event *css.StyleSheetRemovedEvent),
)

OnStyleSheetRemoved adds a handler to the CSS.styleSheetRemoved event. CSS.styleSheetRemoved fires whenever an active document stylesheet is removed.

https://chromedevtools.github.io/devtools-protocol/tot/CSS/#event-styleSheetRemoved

func (*CSSProtocol) SetEffectivePropertyValueForNode

func (protocol *CSSProtocol) SetEffectivePropertyValueForNode(
	params *css.SetEffectivePropertyValueForNodeParams,
) <-chan *css.SetEffectivePropertyValueForNodeResult

SetEffectivePropertyValueForNode finds a rule with the given active property for the given node and sets the new value for that property.

https://chromedevtools.github.io/devtools-protocol/tot/CSS/#method-setEffectivePropertyValueForNode

func (*CSSProtocol) SetKeyframeKey

func (protocol *CSSProtocol) SetKeyframeKey(
	params *css.SetKeyframeKeyParams,
) <-chan *css.SetKeyframeKeyResult

SetKeyframeKey modifies the keyframe rule key text.

https://chromedevtools.github.io/devtools-protocol/tot/CSS/#method-setKeyframeKey

func (*CSSProtocol) SetMediaText

func (protocol *CSSProtocol) SetMediaText(
	params *css.SetMediaTextParams,
) <-chan *css.SetMediaTextResult

SetMediaText modifies the rule selector.

https://chromedevtools.github.io/devtools-protocol/tot/CSS/#method-setMediaText

func (*CSSProtocol) SetRuleSelector

func (protocol *CSSProtocol) SetRuleSelector(
	params *css.SetRuleSelectorParams,
) <-chan *css.SetRuleSelectorResult

SetRuleSelector modifies the rule selector.

https://chromedevtools.github.io/devtools-protocol/tot/CSS/#method-setRuleSelector

func (*CSSProtocol) SetStyleSheetText

func (protocol *CSSProtocol) SetStyleSheetText(
	params *css.SetStyleSheetTextParams,
) <-chan *css.SetStyleSheetTextResult

SetStyleSheetText sets the new stylesheet text.

https://chromedevtools.github.io/devtools-protocol/tot/CSS/#method-setStyleSheetText

func (*CSSProtocol) SetStyleTexts

func (protocol *CSSProtocol) SetStyleTexts(
	params *css.SetStyleTextsParams,
) <-chan *css.SetStyleTextsResult

SetStyleTexts applies specified style edits one after another in the given order.

https://chromedevtools.github.io/devtools-protocol/tot/CSS/#method-setStyleTexts

func (*CSSProtocol) StartRuleUsageTracking

func (protocol *CSSProtocol) StartRuleUsageTracking() <-chan *css.StartRuleUsageTrackingResult

StartRuleUsageTracking enables the selector recording.

https://chromedevtools.github.io/devtools-protocol/tot/CSS/#method-startRuleUsageTracking

func (*CSSProtocol) StopRuleUsageTracking

func (protocol *CSSProtocol) StopRuleUsageTracking() <-chan *css.StopRuleUsageTrackingResult

StopRuleUsageTracking returns he list of rules with an indication of whether they were used.

https://chromedevtools.github.io/devtools-protocol/tot/CSS/#method-stopRuleUsageTracking

func (*CSSProtocol) TakeCoverageDelta

func (protocol *CSSProtocol) TakeCoverageDelta() <-chan *css.TakeCoverageDeltaResult

TakeCoverageDelta obtains the list of rules that became used since last call to this method (or since start of coverage instrumentation).

https://chromedevtools.github.io/devtools-protocol/tot/CSS/#method-takeCoverageDelta

type CacheStorageProtocol

type CacheStorageProtocol struct {
	Socket Socketer
}

CacheStorageProtocol provides a namespace for the Chrome CacheStorage protocol methods.

https://chromedevtools.github.io/devtools-protocol/tot/CacheStorage/ EXPERIMENTAL.

func (*CacheStorageProtocol) DeleteCache

func (protocol *CacheStorageProtocol) DeleteCache(
	params *storage.DeleteCacheParams,
) <-chan *storage.DeleteCacheResult

DeleteCache deletes a cache.

https://chromedevtools.github.io/devtools-protocol/tot/CacheStorage/#method-deleteCache

func (*CacheStorageProtocol) DeleteEntry

func (protocol *CacheStorageProtocol) DeleteEntry(
	params *storage.DeleteEntryParams,
) <-chan *storage.DeleteEntryResult

DeleteEntry deletes a cache entry.

https://chromedevtools.github.io/devtools-protocol/tot/CacheStorage/#method-deleteEntry

func (*CacheStorageProtocol) RequestCacheNames

func (protocol *CacheStorageProtocol) RequestCacheNames(
	params *storage.RequestCacheNamesParams,
) <-chan *storage.RequestCacheNamesResult

RequestCacheNames requests cache names.

https://chromedevtools.github.io/devtools-protocol/tot/CacheStorage/#method-requestCacheNames

func (*CacheStorageProtocol) RequestCachedResponse

func (protocol *CacheStorageProtocol) RequestCachedResponse(
	params *storage.RequestCachedResponseParams,
) <-chan *storage.RequestCachedResponseResult

RequestCachedResponse fetches cache entry.

https://chromedevtools.github.io/devtools-protocol/tot/CacheStorage/#method-requestCachedResponse

func (*CacheStorageProtocol) RequestEntries

func (protocol *CacheStorageProtocol) RequestEntries(
	params *storage.RequestEntriesParams,
) <-chan *storage.RequestEntriesResult

RequestEntries requests data from cache.

https://chromedevtools.github.io/devtools-protocol/tot/CacheStorage/#method-requestEntries

type ChromeWebSocket

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

ChromeWebSocket provides an WebSocketer interface for managing a websocket connection.

ChromeWebSocket represents a WebSocketer interface

func (*ChromeWebSocket) Close

func (socket *ChromeWebSocket) Close() error

Close closes the current websocket connection.

Close is a WebSocketer implementation.

func (*ChromeWebSocket) ReadJSON

func (socket *ChromeWebSocket) ReadJSON(v interface{}) error

ReadJSON listens for the next websocket message and unmarshalls it into the provided variable.

ReadJSON is a WebSocketer implementation.

To support tests, when a live web socket connection does not exist this method reads from a stack of manually populated responses in an attempt to emulate the Chromium DevProtocol behavior. To populate the mock response stack, add a Response{} pointer with the AddMockData() method.

func (*ChromeWebSocket) WriteJSON

func (socket *ChromeWebSocket) WriteJSON(v interface{}) error

WriteJSON marshalls the provided data as JSON and writes it to the websocket.

WriteJSON is a WebSocketer implementation.

type Command

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

Command provides a Commander interface for sending commands to a websocket.

func NewCommand

func NewCommand(socket Socketer, method string, params interface{}) *Command

NewCommand creates and returns a pointer to a struct that implements the Commander interface.

func (*Command) Error

func (cmd *Command) Error() error

Error returns the most recent error, if any.

Error is a Commander implementation.

func (*Command) ID

func (cmd *Command) ID() int

ID returns the command ID.

ID is a Commander implementation.

func (*Command) Method

func (cmd *Command) Method() string

Method returns the name of the Chrom DevTools Protocol method to be called.

Method is a Commander implementation.

func (*Command) Params

func (cmd *Command) Params() interface{}

Params returns the command parameters.

Params is a Commander implementation.

func (*Command) Respond

func (cmd *Command) Respond(response *Response)

Respond sends a response to the command response channel.

Respond is a Commander implementation.

func (*Command) Response

func (cmd *Command) Response() chan *Response

Response returns the command response channel.

Response is a Commander implementation.

func (*Command) SetError

func (cmd *Command) SetError(err error)

SetError sets the error value

SetError is a Commander implementation.

func (*Command) SetID

func (cmd *Command) SetID(id int)

SetID sets the ID value

SetID is a Commander implementation.

type CommandMap

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

CommandMap provides a CommandMapper interface implementation for managing the command stack.

func NewCommandMap

func NewCommandMap() *CommandMap

NewCommandMap creates and returns a pointer to a struct that implements the CommandMapper interface.

func (*CommandMap) Delete

func (stack *CommandMap) Delete(id int)

Delete removes a command from the stack.

Delete is a CommandMapper implementation.

func (*CommandMap) Get

func (stack *CommandMap) Get(id int) (Commander, error)

Get retrieves a command from the stack.

Get is a CommandMapper implementation.

func (*CommandMap) Set

func (stack *CommandMap) Set(cmd Commander)

Set sets a command in the stack.

Set is a CommandMapper implementation.

type CommandMapper

type CommandMapper interface {
	// Delete removes a command from the stack.
	Delete(commandID int)

	// Get retrieves a command from the stack.
	Get(commandID int) (Commander, error)

	// Set sets a command in the stack.
	Set(command Commander)
}

CommandMapper defines a management interface for the stack of pending commands.

type Commander

type Commander interface {
	// Error returns the most recent error, if any.
	Error() error

	// ID returns the command ID.
	ID() int

	// Method returns the name of the Chrom DevTools Protocol method to be
	// called.
	Method() string

	// Params returns the command parameters.
	Params() interface{}

	// Respond sends a response to the command response channel.
	Respond(response *Response)

	// Response returns the command response channel.
	Response() chan *Response

	// SetError sets the error value
	SetError(error)

	// SetID sets the ID value
	SetID(int)
}

Commander defines the interface for websocket commands.

type Conner

type Conner interface {
	// Conn returns the current web socket pointer.
	Conn() WebSocketer

	// Connect establishes a websocket connection.
	Connect() error

	// Connected returns whether a connection exists.
	Connected() bool

	// Disconnect closes a websocket connection.
	Disconnect() error

	// ReadJSON reads data from a websocket connection.
	ReadJSON(v interface{}) error

	// WriteJSON writes data to a websocket connection.
	WriteJSON(v interface{}) error
}

Conner defines the Socket connection interface for managing websocket connections, including reading and writing.

type ConsoleProtocol

type ConsoleProtocol struct {
	Socket Socketer
}

ConsoleProtocol provides a namespace for the Chrome Console protocol methods.

https://chromedevtools.github.io/devtools-protocol/tot/Console/ DEPRECATED - use Runtime or Log instead.

func (*ConsoleProtocol) ClearMessages

func (protocol *ConsoleProtocol) ClearMessages() <-chan *console.ClearMessagesResult

ClearMessages does nothing.

https://chromedevtools.github.io/devtools-protocol/tot/Console/#method-clearMessages

func (*ConsoleProtocol) Disable

func (protocol *ConsoleProtocol) Disable() <-chan *console.DisableResult

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

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

func (*ConsoleProtocol) Enable

func (protocol *ConsoleProtocol) Enable() <-chan *console.EnableResult

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

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

func (*ConsoleProtocol) OnMessageAdded

func (protocol *ConsoleProtocol) OnMessageAdded(
	callback func(event *console.MessageAddedEvent),
)

OnMessageAdded adds a handler to the Console.messageAdded event. Console.messageAdded fires whenever an active document stylesheet is removed.

https://chromedevtools.github.io/devtools-protocol/tot/Console/#event-messageAdded

type DOMDebuggerProtocol

type DOMDebuggerProtocol struct {
	Socket Socketer
}

DOMDebuggerProtocol provides a namespace for the Chrome DOMDebugger protocol methods. The DOMDebugger protocol allows setting breakpoints on particular DOM operations and events. JavaScript execution will stop on these operations as if there was a regular breakpoint set.

https://chromedevtools.github.io/devtools-protocol/tot/DOMDebugger/

func (*DOMDebuggerProtocol) GetEventListeners

func (protocol *DOMDebuggerProtocol) GetEventListeners(
	params *debugger.GetEventListenersParams,
) <-chan *debugger.GetEventListenersResult

GetEventListeners returns event listeners of the given object.

https://chromedevtools.github.io/devtools-protocol/tot/DOMDebugger/#method-getEventListeners

func (*DOMDebuggerProtocol) RemoveDOMBreakpoint

func (protocol *DOMDebuggerProtocol) RemoveDOMBreakpoint(
	params *debugger.RemoveDOMBreakpointParams,
) <-chan *debugger.RemoveDOMBreakpointResult

RemoveDOMBreakpoint removes the DOM breakpoint that was set using setDOMBreakpoint.

https://chromedevtools.github.io/devtools-protocol/tot/DOMDebugger/#method-removeDOMBreakpoint

func (*DOMDebuggerProtocol) RemoveEventListenerBreakpoint

func (protocol *DOMDebuggerProtocol) RemoveEventListenerBreakpoint(
	params *debugger.RemoveEventListenerBreakpointParams,
) <-chan *debugger.RemoveEventListenerBreakpointResult

RemoveEventListenerBreakpoint removes breakpoint on particular DOM event.

https://chromedevtools.github.io/devtools-protocol/tot/DOMDebugger/#method-removeEventListenerBreakpoint

func (*DOMDebuggerProtocol) RemoveInstrumentationBreakpoint

func (protocol *DOMDebuggerProtocol) RemoveInstrumentationBreakpoint(
	params *debugger.RemoveInstrumentationBreakpointParams,
) <-chan *debugger.RemoveInstrumentationBreakpointResult

RemoveInstrumentationBreakpoint removes breakpoint on particular native event.

https://chromedevtools.github.io/devtools-protocol/tot/DOMDebugger/#method-removeInstrumentationBreakpoint EXPERIMENTAL.

func (*DOMDebuggerProtocol) RemoveXHRBreakpoint

func (protocol *DOMDebuggerProtocol) RemoveXHRBreakpoint(
	params *debugger.RemoveXHRBreakpointParams,
) <-chan *debugger.RemoveXHRBreakpointResult

RemoveXHRBreakpoint removes breakpoint from XMLHttpRequest.

https://chromedevtools.github.io/devtools-protocol/tot/DOMDebugger/#method-removeXHRBreakpoint

func (*DOMDebuggerProtocol) SetDOMBreakpoint

func (protocol *DOMDebuggerProtocol) SetDOMBreakpoint(
	params *debugger.SetDOMBreakpointParams,
) <-chan *debugger.SetDOMBreakpointResult

SetDOMBreakpoint sets a breakpoint on a particular operation with DOM.

https://chromedevtools.github.io/devtools-protocol/tot/DOMDebugger/#method-setDOMBreakpoint

func (*DOMDebuggerProtocol) SetEventListenerBreakpoint

func (protocol *DOMDebuggerProtocol) SetEventListenerBreakpoint(
	params *debugger.SetEventListenerBreakpointParams,
) <-chan *debugger.SetEventListenerBreakpointResult

SetEventListenerBreakpoint sets the breakpoint on a particular DOM event.

https://chromedevtools.github.io/devtools-protocol/tot/DOMDebugger/#method-setEventListenerBreakpoint

func (*DOMDebuggerProtocol) SetInstrumentationBreakpoint

func (protocol *DOMDebuggerProtocol) SetInstrumentationBreakpoint(
	params *debugger.SetInstrumentationBreakpointParams,
) <-chan *debugger.SetInstrumentationBreakpointResult

SetInstrumentationBreakpoint sets breakpoint on particular native event.

https://chromedevtools.github.io/devtools-protocol/tot/DOMDebugger/#method-setInstrumentationBreakpoint EXPERIMENTAL.

func (*DOMDebuggerProtocol) SetXHRBreakpoint

func (protocol *DOMDebuggerProtocol) SetXHRBreakpoint(
	params *debugger.SetXHRBreakpointParams,
) <-chan *debugger.SetXHRBreakpointResult

SetXHRBreakpoint sets breakpoint on XMLHttpRequest.

https://chromedevtools.github.io/devtools-protocol/tot/DOMDebugger/#method-setXHRBreakpoint

type DOMProtocol

type DOMProtocol struct {
	Socket Socketer
}

DOMProtocol provides a namespace for the Chrome DOM protocol methods. The DOM protocol exposes DOM read/write operations. Each DOM Node is represented with its mirror object that has an ID. This ID can be used to get additional information on the Node, resolve it into the JavaScript object wrapper, etc. It is important that client receives DOM events only for the nodes that are known to the client. Backend keeps track of the nodes that were sent to the client and never sends the same node twice. It is client's responsibility to collect information about the nodes that were sent to the client.

Note that iframe owner elements will return corresponding document elements as their child nodes.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/

func (*DOMProtocol) CollectClassNamesFromSubtree

func (protocol *DOMProtocol) CollectClassNamesFromSubtree(
	params *dom.CollectClassNamesFromSubtreeParams,
) <-chan *dom.CollectClassNamesFromSubtreeResult

CollectClassNamesFromSubtree creates a deep copy of the specified node and places it into the target container before the given anchor.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-collectClassNamesFromSubtree EXPERIMENTAL.

func (*DOMProtocol) CopyTo

func (protocol *DOMProtocol) CopyTo(
	params *dom.CopyToParams,
) <-chan *dom.CopyToResult

CopyTo creates a deep copy of the specified node and places it into the target container before the given anchor.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-copyTo EXPERIMENTAL.

func (*DOMProtocol) DescribeNode

func (protocol *DOMProtocol) DescribeNode(
	params *dom.DescribeNodeParams,
) <-chan *dom.DescribeNodeResult

DescribeNode describes node given its id, does not require domain to be enabled. Does not start tracking any objects, can be used for automation.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-describeNode

func (*DOMProtocol) Disable

func (protocol *DOMProtocol) Disable() <-chan *dom.DisableResult

Disable disables the DOM agent for the given page.

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

func (*DOMProtocol) DiscardSearchResults

func (protocol *DOMProtocol) DiscardSearchResults(
	params *dom.DiscardSearchResultsParams,
) <-chan *dom.DiscardSearchResultsResult

DiscardSearchResults discards search results from the session with the given id. getSearchResults should no longer be called for that search.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-discardSearchResults EXPERIMENTAL.

func (*DOMProtocol) Enable

func (protocol *DOMProtocol) Enable() <-chan *dom.EnableResult

Enable enables the DOM agent for the given page.

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

func (*DOMProtocol) Focus

func (protocol *DOMProtocol) Focus(
	params *dom.FocusParams,
) <-chan *dom.FocusResult

Focus focuses the given element.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-focus

func (*DOMProtocol) GetAttributes

func (protocol *DOMProtocol) GetAttributes(
	params *dom.GetAttributesParams,
) <-chan *dom.GetAttributesResult

GetAttributes returns attributes for the specified node.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-getAttributes

func (*DOMProtocol) GetBoxModel

func (protocol *DOMProtocol) GetBoxModel(
	params *dom.GetBoxModelParams,
) <-chan *dom.GetBoxModelResult

GetBoxModel returns boxes for the given node.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-getBoxModel

func (*DOMProtocol) GetDocument

func (protocol *DOMProtocol) GetDocument(
	params *dom.GetDocumentParams,
) <-chan *dom.GetDocumentResult

GetDocument returns the root DOM node (and optionally the subtree) to the caller.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-getDocument

func (*DOMProtocol) GetFlattenedDocument

func (protocol *DOMProtocol) GetFlattenedDocument(
	params *dom.GetFlattenedDocumentParams,
) <-chan *dom.GetFlattenedDocumentResult

GetFlattenedDocument returns the root DOM node (and optionally the subtree) to the caller.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-getFlattenedDocument

func (*DOMProtocol) GetNodeForLocation

func (protocol *DOMProtocol) GetNodeForLocation(
	params *dom.GetNodeForLocationParams,
) <-chan *dom.GetNodeForLocationResult

GetNodeForLocation returns node id at given location.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-getNodeForLocation EXPERIMENTAL.

func (*DOMProtocol) GetOuterHTML

func (protocol *DOMProtocol) GetOuterHTML(
	params *dom.GetOuterHTMLParams,
) <-chan *dom.GetOuterHTMLResult

GetOuterHTML returns node's HTML markup.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-getOuterHTML

func (*DOMProtocol) GetRelayoutBoundary

func (protocol *DOMProtocol) GetRelayoutBoundary(
	params *dom.GetRelayoutBoundaryParams,
) <-chan *dom.GetRelayoutBoundaryResult

GetRelayoutBoundary returns the id of the nearest ancestor that is a relayout boundary.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-getRelayoutBoundary EXPERIMENTAL.

func (*DOMProtocol) GetSearchResults

func (protocol *DOMProtocol) GetSearchResults(
	params *dom.GetSearchResultsParams,
) <-chan *dom.GetSearchResultsResult

GetSearchResults returns search results from given fromIndex to given toIndex from the search with the given identifier.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-getSearchResults EXPERIMENTAL.

func (*DOMProtocol) MarkUndoableState

func (protocol *DOMProtocol) MarkUndoableState() <-chan *dom.MarkUndoableStateResult

MarkUndoableState marks last undoable state.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-markUndoableState EXPERIMENTAL.

func (*DOMProtocol) MoveTo

func (protocol *DOMProtocol) MoveTo(
	params *dom.MoveToParams,
) <-chan *dom.MoveToResult

MoveTo moves node into the new container, places it before the given anchor.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-moveTo

func (*DOMProtocol) OnAttributeModified

func (protocol *DOMProtocol) OnAttributeModified(
	callback func(event *dom.AttributeModifiedEvent),
)

OnAttributeModified adds a handler to the DOM.attributeModified event. DOM.attributeModified fires when Element's attribute is modified.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#event-attributeModified

func (*DOMProtocol) OnAttributeRemoved

func (protocol *DOMProtocol) OnAttributeRemoved(
	callback func(event *dom.AttributeRemovedEvent),
)

OnAttributeRemoved adds a handler to the DOM.attributeRemoved event. DOM.attributeRemoved fires when Element's attribute is modified.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#event-attributeRemoved

func (*DOMProtocol) OnCharacterDataModified

func (protocol *DOMProtocol) OnCharacterDataModified(
	callback func(event *dom.CharacterDataModifiedEvent),
)

OnCharacterDataModified adds a handler to the DOM.characterDataModified event. DOM.characterDataModified mirrors the DOMCharacterDataModified event.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#event-characterDataModified

func (*DOMProtocol) OnChildNodeCountUpdated

func (protocol *DOMProtocol) OnChildNodeCountUpdated(
	callback func(event *dom.ChildNodeCountUpdatedEvent),
)

OnChildNodeCountUpdated adds a handler to the DOM.childNodeCountUpdated event. DOM.childNodeCountUpdated fires when Container's child node count has changed.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#event-childNodeCountUpdated

func (*DOMProtocol) OnChildNodeInserted

func (protocol *DOMProtocol) OnChildNodeInserted(
	callback func(event *dom.ChildNodeInsertedEvent),
)

OnChildNodeInserted adds a handler to the DOM.childNodeInserted event. DOM.childNodeInserted mirrors the DOMNodeInserted event.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#event-childNodeInserted

func (*DOMProtocol) OnChildNodeRemoved

func (protocol *DOMProtocol) OnChildNodeRemoved(
	callback func(event *dom.ChildNodeRemovedEvent),
)

OnChildNodeRemoved adds a handler to the DOM.childNodeRemoved event. DOM.childNodeRemoved mirrors the DOMNodeRemoved event.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#event-childNodeRemoved

func (*DOMProtocol) OnDistributedNodesUpdated

func (protocol *DOMProtocol) OnDistributedNodesUpdated(
	callback func(event *dom.DistributedNodesUpdatedEvent),
)

OnDistributedNodesUpdated adds a handler to the DOM.distributedNodesUpdated event. DOM.distributedNodesUpdated fires when distribution is changed.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#event-distributedNodesUpdated EXPERIMENTAL.

func (*DOMProtocol) OnDocumentUpdated

func (protocol *DOMProtocol) OnDocumentUpdated(
	callback func(event *dom.DocumentUpdatedEvent),
)

OnDocumentUpdated adds a handler to the DOM.documentUpdated event. DOM.documentUpdated fires when Document has been totally updated. Node IDs are no longer valid.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#event-documentUpdated

func (*DOMProtocol) OnInlineStyleInvalidated

func (protocol *DOMProtocol) OnInlineStyleInvalidated(
	callback func(event *dom.InlineStyleInvalidatedEvent),
)

OnInlineStyleInvalidated adds a handler to the DOM.inlineStyleInvalidated event. DOM.inlineStyleInvalidated fires when Element's attribute is removed.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#event-inlineStyleInvalidated

func (*DOMProtocol) OnPseudoElementAdded

func (protocol *DOMProtocol) OnPseudoElementAdded(
	callback func(event *dom.PseudoElementAddedEvent),
)

OnPseudoElementAdded adds a handler to the DOM.pseudoElementAdded event. DOM.pseudoElementAdded fires when a pseudo element is added to an element.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#event-pseudoElementAdded EXPERIMENTAL.

func (*DOMProtocol) OnPseudoElementRemoved

func (protocol *DOMProtocol) OnPseudoElementRemoved(
	callback func(event *dom.PseudoElementRemovedEvent),
)

OnPseudoElementRemoved adds a handler to the DOM.pseudoElementRemoved event. DOM.pseudoElementRemoved fires when a pseudo element is removed from an element.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#event-pseudoElementRemoved EXPERIMENTAL.

func (*DOMProtocol) OnSetChildNodes

func (protocol *DOMProtocol) OnSetChildNodes(
	callback func(event *dom.SetChildNodesEvent),
)

OnSetChildNodes adds a handler to the DOM.setChildNodes event. DOM.setChildNodes fires when backend wants to provide client with the missing DOM structure. This happens upon most of the calls requesting node IDs.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#event-setChildNodes

func (*DOMProtocol) OnShadowRootPopped

func (protocol *DOMProtocol) OnShadowRootPopped(
	callback func(event *dom.ShadowRootPoppedEvent),
)

OnShadowRootPopped adds a handler to the DOM.shadowRootPopped event. DOM.shadowRootPopped fires when shadow root is popped from the element.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#event-shadowRootPopped EXPERIMENTAL.

func (*DOMProtocol) OnShadowRootPushed

func (protocol *DOMProtocol) OnShadowRootPushed(
	callback func(event *dom.ShadowRootPushedEvent),
)

OnShadowRootPushed adds a handler to the DOM.shadowRootPushed event. DOM.shadowRootPushed fires when shadow root is pushed into the element.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#event-shadowRootPushed EXPERIMENTAL.

func (*DOMProtocol) PerformSearch

func (protocol *DOMProtocol) PerformSearch(
	params *dom.PerformSearchParams,
) <-chan *dom.PerformSearchResult

PerformSearch searches for a given string in the DOM tree. Use getSearchResults to access search results or cancelSearch to end this search session.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-performSearch EXPERIMENTAL.

func (*DOMProtocol) PushNodeByPathToFrontend

func (protocol *DOMProtocol) PushNodeByPathToFrontend(
	params *dom.PushNodeByPathToFrontendParams,
) <-chan *dom.PushNodeByPathToFrontendResult

PushNodeByPathToFrontend requests that the node is sent to the caller given its path.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-pushNodeByPathToFrontend EXPERIMENTAL. @TODO, use XPath.

func (*DOMProtocol) PushNodesByBackendIDsToFrontend

func (protocol *DOMProtocol) PushNodesByBackendIDsToFrontend(
	params *dom.PushNodesByBackendIDsToFrontendParams,
) <-chan *dom.PushNodesByBackendIDsToFrontendResult

PushNodesByBackendIDsToFrontend requests that a batch of nodes is sent to the caller given their backend node IDs.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-pushNodesByBackendIdsToFrontend EXPERIMENTAL.

func (*DOMProtocol) QuerySelector

func (protocol *DOMProtocol) QuerySelector(
	params *dom.QuerySelectorParams,
) <-chan *dom.QuerySelectorResult

QuerySelector executes querySelector on a given node.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-querySelector

func (*DOMProtocol) QuerySelectorAll

func (protocol *DOMProtocol) QuerySelectorAll(
	params *dom.QuerySelectorAllParams,
) <-chan *dom.QuerySelectorAllResult

QuerySelectorAll executes querySelectorAll on a given node.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-querySelectorAll

func (*DOMProtocol) Redo

func (protocol *DOMProtocol) Redo() <-chan *dom.RedoResult

Redo re-does the last undone action.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-redo EXPERIMENTAL.

func (*DOMProtocol) RemoveAttribute

func (protocol *DOMProtocol) RemoveAttribute(
	params *dom.RemoveAttributeParams,
) <-chan *dom.RemoveAttributeResult

RemoveAttribute removes attribute with given name from an element with given id.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-removeAttribute

func (*DOMProtocol) RemoveNode

func (protocol *DOMProtocol) RemoveNode(
	params *dom.RemoveNodeParams,
) <-chan *dom.RemoveNodeResult

RemoveNode removes the specified node.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-removeNode

func (*DOMProtocol) RequestChildNodes

func (protocol *DOMProtocol) RequestChildNodes(
	params *dom.RequestChildNodesParams,
) <-chan *dom.RequestChildNodesResult

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.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-requestChildNodes

func (*DOMProtocol) RequestNode

func (protocol *DOMProtocol) RequestNode(
	params *dom.RequestNodeParams,
) <-chan *dom.RequestNodeResult

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.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-requestNode

func (*DOMProtocol) ResolveNode

func (protocol *DOMProtocol) ResolveNode(
	params *dom.ResolveNodeParams,
) <-chan *dom.ResolveNodeResult

ResolveNode resolves the JavaScript node object for a given NodeID or BackendNodeID.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-resolveNode

func (*DOMProtocol) SetAttributeValue

func (protocol *DOMProtocol) SetAttributeValue(
	params *dom.SetAttributeValueParams,
) <-chan *dom.SetAttributeValueResult

SetAttributeValue sets attribute for an element with given id.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-setAttributeValue

func (*DOMProtocol) SetAttributesAsText

func (protocol *DOMProtocol) SetAttributesAsText(
	params *dom.SetAttributesAsTextParams,
) <-chan *dom.SetAttributesAsTextResult

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.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-setAttributesAsText

func (*DOMProtocol) SetFileInputFiles

func (protocol *DOMProtocol) SetFileInputFiles(
	params *dom.SetFileInputFilesParams,
) <-chan *dom.SetFileInputFilesResult

SetFileInputFiles sets files for the given file input element.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-setFileInputFiles

func (*DOMProtocol) SetInspectedNode

func (protocol *DOMProtocol) SetInspectedNode(
	params *dom.SetInspectedNodeParams,
) <-chan *dom.SetInspectedNodeResult

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

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-setInspectedNode EXPERIMENTAL.

func (*DOMProtocol) SetNodeName

func (protocol *DOMProtocol) SetNodeName(
	params *dom.SetNodeNameParams,
) <-chan *dom.SetNodeNameResult

SetNodeName sets node name for the specified node.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-setNodeName

func (*DOMProtocol) SetNodeValue

func (protocol *DOMProtocol) SetNodeValue(
	params *dom.SetNodeValueParams,
) <-chan *dom.SetNodeValueResult

SetNodeValue sets node value for the specified node.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-setNodeValue

func (*DOMProtocol) SetOuterHTML

func (protocol *DOMProtocol) SetOuterHTML(
	params *dom.SetOuterHTMLParams,
) <-chan *dom.SetOuterHTMLResult

SetOuterHTML sets node HTML markup, returns new node id.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-setOuterHTML

func (*DOMProtocol) Undo

func (protocol *DOMProtocol) Undo() <-chan *dom.UndoResult

Undo undoes the last performed action.

https://chromedevtools.github.io/devtools-protocol/tot/DOM/#method-undo EXPERIMENTAL.

type DOMSnapshotProtocol

type DOMSnapshotProtocol struct {
	Socket Socketer
}

DOMSnapshotProtocol provides a namespace for the Chrome DOMSnapshot protocol methods. The DOMSnapshot protocol facilitates obtaining document snapshots with DOM, layout, and style information.

https://chromedevtools.github.io/devtools-protocol/tot/DOMSnapshot/

func (*DOMSnapshotProtocol) Disable

func (protocol *DOMSnapshotProtocol) Disable() <-chan *snapshot.DisableResult

Disable disables the DOM snapshot functionality for the given page.

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

func (*DOMSnapshotProtocol) Enable

func (protocol *DOMSnapshotProtocol) Enable() <-chan *snapshot.EnableResult

Enable enables the DOM snapshot functionality for the given page.

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

func (*DOMSnapshotProtocol) Get

func (protocol *DOMSnapshotProtocol) Get(
	params *snapshot.GetParams,
) <-chan *snapshot.GetResult

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

https://chromedevtools.github.io/devtools-protocol/tot/DOMSnapshot/#method-getSnapshot

type DOMStorageProtocol

type DOMStorageProtocol struct {
	Socket Socketer
}

DOMStorageProtocol provides a namespace for the Chrome DOMStorage protocol methods. The DOMStorage protocol queries and modifies DOM storage.

https://chromedevtools.github.io/devtools-protocol/tot/DOMStorage/

func (*DOMStorageProtocol) Clear

func (protocol *DOMStorageProtocol) Clear(
	params *storage.ClearParams,
) <-chan *storage.ClearResult

Clear clears a stored item.

https://chromedevtools.github.io/devtools-protocol/tot/DOMStorage/#method-clear

func (*DOMStorageProtocol) Disable

func (protocol *DOMStorageProtocol) Disable() <-chan *storage.DisableResult

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

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

func (*DOMStorageProtocol) Enable

func (protocol *DOMStorageProtocol) Enable() <-chan *storage.EnableResult

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

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

func (*DOMStorageProtocol) GetItems

func (protocol *DOMStorageProtocol) GetItems(
	params *storage.GetItemsParams,
) <-chan *storage.GetItemsResult

GetItems gets a stored item.

https://chromedevtools.github.io/devtools-protocol/tot/DOMStorage/#method-getDOMStorageItems

func (*DOMStorageProtocol) OnItemAdded

func (protocol *DOMStorageProtocol) OnItemAdded(
	callback func(event *storage.ItemAddedEvent),
)

OnItemAdded adds a handler to the DOMStorage.domStorageItemAdded event. DOMStorage.domStorageItemAdded fires when an item is added to DOM storage.

https://chromedevtools.github.io/devtools-protocol/tot/DOMStorage/#event-domStorageItemAdded

func (*DOMStorageProtocol) OnItemRemoved

func (protocol *DOMStorageProtocol) OnItemRemoved(
	callback func(event *storage.ItemRemovedEvent),
)

OnItemRemoved adds a handler to the DOMStorage.domStorageItemRemoved event. DOMStorage.domStorageItemRemoved fires when an item is removed from DOM storage.

https://chromedevtools.github.io/devtools-protocol/tot/DOMStorage/#event-domStorageItemRemoved

func (*DOMStorageProtocol) OnItemUpdated

func (protocol *DOMStorageProtocol) OnItemUpdated(
	callback func(event *storage.ItemUpdatedEvent),
)

OnItemUpdated adds a handler to the DOMStorage.domStorageItemUpdated event. DOMStorage.domStorageItemUpdated fires when an item in DOM storage is updated.

https://chromedevtools.github.io/devtools-protocol/tot/DOMStorage/#event-domStorageItemUpdated

func (*DOMStorageProtocol) OnItemsCleared

func (protocol *DOMStorageProtocol) OnItemsCleared(
	callback func(event *storage.ItemsClearedEvent),
)

OnItemsCleared adds a handler to the DOMStorage.domStorageItemsCleared event. DOMStorage.domStorageItemsCleared fires when items in DOM storage are cleared.

https://chromedevtools.github.io/devtools-protocol/tot/DOMStorage/#event-domStorageItemsCleared

func (*DOMStorageProtocol) RemoveItem

func (protocol *DOMStorageProtocol) RemoveItem(
	params *storage.RemoveItemParams,
) <-chan *storage.RemoveItemResult

RemoveItem removes a stored item.

https://chromedevtools.github.io/devtools-protocol/tot/DOMStorage/#method-removeDOMStorageItem

func (*DOMStorageProtocol) SetItem

func (protocol *DOMStorageProtocol) SetItem(
	params *storage.SetItemParams,
) <-chan *storage.SetItemResult

SetItem sets a stored item.

https://chromedevtools.github.io/devtools-protocol/tot/DOMStorage/#method-setDOMStorageItem

type DatabaseProtocol

type DatabaseProtocol struct {
	Socket Socketer
}

DatabaseProtocol provides a namespace for the Chrome Database protocol methods.

https://chromedevtools.github.io/devtools-protocol/tot/Database/ EXPERIMENTAL.

func (*DatabaseProtocol) Disable

func (protocol *DatabaseProtocol) Disable() <-chan *database.DisableResult

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

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

func (*DatabaseProtocol) Enable

func (protocol *DatabaseProtocol) Enable() <-chan *database.EnableResult

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

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

func (*DatabaseProtocol) ExecuteSQL

func (protocol *DatabaseProtocol) ExecuteSQL(
	params *database.ExecuteSQLParams,
) <-chan *database.ExecuteSQLResult

ExecuteSQL executes a SQL query.

https://chromedevtools.github.io/devtools-protocol/tot/Database/#method-executeSQL

func (*DatabaseProtocol) GetTableNames

func (protocol *DatabaseProtocol) GetTableNames(
	params *database.GetTableNamesParams,
) <-chan *database.GetTableNamesResult

GetTableNames gets database table names.

https://chromedevtools.github.io/devtools-protocol/tot/Database/#method-getDatabaseTableNames

func (*DatabaseProtocol) OnAdd

func (protocol *DatabaseProtocol) OnAdd(
	callback func(event *database.AddEvent),
)

OnAdd adds a handler to the Database.addDatabase event. Database.addDatabase fires whenever a database is added

https://chromedevtools.github.io/devtools-protocol/tot/Database/#event-addDatabase

type DebuggerProtocol

type DebuggerProtocol struct {
	Socket Socketer
}

DebuggerProtocol provides a namespace for the Chrome Debugger protocol methods. The Debugger protocol exposes JavaScript debugging capabilities. It allows setting and removing breakpoints, stepping through execution, exploring stack traces, etc.

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/

func (*DebuggerProtocol) ContinueToLocation

func (protocol *DebuggerProtocol) ContinueToLocation(
	params *debugger.ContinueToLocationParams,
) <-chan *debugger.ContinueToLocationResult

ContinueToLocation continues execution until specific location is reached.

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-continueToLocation

func (*DebuggerProtocol) Disable

func (protocol *DebuggerProtocol) Disable() <-chan *debugger.DisableResult

Disable disables debugger for given page.

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

func (*DebuggerProtocol) Enable

func (protocol *DebuggerProtocol) Enable() <-chan *debugger.EnableResult

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.

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

func (*DebuggerProtocol) EvaluateOnCallFrame

func (protocol *DebuggerProtocol) EvaluateOnCallFrame(
	params *debugger.EvaluateOnCallFrameParams,
) <-chan *debugger.EvaluateOnCallFrameResult

EvaluateOnCallFrame evaluates expression on a given call frame.

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-evaluateOnCallFrame

func (*DebuggerProtocol) GetPossibleBreakpoints

func (protocol *DebuggerProtocol) GetPossibleBreakpoints(
	params *debugger.GetPossibleBreakpointsParams,
) <-chan *debugger.GetPossibleBreakpointsResult

GetPossibleBreakpoints returns possible locations for breakpoint. scriptId in start and end range locations should be the same.

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-getPossibleBreakpoints

func (*DebuggerProtocol) GetScriptSource

func (protocol *DebuggerProtocol) GetScriptSource(
	params *debugger.GetScriptSourceParams,
) <-chan *debugger.GetScriptSourceResult

GetScriptSource returns source for the script with given id.

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-getScriptSource

func (*DebuggerProtocol) GetStackTrace

func (protocol *DebuggerProtocol) GetStackTrace(
	params *debugger.GetStackTraceParams,
) <-chan *debugger.GetStackTraceResult

GetStackTrace returns stack trace with given stackTraceId.

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-getStackTrace EXPERIMENTAL.

func (*DebuggerProtocol) OnBreakpointResolved

func (protocol *DebuggerProtocol) OnBreakpointResolved(
	callback func(event *debugger.BreakpointResolvedEvent),
)

OnBreakpointResolved adds a handler to the Debugger.breakpointResolved event. Debugger.breakpointResolved fires when breakpoint is resolved to an actual script and location.

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#event-breakpointResolved

func (*DebuggerProtocol) OnPaused

func (protocol *DebuggerProtocol) OnPaused(
	callback func(event *debugger.PausedEvent),
)

OnPaused adds a handler to the Debugger.paused event. Debugger.paused fires when the virtual machine stopped on breakpoint or exception or any other stop criteria.

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#event-paused

func (*DebuggerProtocol) OnResumed

func (protocol *DebuggerProtocol) OnResumed(
	callback func(event *debugger.ResumedEvent),
)

OnResumed adds a handler to the Debugger.resumed event. Debugger.resumed fires when the virtual machine resumes execution.

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#event-resumed

func (*DebuggerProtocol) OnScriptFailedToParse

func (protocol *DebuggerProtocol) OnScriptFailedToParse(
	callback func(event *debugger.ScriptFailedToParseEvent),
)

OnScriptFailedToParse adds a handler to the Debugger.scriptFailedToParse event. Debugger.scriptFailedToParse fires when the virtual machine fails to parse the script.

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#event-scriptFailedToParse

func (*DebuggerProtocol) OnScriptParsed

func (protocol *DebuggerProtocol) OnScriptParsed(
	callback func(event *debugger.ScriptParsedEvent),
)

OnScriptParsed adds a handler to the Debugger.ScriptParsed event. Debugger.ScriptParsed fires when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#event-scriptParsed

func (*DebuggerProtocol) Pause

func (protocol *DebuggerProtocol) Pause() <-chan *debugger.PauseResult

Pause stops on the next JavaScript statement.

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-pause

func (*DebuggerProtocol) PauseOnAsyncCall

func (protocol *DebuggerProtocol) PauseOnAsyncCall(
	params *debugger.PauseOnAsyncCallParams,
) <-chan *debugger.PauseOnAsyncCallResult

PauseOnAsyncCall is experimental

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-pauseOnAsyncCall EXPERIMENTAL.

func (*DebuggerProtocol) RemoveBreakpoint

func (protocol *DebuggerProtocol) RemoveBreakpoint(
	params *debugger.RemoveBreakpointParams,
) <-chan *debugger.RemoveBreakpointResult

RemoveBreakpoint removes JavaScript breakpoint.

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-removeBreakpoint

func (*DebuggerProtocol) RestartFrame

func (protocol *DebuggerProtocol) RestartFrame(
	params *debugger.RestartFrameParams,
) <-chan *debugger.RestartFrameResult

RestartFrame restarts particular call frame from the beginning.

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-restartFrame

func (*DebuggerProtocol) Resume

func (protocol *DebuggerProtocol) Resume() <-chan *debugger.ResumeResult

Resume resumes JavaScript execution.

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-resume

func (*DebuggerProtocol) ScheduleStepIntoAsync

func (protocol *DebuggerProtocol) ScheduleStepIntoAsync() <-chan *debugger.ScheduleStepIntoAsyncResult

ScheduleStepIntoAsync is deprecated - use Debugger.stepInto with breakOnAsyncCall and Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called.

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-scheduleStepIntoAsync EXPERIMENTAL. DEPRECATED.

func (*DebuggerProtocol) SearchInContent

func (protocol *DebuggerProtocol) SearchInContent(
	params *debugger.SearchInContentParams,
) <-chan *debugger.SearchInContentResult

SearchInContent searches for given string in script content.

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-searchInContent

func (*DebuggerProtocol) SetAsyncCallStackDepth

func (protocol *DebuggerProtocol) SetAsyncCallStackDepth(
	params *debugger.SetAsyncCallStackDepthParams,
) <-chan *debugger.SetAsyncCallStackDepthResult

SetAsyncCallStackDepth enables or disables async call stacks tracking.

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setAsyncCallStackDepth

func (*DebuggerProtocol) SetBlackboxPatterns

func (protocol *DebuggerProtocol) SetBlackboxPatterns(
	params *debugger.SetBlackboxPatternsParams,
) <-chan *debugger.SetBlackboxPatternsResult

SetBlackboxPatterns replaces 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.

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setBlackboxPatterns EXPERIMENTAL.

func (*DebuggerProtocol) SetBlackboxedRanges

func (protocol *DebuggerProtocol) SetBlackboxedRanges(
	params *debugger.SetBlackboxedRangesParams,
) <-chan *debugger.SetBlackboxedRangesResult

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.

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setBlackboxedRanges

func (*DebuggerProtocol) SetBreakpoint

func (protocol *DebuggerProtocol) SetBreakpoint(
	params *debugger.SetBreakpointParams,
) <-chan *debugger.SetBreakpointResult

SetBreakpoint sets JavaScript breakpoint at a given location.

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setBreakpoint

func (*DebuggerProtocol) SetBreakpointByURL

func (protocol *DebuggerProtocol) SetBreakpointByURL(
	params *debugger.SetBreakpointByURLParams,
) <-chan *debugger.SetBreakpointByURLResult

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.

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setBreakpointByUrl

func (*DebuggerProtocol) SetBreakpointsActive

func (protocol *DebuggerProtocol) SetBreakpointsActive(
	params *debugger.SetBreakpointsActiveParams,
) <-chan *debugger.SetBreakpointsActiveResult

SetBreakpointsActive activates / deactivates all breakpoints on the page.

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setBreakpointsActive

func (*DebuggerProtocol) SetPauseOnExceptions

func (protocol *DebuggerProtocol) SetPauseOnExceptions(
	params *debugger.SetPauseOnExceptionsParams,
) <-chan *debugger.SetPauseOnExceptionsResult

SetPauseOnExceptions defines the pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none.

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setPauseOnExceptions

func (*DebuggerProtocol) SetReturnValue

func (protocol *DebuggerProtocol) SetReturnValue(
	params *debugger.SetReturnValueParams,
) <-chan *debugger.SetReturnValueResult

SetReturnValue changes return value in top frame. Available only at return break position.

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setReturnValue EXPERIMENTAL.

func (*DebuggerProtocol) SetScriptSource

func (protocol *DebuggerProtocol) SetScriptSource(
	params *debugger.SetScriptSourceParams,
) <-chan *debugger.SetScriptSourceResult

SetScriptSource edits JavaScript source live.

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setScriptSource

func (*DebuggerProtocol) SetSkipAllPauses

func (protocol *DebuggerProtocol) SetSkipAllPauses(
	params *debugger.SetSkipAllPausesParams,
) <-chan *debugger.SetSkipAllPausesResult

SetSkipAllPauses makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setSkipAllPauses

func (*DebuggerProtocol) SetVariableValue

func (protocol *DebuggerProtocol) SetVariableValue(
	params *debugger.SetVariableValueParams,
) <-chan *debugger.SetVariableValueResult

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

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-setVariableValue

func (*DebuggerProtocol) StepInto

func (protocol *DebuggerProtocol) StepInto(
	params *debugger.StepIntoParams,
) <-chan *debugger.StepIntoResult

StepInto steps into the function call.

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-stepInto

func (*DebuggerProtocol) StepOut

func (protocol *DebuggerProtocol) StepOut() <-chan *debugger.StepOutResult

StepOut steps out of the function call.

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-stepOut

func (*DebuggerProtocol) StepOver

func (protocol *DebuggerProtocol) StepOver() <-chan *debugger.StepOverResult

StepOver steps over the statement.

https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#method-stepOver

type DeviceOrientationProtocol

type DeviceOrientationProtocol struct {
	Socket Socketer
}

DeviceOrientationProtocol provides a namespace for the Chrome DeviceOrientation protocol methods.

https://chromedevtools.github.io/devtools-protocol/tot/DeviceOrientation/ EXPERIMENTAL.

func (*DeviceOrientationProtocol) ClearOverride

func (protocol *DeviceOrientationProtocol) ClearOverride() <-chan *orientation.ClearOverrideResult

ClearOverride clears the overridden Device Orientation.

https://chromedevtools.github.io/devtools-protocol/tot/DeviceOrientation/#method-clearDeviceOrientationOverride

func (*DeviceOrientationProtocol) SetOverride

func (protocol *DeviceOrientationProtocol) SetOverride(
	params *orientation.SetOverrideParams,
) <-chan *orientation.SetOverrideResult

SetOverride overrides the Device Orientation.

https://chromedevtools.github.io/devtools-protocol/tot/DeviceOrientation/#method-setDeviceOrientationOverride

type EmulationProtocol

type EmulationProtocol struct {
	Socket Socketer
}

EmulationProtocol provides a namespace for the Chrome Emulation protocol methods. The Emulation protocol emulates different environments for the page.

https://chromedevtools.github.io/devtools-protocol/tot/Emulation/

func (*EmulationProtocol) CanEmulate

func (protocol *EmulationProtocol) CanEmulate() <-chan *emulation.CanEmulateResult

CanEmulate tells whether emulation is supported.

https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-canEmulate

func (*EmulationProtocol) ClearDeviceMetricsOverride

func (protocol *EmulationProtocol) ClearDeviceMetricsOverride() <-chan *emulation.ClearDeviceMetricsOverrideResult

ClearDeviceMetricsOverride clears the overridden device metrics.

https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-clearDeviceMetricsOverride

func (*EmulationProtocol) ClearGeolocationOverride

func (protocol *EmulationProtocol) ClearGeolocationOverride() <-chan *emulation.ClearGeolocationOverrideResult

ClearGeolocationOverride clears the overridden Geolocation Position and Error.

https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-clearGeolocationOverride

func (*EmulationProtocol) OnVirtualTimeAdvanced

func (protocol *EmulationProtocol) OnVirtualTimeAdvanced(
	callback func(event *emulation.VirtualTimeAdvancedEvent),
)

OnVirtualTimeAdvanced adds a handler to the Emulation.virtualTimeAdvanced event. Emulation.virtualTimeAdvanced fires after the virtual time has advanced.

https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#event-virtualTimeAdvanced EXPERIMENTAL.

func (*EmulationProtocol) OnVirtualTimeBudgetExpired

func (protocol *EmulationProtocol) OnVirtualTimeBudgetExpired(
	callback func(event *emulation.VirtualTimeBudgetExpiredEvent),
)

OnVirtualTimeBudgetExpired adds a handler to the Emulation.virtualTimeBudgetExpired event. Emulation.virtualTimeBudgetExpired fires after the virtual time budget for the current VirtualTimePolicy has run out.

https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#event-virtualTimeBudgetExpired EXPERIMENTAL.

func (*EmulationProtocol) OnVirtualTimePaused

func (protocol *EmulationProtocol) OnVirtualTimePaused(
	callback func(event *emulation.VirtualTimePausedEvent),
)

OnVirtualTimePaused adds a handler to the Emulation.virtualTimePaused event. Emulation.virtualTimePaused fires after the virtual time has paused.

https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#event-virtualTimePaused EXPERIMENTAL.

func (*EmulationProtocol) ResetPageScaleFactor

func (protocol *EmulationProtocol) ResetPageScaleFactor() <-chan *emulation.ResetPageScaleFactorResult

ResetPageScaleFactor requests that page scale factor is reset to initial values.

https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-resetPageScaleFactor EXPERIMENTAL.

func (*EmulationProtocol) SetCPUThrottlingRate

func (protocol *EmulationProtocol) SetCPUThrottlingRate(
	params *emulation.SetCPUThrottlingRateParams,
) <-chan *emulation.SetCPUThrottlingRateResult

SetCPUThrottlingRate enables CPU throttling to emulate slow CPUs.

https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setCPUThrottlingRate EXPERIMENTAL.

func (*EmulationProtocol) SetDefaultBackgroundColorOverride

func (protocol *EmulationProtocol) SetDefaultBackgroundColorOverride(
	params *emulation.SetDefaultBackgroundColorOverrideParams,
) <-chan *emulation.SetDefaultBackgroundColorOverrideResult

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.

https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setDefaultBackgroundColorOverride

func (*EmulationProtocol) SetDeviceMetricsOverride

func (protocol *EmulationProtocol) SetDeviceMetricsOverride(
	params *emulation.SetDeviceMetricsOverrideParams,
) <-chan *emulation.SetDeviceMetricsOverrideResult

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

https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setDeviceMetricsOverride

func (*EmulationProtocol) SetEmitTouchEventsForMouse

func (protocol *EmulationProtocol) SetEmitTouchEventsForMouse(
	params *emulation.SetEmitTouchEventsForMouseParams,
) <-chan *emulation.SetEmitTouchEventsForMouseResult

SetEmitTouchEventsForMouse enables touch events using a mouse.

https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setEmitTouchEventsForMouse EXPERIMENTAL.

func (*EmulationProtocol) SetEmulatedMedia

func (protocol *EmulationProtocol) SetEmulatedMedia(
	params *emulation.SetEmulatedMediaParams,
) <-chan *emulation.SetEmulatedMediaResult

SetEmulatedMedia emulates the given media for CSS media queries.

https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setEmulatedMedia

func (*EmulationProtocol) SetGeolocationOverride

func (protocol *EmulationProtocol) SetGeolocationOverride(
	params *emulation.SetGeolocationOverrideParams,
) <-chan *emulation.SetGeolocationOverrideResult

SetGeolocationOverride overrides the Geolocation Position or Error. Omitting any of the parameters emulates position unavailable.

https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setGeolocationOverride

func (*EmulationProtocol) SetNavigatorOverrides

func (protocol *EmulationProtocol) SetNavigatorOverrides(
	params *emulation.SetNavigatorOverridesParams,
) <-chan *emulation.SetNavigatorOverridesResult

SetNavigatorOverrides overrides value returned by the javascript navigator object.

https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setNavigatorOverrides EXPERIMENTAL.

func (*EmulationProtocol) SetPageScaleFactor

func (protocol *EmulationProtocol) SetPageScaleFactor(
	params *emulation.SetPageScaleFactorParams,
) <-chan *emulation.SetPageScaleFactorResult

SetPageScaleFactor sets a specified page scale factor.

https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setPageScaleFactor EXPERIMENTAL.

func (*EmulationProtocol) SetScriptExecutionDisabled

func (protocol *EmulationProtocol) SetScriptExecutionDisabled(
	params *emulation.SetScriptExecutionDisabledParams,
) <-chan *emulation.SetScriptExecutionDisabledResult

SetScriptExecutionDisabled switches script execution in the page.

https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setScriptExecutionDisabled

func (*EmulationProtocol) SetTouchEmulationEnabled

func (protocol *EmulationProtocol) SetTouchEmulationEnabled(
	params *emulation.SetTouchEmulationEnabledParams,
) <-chan *emulation.SetTouchEmulationEnabledResult

SetTouchEmulationEnabled enables touch on platforms which do not support it.

https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setTouchEmulationEnabled

func (*EmulationProtocol) SetVirtualTimePolicy

func (protocol *EmulationProtocol) SetVirtualTimePolicy(
	params *emulation.SetVirtualTimePolicyParams,
) <-chan *emulation.SetVirtualTimePolicyResult

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.

https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setVirtualTimePolicy EXPERIMENTAL.

func (*EmulationProtocol) SetVisibleSize

func (protocol *EmulationProtocol) SetVisibleSize(
	params *emulation.SetVisibleSizeParams,
) <-chan *emulation.SetVisibleSizeResult

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.

https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setVisibleSize EXPERIMENTAL. DEPRECATED.

type Error

type Error struct {
	Code    int             `json:"code"`
	Data    json.RawMessage `json:"data"`
	Message string          `json:"message"`
}

Error represents a socket response error.

func (Error) Error

func (err Error) Error() string

Error implements the error interface for socket response Error structs

type EventHandler

type EventHandler interface {
	// Handle executes the event handler callback.
	Handle(response *Response)

	// Name returns the name of the event the handler is assigned to.
	Name() string
}

EventHandler defines the event handler interface required by the event handler process.

type EventHandlerMap

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

EventHandlerMap provides an EventHandlerMapper interface for handling the event handler stack.

func NewEventHandlerMap

func NewEventHandlerMap() *EventHandlerMap

NewEventHandlerMap creates and returns a pointer to an EventHandlerMapper.

func (*EventHandlerMap) Add

func (stack *EventHandlerMap) Add(
	handler EventHandler,
) error

Add adds a handler to the stack of handlers for an event.

Add is an EventHandlerMapper implementation.

func (*EventHandlerMap) Delete

func (stack *EventHandlerMap) Delete(
	name string,
)

Delete removes the entire stack of handlers for an event.

Delete is an EventHandlerMapper implementation.

func (*EventHandlerMap) Get

func (stack *EventHandlerMap) Get(
	name string,
) ([]EventHandler, error)

Get retrieves the entire stack of handlers for an event.

Get is an EventHandlerMapper implementation.

func (*EventHandlerMap) Lock

func (stack *EventHandlerMap) Lock()

Lock locks the sync mutex.

Lock is an EventHandlerMapper implementation.

func (*EventHandlerMap) Remove

func (stack *EventHandlerMap) Remove(
	handler EventHandler,
) error

Remove removes a handler from the stack of handlers for an event.

Remove is an EventHandlerMapper implementation.

func (*EventHandlerMap) Set

func (stack *EventHandlerMap) Set(
	eventName string,
	handlers []EventHandler,
)

Set sets the entire stack of handlers for an event.

Set is an EventHandlerMapper implementation.

func (*EventHandlerMap) Unlock

func (stack *EventHandlerMap) Unlock()

Unlock unlocks the sync mutex.

Unlock is an EventHandlerMapper implementation.

type EventHandlerMapper

type EventHandlerMapper interface {
	// Add adds a handler to the stack of handlers for an event.
	Add(handler EventHandler) error

	// Delete removes the entire stack of handlers for an event.
	Delete(eventName string)

	// Get retrieves the entire stack of handlers for an event.
	Get(eventName string) ([]EventHandler, error)

	// Lock locks the sync mutex.
	Lock()

	// Remove removes a handler from the stack of handlers for an event.
	Remove(handler EventHandler) error

	// Set sets the entire stack of handlers for an event.
	Set(eventName string, handlers []EventHandler)

	// Unlock unlocks the sync mutex.
	Unlock()
}

EventHandlerMapper defines a management interface for the stack of event handlers.

type Handler

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

Handler provides an EventHandler interface for managing an event handler.

func NewEventHandler

func NewEventHandler(
	name string,
	callback func(response *Response),
) *Handler

NewEventHandler returns a pointer to an event handler.

func (*Handler) Handle

func (handler *Handler) Handle(
	response *Response,
)

Handle executes the event handler callback.

Handle is an EventHandler implementation.

func (*Handler) Name

func (handler *Handler) Name() string

Name returns the name of the event the handler is assigned to.

Name is an EventHandler implementation.

type HeadlessExperimentalProtocol

type HeadlessExperimentalProtocol struct {
	Socket Socketer
}

HeadlessExperimentalProtocol provides a namespace for the Chrome HeadlessExperimental protocol methods. The HeadlessExperimental protocol provides experimental commands only supported in headless mode.

https://chromedevtools.github.io/devtools-protocol/tot/HeadlessExperimental/ EXPERIMENTAL.

func (*HeadlessExperimentalProtocol) BeginFrame

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.

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

func (*HeadlessExperimentalProtocol) Disable

func (protocol *HeadlessExperimentalProtocol) Disable() <-chan *experimental.DisableResult

Disable disables headless events for the target.

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

func (*HeadlessExperimentalProtocol) Enable

func (protocol *HeadlessExperimentalProtocol) Enable() <-chan *experimental.EnableResult

Enable enables headless events for the target.

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

func (*HeadlessExperimentalProtocol) OnMainFrameReadyForScreenshots

func (protocol *HeadlessExperimentalProtocol) OnMainFrameReadyForScreenshots(
	callback func(event *experimental.MainFrameReadyForScreenshotsEvent),
)

OnMainFrameReadyForScreenshots adds a handler to the HeadlessExperimental.mainFrameReadyForScreenshots event. HeadlessExperimental.mainFrameReadyForScreenshots fires when the main frame has first submitted a frame to the browser. May only be fired while a BeginFrame is in flight. Before this event, screenshotting requests may fail.

https://chromedevtools.github.io/devtools-protocol/tot/HeadlessExperimental/#event-mainFrameReadyForScreenshots

func (*HeadlessExperimentalProtocol) OnNeedsBeginFramesChanged

func (protocol *HeadlessExperimentalProtocol) OnNeedsBeginFramesChanged(
	callback func(event *experimental.NeedsBeginFramesChangedEvent),
)

OnNeedsBeginFramesChanged adds a handler to the HeadlessExperimental.needsBeginFramesChanged event. HeadlessExperimental.needsBeginFramesChanged fires when the target starts or stops needing BeginFrames.

https://chromedevtools.github.io/devtools-protocol/tot/HeadlessExperimental/#event-needsBeginFramesChanged

type HeapProfilerProtocol

type HeapProfilerProtocol struct {
	Socket Socketer
}

HeapProfilerProtocol provides a namespace for the Chrome HeapProfiler protocol methods.

https://chromedevtools.github.io/devtools-protocol/tot/HeapProfiler/ EXPERIMENTAL.

func (*HeapProfilerProtocol) AddInspectedHeapObject

func (protocol *HeapProfilerProtocol) AddInspectedHeapObject(
	params *profiler.AddInspectedHeapObjectParams,
) <-chan *profiler.AddInspectedHeapObjectResult

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

https://chromedevtools.github.io/devtools-protocol/tot/HeapProfiler/#method-addInspectedHeapObject

func (*HeapProfilerProtocol) CollectGarbage

func (protocol *HeapProfilerProtocol) CollectGarbage() <-chan *profiler.CollectGarbageResult

CollectGarbage is experimental.

https://chromedevtools.github.io/devtools-protocol/tot/HeapProfiler/#method-collectGarbage EXPERIMENTAL.

func (*HeapProfilerProtocol) Disable

func (protocol *HeapProfilerProtocol) Disable() <-chan *profiler.DisableResult

Disable disables the HeapProfiler.

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

func (*HeapProfilerProtocol) Enable

func (protocol *HeapProfilerProtocol) Enable() <-chan *profiler.EnableResult

Enable enables the HeapProfiler.

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

func (*HeapProfilerProtocol) GetHeapObjectID

func (protocol *HeapProfilerProtocol) GetHeapObjectID(
	params *profiler.GetHeapObjectIDParams,
) <-chan *profiler.GetHeapObjectIDResult

GetHeapObjectID is experimental.

https://chromedevtools.github.io/devtools-protocol/tot/HeapProfiler/#method-getHeapObjectId EXPERIMENTAL.

func (*HeapProfilerProtocol) GetObjectByHeapObjectID

func (protocol *HeapProfilerProtocol) GetObjectByHeapObjectID(
	params *profiler.GetObjectByHeapObjectIDParams,
) <-chan *profiler.GetObjectByHeapObjectIDResult

GetObjectByHeapObjectID is experimental.

https://chromedevtools.github.io/devtools-protocol/tot/HeapProfiler/#method-getObjectByHeapObjectId EXPERIMENTAL.

func (*HeapProfilerProtocol) GetSamplingProfile

func (protocol *HeapProfilerProtocol) GetSamplingProfile(
	params *profiler.GetSamplingProfileParams,
) <-chan *profiler.GetSamplingProfileResult

GetSamplingProfile is experimental.

https://chromedevtools.github.io/devtools-protocol/tot/HeapProfiler/#method-getSamplingProfile EXPERIMENTAL.

func (*HeapProfilerProtocol) OnAddHeapSnapshotChunk

func (protocol *HeapProfilerProtocol) OnAddHeapSnapshotChunk(
	callback func(event *profiler.AddHeapSnapshotChunkEvent),
)

OnAddHeapSnapshotChunk adds a handler to the HeapProfiler.AddHeapSnapshotChunk event.

https://chromedevtools.github.io/devtools-protocol/tot/HeapProfiler/#event-addHeapSnapshotChunk EXPERIMENTAL.

func (*HeapProfilerProtocol) OnHeapStatsUpdate

func (protocol *HeapProfilerProtocol) OnHeapStatsUpdate(
	callback func(event *profiler.HeapStatsUpdateEvent),
)

OnHeapStatsUpdate adds a handler to the DOM.heapStatsUpdate event. DOM.heapStatsUpdate fires if heap objects tracking has been started then backend may send update for one or more fragments.

https://chromedevtools.github.io/devtools-protocol/tot/HeapProfiler/#event-heapStatsUpdate

func (*HeapProfilerProtocol) OnLastSeenObjectID

func (protocol *HeapProfilerProtocol) OnLastSeenObjectID(
	callback func(event *profiler.LastSeenObjectIDEvent),
)

OnLastSeenObjectID adds a handler to the DOM.LastSeenObjectID event. DOM.LastSeenObjectID fires 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.

https://chromedevtools.github.io/devtools-protocol/tot/HeapProfiler/#event-lastSeenObjectId

func (*HeapProfilerProtocol) OnReportHeapSnapshotProgress

func (protocol *HeapProfilerProtocol) OnReportHeapSnapshotProgress(
	callback func(event *profiler.ReportHeapSnapshotProgressEvent),
)

OnReportHeapSnapshotProgress adds a handler to the DOM.ReportHeapSnapshotProgress event.

https://chromedevtools.github.io/devtools-protocol/tot/HeapProfiler/#event-reportHeapSnapshotProgress EXPERIMENTAL.

func (*HeapProfilerProtocol) OnResetProfiles

func (protocol *HeapProfilerProtocol) OnResetProfiles(
	callback func(event *profiler.ResetProfilesEvent),
)

OnResetProfiles adds a handler to the HeapProfiler.ResetProfiles event.

https://chromedevtools.github.io/devtools-protocol/tot/HeapProfiler/#event-resetProfiles EXPERIMENTAL.

func (*HeapProfilerProtocol) StartSampling

func (protocol *HeapProfilerProtocol) StartSampling(
	params *profiler.StartSamplingParams,
) <-chan *profiler.StartSamplingResult

StartSampling is experimental.

https://chromedevtools.github.io/devtools-protocol/tot/HeapProfiler/#method-startSampling EXPERIMENTAL.

func (*HeapProfilerProtocol) StartTrackingHeapObjects

func (protocol *HeapProfilerProtocol) StartTrackingHeapObjects(
	params *profiler.StartTrackingHeapObjectsParams,
) <-chan *profiler.StartTrackingHeapObjectsResult

StartTrackingHeapObjects is experimental.

https://chromedevtools.github.io/devtools-protocol/tot/HeapProfiler/#method-startTrackingHeapObjects EXPERIMENTAL.

func (*HeapProfilerProtocol) StopSampling

func (protocol *HeapProfilerProtocol) StopSampling(
	params *profiler.StopSamplingParams,
) <-chan *profiler.StopSamplingResult

StopSampling is experimental.

https://chromedevtools.github.io/devtools-protocol/tot/HeapProfiler/#method-stopSampling EXPERIMENTAL.

func (*HeapProfilerProtocol) StopTrackingHeapObjects

func (protocol *HeapProfilerProtocol) StopTrackingHeapObjects(
	params *profiler.StopTrackingHeapObjectsParams,
) <-chan *profiler.StopTrackingHeapObjectsResult

StopTrackingHeapObjects is experimental.

https://chromedevtools.github.io/devtools-protocol/tot/HeapProfiler/#method-stopTrackingHeapObjects EXPERIMENTAL.

func (*HeapProfilerProtocol) TakeHeapSnapshot

func (protocol *HeapProfilerProtocol) TakeHeapSnapshot(
	params *profiler.TakeHeapSnapshotParams,
) <-chan *profiler.TakeHeapSnapshotResult

TakeHeapSnapshot is experimental.

https://chromedevtools.github.io/devtools-protocol/tot/HeapProfiler/#method-takeHeapSnapshot EXPERIMENTAL.

type IOProtocol

type IOProtocol struct {
	Socket Socketer
}

IOProtocol provides a namespace for the Chrome IO protocol methods. The IO protocol provides input/output operations for streams produced by DevTools.

https://chromedevtools.github.io/devtools-protocol/tot/IO/

func (*IOProtocol) Close

func (protocol *IOProtocol) Close(
	params *io.CloseParams,
) <-chan *io.CloseResult

Close closes the stream and discards any temporary backing storage.

https://chromedevtools.github.io/devtools-protocol/tot/IO/#method-close

func (*IOProtocol) Read

func (protocol *IOProtocol) Read(
	params *io.ReadParams,
) <-chan *io.ReadResult

Read reads a chunk of the stream.

https://chromedevtools.github.io/devtools-protocol/tot/IO/#method-read

func (*IOProtocol) ResolveBlob

func (protocol *IOProtocol) ResolveBlob(
	params *io.ResolveBlobParams,
) <-chan *io.ResolveBlobResult

ResolveBlob returns the UUID of Blob object specified by a remote object id.

https://chromedevtools.github.io/devtools-protocol/tot/IO/#method-resolveBlob

type IndexedDBProtocol

type IndexedDBProtocol struct {
	Socket Socketer
}

IndexedDBProtocol provides a namespace for the Chrome IndexedDB protocol methods.

https://chromedevtools.github.io/devtools-protocol/tot/IndexedDB/ EXPERIMENTAL.

func (*IndexedDBProtocol) ClearObjectStore

func (protocol *IndexedDBProtocol) ClearObjectStore(
	params *db.ClearObjectStoreParams,
) <-chan *db.ClearObjectStoreResult

ClearObjectStore clears all entries from an object store.

https://chromedevtools.github.io/devtools-protocol/tot/IndexedDB/#method-clearObjectStore

func (*IndexedDBProtocol) DeleteDatabase

func (protocol *IndexedDBProtocol) DeleteDatabase(
	params *db.DeleteDatabaseParams,
) <-chan *db.DeleteDatabaseResult

DeleteDatabase deletes a database.

https://chromedevtools.github.io/devtools-protocol/tot/IndexedDB/#method-deleteDatabase

func (*IndexedDBProtocol) DeleteObjectStoreEntries

func (protocol *IndexedDBProtocol) DeleteObjectStoreEntries(
	params *db.DeleteObjectStoreEntriesParams,
) <-chan *db.DeleteObjectStoreEntriesResult

DeleteObjectStoreEntries deletes a range of entries from an object store.

https://chromedevtools.github.io/devtools-protocol/tot/IndexedDB/#method-deleteObjectStoreEntries

func (*IndexedDBProtocol) Disable

func (protocol *IndexedDBProtocol) Disable() <-chan *db.DisableResult

Disable disables events from backend.

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

func (*IndexedDBProtocol) Enable

func (protocol *IndexedDBProtocol) Enable() <-chan *db.EnableResult

Enable enables events from backend.

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

func (*IndexedDBProtocol) RequestData

func (protocol *IndexedDBProtocol) RequestData(
	params *db.RequestDataParams,
) <-chan *db.RequestDataResult

RequestData requests data from object store or index.

https://chromedevtools.github.io/devtools-protocol/tot/IndexedDB/#method-requestData

func (*IndexedDBProtocol) RequestDatabase

func (protocol *IndexedDBProtocol) RequestDatabase(
	params *db.RequestDatabaseParams,
) <-chan *db.RequestDatabaseResult

RequestDatabase requests database with given name in given frame.

https://chromedevtools.github.io/devtools-protocol/tot/IndexedDB/#method-requestDatabase

func (*IndexedDBProtocol) RequestDatabaseNames

func (protocol *IndexedDBProtocol) RequestDatabaseNames(
	params *db.RequestDatabaseNamesParams,
) <-chan *db.RequestDatabaseNamesResult

RequestDatabaseNames requests database names for given security origin.

https://chromedevtools.github.io/devtools-protocol/tot/IndexedDB/#method-requestDatabaseNames

type InputProtocol

type InputProtocol struct {
	Socket Socketer
}

InputProtocol provides a namespace for the Chrome Input protocol methods.

https://chromedevtools.github.io/devtools-protocol/tot/Input/

func (*InputProtocol) DispatchKeyEvent

func (protocol *InputProtocol) DispatchKeyEvent(
	params *input.DispatchKeyEventParams,
) <-chan *input.DispatchKeyEventResult

DispatchKeyEvent dispatches a key event to the page.

https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-dispatchKeyEvent

func (*InputProtocol) DispatchMouseEvent

func (protocol *InputProtocol) DispatchMouseEvent(
	params *input.DispatchMouseEventParams,
) <-chan *input.DispatchMouseEventResult

DispatchMouseEvent dispatches a mouse event to the page.

https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-dispatchMouseEvent

func (*InputProtocol) DispatchTouchEvent

func (protocol *InputProtocol) DispatchTouchEvent(
	params *input.DispatchTouchEventParams,
) <-chan *input.DispatchTouchEventResult

DispatchTouchEvent dispatches a touch event to the page.

https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-dispatchTouchEvent

func (*InputProtocol) EmulateTouchFromMouseEvent

func (protocol *InputProtocol) EmulateTouchFromMouseEvent(
	params *input.EmulateTouchFromMouseEventParams,
) <-chan *input.EmulateTouchFromMouseEventResult

EmulateTouchFromMouseEvent emulates touch event from the mouse event parameters.

https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-emulateTouchFromMouseEvent EXPERIMENTAL.

func (*InputProtocol) SetIgnoreEvents

func (protocol *InputProtocol) SetIgnoreEvents(
	params *input.SetIgnoreEventsParams,
) <-chan *input.SetIgnoreEventsResult

SetIgnoreEvents ignores input events (useful while auditing page).

https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-setIgnoreInputEvents

func (*InputProtocol) SynthesizePinchGesture

func (protocol *InputProtocol) SynthesizePinchGesture(
	params *input.SynthesizePinchGestureParams,
) <-chan *input.SynthesizePinchGestureResult

SynthesizePinchGesture synthesizes a pinch gesture over a time period by issuing appropriate touch events.

https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-synthesizePinchGesture EXPERIMENTAL.

func (*InputProtocol) SynthesizeScrollGesture

func (protocol *InputProtocol) SynthesizeScrollGesture(
	params *input.SynthesizeScrollGestureParams,
) <-chan *input.SynthesizeScrollGestureResult

SynthesizeScrollGesture synthesizes a scroll gesture over a time period by issuing appropriate touch events.

https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-synthesizeScrollGesture EXPERIMENTAL.

func (*InputProtocol) SynthesizeTapGesture

func (protocol *InputProtocol) SynthesizeTapGesture(
	params *input.SynthesizeTapGestureParams,
) <-chan *input.SynthesizeTapGestureResult

SynthesizeTapGesture synthesizes a tap gesture over a time period by issuing appropriate touch events.

https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-synthesizeTapGesture EXPERIMENTAL.

type LayerTreeProtocol

type LayerTreeProtocol struct {
	Socket Socketer
}

LayerTreeProtocol provides a namespace for the Chrome LayerTree protocol methods.

https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/ EXPERIMENTAL.

func (*LayerTreeProtocol) CompositingReasons

func (protocol *LayerTreeProtocol) CompositingReasons(
	params *tree.CompositingReasonsParams,
) <-chan *tree.CompositingReasonsResult

CompositingReasons provides the reasons why the given layer was composited.

https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#method-compositingReasons

func (*LayerTreeProtocol) Disable

func (protocol *LayerTreeProtocol) Disable() <-chan *tree.DisableResult

Disable disables compositing tree inspection.

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

func (*LayerTreeProtocol) Enable

func (protocol *LayerTreeProtocol) Enable() <-chan *tree.EnableResult

Enable enables compositing tree inspection.

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

func (*LayerTreeProtocol) LoadSnapshot

func (protocol *LayerTreeProtocol) LoadSnapshot(
	params *tree.LoadSnapshotParams,
) <-chan *tree.LoadSnapshotResult

LoadSnapshot returns the snapshot identifier.

https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#method-loadSnapshot

func (*LayerTreeProtocol) MakeSnapshot

func (protocol *LayerTreeProtocol) MakeSnapshot(
	params *tree.MakeSnapshotParams,
) <-chan *tree.MakeSnapshotResult

MakeSnapshot returns the layer snapshot identifier.

https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#method-makeSnapshot

func (*LayerTreeProtocol) OnLayerPainted

func (protocol *LayerTreeProtocol) OnLayerPainted(
	callback func(event *tree.LayerPaintedEvent),
)

OnLayerPainted adds a handler to the LayerTree.layerPainted event. LayerTree.layerPainted fires when the layer is painted.

https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#event-layerPainted

func (*LayerTreeProtocol) OnLayerTreeDidChange

func (protocol *LayerTreeProtocol) OnLayerTreeDidChange(
	callback func(event *tree.DidChangeEvent),
)

OnLayerTreeDidChange adds a handler to the LayerTree.DidChange event. LayerTree.DidChange fires when the layer tree changes.

https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#event-layerTreeDidChange

func (*LayerTreeProtocol) ProfileSnapshot

func (protocol *LayerTreeProtocol) ProfileSnapshot(
	params *tree.ProfileSnapshotParams,
) <-chan *tree.ProfileSnapshotResult

ProfileSnapshot profiles a snapshot.

https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#method-profileSnapshot

func (*LayerTreeProtocol) ReleaseSnapshot

func (protocol *LayerTreeProtocol) ReleaseSnapshot(
	params *tree.ReleaseSnapshotParams,
) <-chan *tree.ReleaseSnapshotResult

ReleaseSnapshot releases layer snapshot captured by the back-end.

https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#method-releaseSnapshot

func (*LayerTreeProtocol) ReplaySnapshot

func (protocol *LayerTreeProtocol) ReplaySnapshot(
	params *tree.ReplaySnapshotParams,
) <-chan *tree.ReplaySnapshotResult

ReplaySnapshot replays the layer snapshot and returns the resulting bitmap.

https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#method-replaySnapshot

func (*LayerTreeProtocol) SnapshotCommandLog

func (protocol *LayerTreeProtocol) SnapshotCommandLog(
	params *tree.SnapshotCommandLogParams,
) <-chan *tree.SnapshotCommandLogResult

SnapshotCommandLog replays the layer snapshot and returns canvas log.

https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#method-snapshotCommandLog

type LogProtocol

type LogProtocol struct {
	Socket Socketer
}

LogProtocol provides a namespace for the Chrome Log protocol methods. The Log protocol provides access to log entries.

https://chromedevtools.github.io/devtools-protocol/tot/Log/

func (*LogProtocol) Clear

func (protocol *LogProtocol) Clear() <-chan *log.ClearResult

Clear clears the log.

https://chromedevtools.github.io/devtools-protocol/tot/Log/#method-clear

func (*LogProtocol) Disable

func (protocol *LogProtocol) Disable() <-chan *log.DisableResult

Disable disables log domain, prevents further log entries from being reported to the client.

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

func (*LogProtocol) Enable

func (protocol *LogProtocol) Enable() <-chan *log.EnableResult

Enable enables log domain, sends the entries collected so far to the client by means of the `entryAdded` notification.

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

func (*LogProtocol) OnEntryAdded

func (protocol *LogProtocol) OnEntryAdded(
	callback func(event *log.EntryAddedEvent),
)

OnEntryAdded adds a handler to the Log.entryAdded event. Log.entryAdded fires when a new message is logged.

https://chromedevtools.github.io/devtools-protocol/tot/Log/#event-entryAdded

func (*LogProtocol) StartViolationsReport

func (protocol *LogProtocol) StartViolationsReport(
	params *log.StartViolationsReportParams,
) <-chan *log.StartViolationsReportResult

StartViolationsReport starts violation reporting.

https://chromedevtools.github.io/devtools-protocol/tot/Log/#method-startViolationsReport

func (*LogProtocol) StopViolationsReport

func (protocol *LogProtocol) StopViolationsReport() <-chan *log.StopViolationsReportResult

StopViolationsReport stops violation reporting.

https://chromedevtools.github.io/devtools-protocol/tot/Log/#method-stopViolationsReport

type MemoryProtocol

type MemoryProtocol struct {
	Socket Socketer
}

MemoryProtocol provides a namespace for the Chrome Memory protocol methods.

https://chromedevtools.github.io/devtools-protocol/tot/Memory/ EXPERIMENTAL.

func (*MemoryProtocol) GetDOMCounters

func (protocol *MemoryProtocol) GetDOMCounters(
	params *memory.GetDOMCountersParams,
) <-chan *memory.GetDOMCountersResult

GetDOMCounters is experimental.

https://chromedevtools.github.io/devtools-protocol/tot/Memory/#method-getDOMCounters EXPERIMENTAL.

func (*MemoryProtocol) PrepareForLeakDetection

func (protocol *MemoryProtocol) PrepareForLeakDetection() <-chan *memory.PrepareForLeakDetectionResult

PrepareForLeakDetection experimental

https://chromedevtools.github.io/devtools-protocol/tot/Memory/#method-prepareForLeakDetection EXPERIMENTAL.

func (*MemoryProtocol) SetPressureNotificationsSuppressed

func (protocol *MemoryProtocol) SetPressureNotificationsSuppressed(
	params *memory.SetPressureNotificationsSuppressedParams,
) <-chan *memory.SetPressureNotificationsSuppressedResult

SetPressureNotificationsSuppressed enables/disables suppressing memory pressure notifications in all processes.

https://chromedevtools.github.io/devtools-protocol/tot/Memory/#method-setPressureNotificationsSuppressed

func (*MemoryProtocol) SimulatePressureNotification

func (protocol *MemoryProtocol) SimulatePressureNotification(
	params *memory.SimulatePressureNotificationParams,
) <-chan *memory.SimulatePressureNotificationResult

SimulatePressureNotification simulates a memory pressure notification in all processes.

https://chromedevtools.github.io/devtools-protocol/tot/Memory/#method-simulatePressureNotification

type NetworkProtocol

type NetworkProtocol struct {
	Socket Socketer
}

NetworkProtocol provides a namespace for the Chrome Network protocol methods. The Network protocol allows tracking network activities of the page. It exposes information about http, file, data and other requests and responses, their headers, bodies, timing, etc.

https://chromedevtools.github.io/devtools-protocol/tot/Network/

func (*NetworkProtocol) CanClearBrowserCache

func (protocol *NetworkProtocol) CanClearBrowserCache() <-chan *network.CanClearBrowserCacheResult

CanClearBrowserCache tells whether clearing browser cache is supported.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-canClearBrowserCache DEPRECATED.

func (*NetworkProtocol) CanClearBrowserCookies

func (protocol *NetworkProtocol) CanClearBrowserCookies() <-chan *network.CanClearBrowserCookiesResult

CanClearBrowserCookies tells whether clearing browser cookies is supported.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-canClearBrowserCookies DEPRECATED.

func (*NetworkProtocol) CanEmulateConditions

func (protocol *NetworkProtocol) CanEmulateConditions() <-chan *network.CanEmulateConditionsResult

CanEmulateConditions tells whether emulation of network conditions is supported.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-canEmulateNetworkConditions DEPRECATED.

func (*NetworkProtocol) ClearBrowserCache

func (protocol *NetworkProtocol) ClearBrowserCache() <-chan *network.ClearBrowserCacheResult

ClearBrowserCache clears browser cache.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-clearBrowserCache

func (*NetworkProtocol) ClearBrowserCookies

func (protocol *NetworkProtocol) ClearBrowserCookies() <-chan *network.ClearBrowserCookiesResult

ClearBrowserCookies clears browser cookies.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-clearBrowserCookies

func (*NetworkProtocol) ContinueInterceptedRequest

func (protocol *NetworkProtocol) ContinueInterceptedRequest(
	params *network.ContinueInterceptedRequestParams,
) <-chan *network.ContinueInterceptedRequestResult

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.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-continueInterceptedRequest EXPERIMENTAL.

func (*NetworkProtocol) DeleteCookies

func (protocol *NetworkProtocol) DeleteCookies(
	params *network.DeleteCookiesParams,
) <-chan *network.DeleteCookiesResult

DeleteCookies deletes browser cookies with matching name and url or domain/path pair.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-deleteCookies

func (*NetworkProtocol) Disable

func (protocol *NetworkProtocol) Disable() <-chan *network.DisableResult

Disable disables network tracking, prevents network events from being sent to the client.

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

func (*NetworkProtocol) EmulateConditions

func (protocol *NetworkProtocol) EmulateConditions(
	params *network.EmulateConditionsParams,
) <-chan *network.EmulateConditionsResult

EmulateConditions activates emulation of network conditions.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-emulateNetworkConditions

func (*NetworkProtocol) Enable

func (protocol *NetworkProtocol) Enable(
	params *network.EnableParams,
) <-chan *network.EnableResult

Enable enables network tracking, network events will now be delivered to the client.

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

func (*NetworkProtocol) GetAllCookies

func (protocol *NetworkProtocol) GetAllCookies() <-chan *network.GetAllCookiesResult

GetAllCookies returns all browser cookies. Depending on the backend support, will return detailed cookie information in the `cookies` field.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-getAllCookies

func (*NetworkProtocol) GetCertificate

func (protocol *NetworkProtocol) GetCertificate(
	params *network.GetCertificateParams,
) <-chan *network.GetCertificateResult

GetCertificate returns the DER-encoded certificate.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-getCertificate EXPERIMENTAL.

func (*NetworkProtocol) GetCookies

func (protocol *NetworkProtocol) GetCookies(
	params *network.GetCookiesParams,
) <-chan *network.GetCookiesResult

GetCookies returns all browser cookies for the current URL. Depending on the backend support, will return detailed cookie information in the `cookies` field.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-getCookies

func (*NetworkProtocol) GetResponseBody

func (protocol *NetworkProtocol) GetResponseBody(
	params *network.GetResponseBodyParams,
) <-chan *network.GetResponseBodyResult

GetResponseBody returns content served for the given request.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-getResponseBody

func (*NetworkProtocol) GetResponseBodyForInterception

func (protocol *NetworkProtocol) GetResponseBodyForInterception(
	params *network.GetResponseBodyForInterceptionParams,
) <-chan *network.GetResponseBodyForInterceptionResult

GetResponseBodyForInterception returns content served for the given currently intercepted request.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-getResponseBodyForInterception EXPERIMENTAL.

func (*NetworkProtocol) OnDataReceived

func (protocol *NetworkProtocol) OnDataReceived(
	callback func(event *network.DataReceivedEvent),
)

OnDataReceived adds a handler to the Network.dataReceived event. Network.dataReceived fires when a data chunk was received over the network.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#event-dataReceived

func (*NetworkProtocol) OnEventSourceMessageReceived

func (protocol *NetworkProtocol) OnEventSourceMessageReceived(
	callback func(event *network.EventSourceMessageReceivedEvent),
)

OnEventSourceMessageReceived adds a handler to the Network.eventSourceMessageReceived event. Network.eventSourceMessageReceived fires when EventSource message is received.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#event-eventSourceMessageReceived

func (*NetworkProtocol) OnLoadingFailed

func (protocol *NetworkProtocol) OnLoadingFailed(
	callback func(event *network.LoadingFailedEvent),
)

OnLoadingFailed adds a handler to the Network.loadingFailed event. Network.loadingFailed fires when HTTP request has failed to load.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#event-loadingFailed

func (*NetworkProtocol) OnLoadingFinished

func (protocol *NetworkProtocol) OnLoadingFinished(
	callback func(event *network.LoadingFinishedEvent),
)

OnLoadingFinished adds a handler to the Network.loadingFinished event. Network.loadingFinished fires when HTTP request has finished loading.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#event-loadingFinished

func (*NetworkProtocol) OnRequestIntercepted

func (protocol *NetworkProtocol) OnRequestIntercepted(
	callback func(event *network.RequestInterceptedEvent),
)

OnRequestIntercepted adds a handler to the Network.requestIntercepted event. Network.requestIntercepted fires when a HTTP request is intercepted and returns details, which must be either allowed, blocked, modified or mocked.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#event-requestIntercepted EXPERIMENTAL.

func (*NetworkProtocol) OnRequestServedFromCache

func (protocol *NetworkProtocol) OnRequestServedFromCache(
	callback func(event *network.RequestServedFromCacheEvent),
)

OnRequestServedFromCache adds a handler to the Network.requestServedFromCache event. Network.requestServedFromCache fires when request ended up loading from cache.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#event-requestServedFromCache

func (*NetworkProtocol) OnRequestWillBeSent

func (protocol *NetworkProtocol) OnRequestWillBeSent(
	callback func(event *network.RequestWillBeSentEvent),
)

OnRequestWillBeSent adds a handler to the Network.requestWillBeSent event. Network.requestWillBeSent fires when the page is about to send HTTP request.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#event-requestWillBeSent

func (*NetworkProtocol) OnResourceChangedPriority

func (protocol *NetworkProtocol) OnResourceChangedPriority(
	callback func(event *network.ResourceChangedPriorityEvent),
)

OnResourceChangedPriority adds a handler to the Network.resourceChangedPriority event. Network.resourceChangedPriority fires when resource loading priority is changed.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#event-resourceChangedPriority EXPERIMENTAL.

func (*NetworkProtocol) OnResponseReceived

func (protocol *NetworkProtocol) OnResponseReceived(
	callback func(event *network.ResponseReceivedEvent),
)

OnResponseReceived adds a handler to the Network.responseReceived event. Network.responseReceived fires when HTTP response is available.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#event-responseReceived

func (*NetworkProtocol) OnWebSocketClosed

func (protocol *NetworkProtocol) OnWebSocketClosed(
	callback func(event *network.WebSocketClosedEvent),
)

OnWebSocketClosed adds a handler to the Network.webSocketClosed event. Network.webSocketClosed fires when WebSocket is closed.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#event-webSocketClosed

func (*NetworkProtocol) OnWebSocketCreated

func (protocol *NetworkProtocol) OnWebSocketCreated(
	callback func(event *network.WebSocketCreatedEvent),
)

OnWebSocketCreated adds a handler to the Network.webSocketCreated event. Network.webSocketCreated fires upon WebSocket creation.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#event-webSocketCreated

func (*NetworkProtocol) OnWebSocketFrameError

func (protocol *NetworkProtocol) OnWebSocketFrameError(
	callback func(event *network.WebSocketFrameErrorEvent),
)

OnWebSocketFrameError adds a handler to the Network.webSocketFrameError event. Network.webSocketFrameError fires when a WebSocket frame error occurs.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#event-webSocketFrameError

func (*NetworkProtocol) OnWebSocketFrameReceived

func (protocol *NetworkProtocol) OnWebSocketFrameReceived(
	callback func(event *network.WebSocketFrameReceivedEvent),
)

OnWebSocketFrameReceived adds a handler to the Network.webSocketFrameReceived event. Network.webSocketFrameReceived fires when WebSocket frame is received.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#event-webSocketFrameReceived

func (*NetworkProtocol) OnWebSocketFrameSent

func (protocol *NetworkProtocol) OnWebSocketFrameSent(
	callback func(event *network.WebSocketFrameSentEvent),
)

OnWebSocketFrameSent adds a handler to the Network.webSocketFrameSent event. Network.webSocketFrameSent fires when WebSocket frame is sent.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#event-webSocketFrameSent

func (*NetworkProtocol) OnWebSocketHandshakeResponseReceived

func (protocol *NetworkProtocol) OnWebSocketHandshakeResponseReceived(
	callback func(event *network.WebSocketHandshakeResponseReceivedEvent),
)

OnWebSocketHandshakeResponseReceived adds a handler to the Network.webSocketHandshakeResponseReceived event. Network.webSocketHandshakeResponseReceived fires when WebSocket handshake response becomes available.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#event-webSocketHandshakeResponseReceived

func (*NetworkProtocol) OnWebSocketWillSendHandshakeRequest

func (protocol *NetworkProtocol) OnWebSocketWillSendHandshakeRequest(
	callback func(event *network.WebSocketWillSendHandshakeRequestEvent),
)

OnWebSocketWillSendHandshakeRequest adds a handler to the Network.webSocketWillSendHandshakeRequest event. Network.webSocketWillSendHandshakeRequest fires when WebSocket is about to initiate handshake.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#event-webSocketWillSendHandshakeRequest

func (*NetworkProtocol) ReplayXHR

func (protocol *NetworkProtocol) ReplayXHR(
	params *network.ReplayXHRParams,
) <-chan *network.ReplayXHRResult

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

https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-replayXHR EXPERIMENTAL.

func (*NetworkProtocol) SearchInResponseBody

func (protocol *NetworkProtocol) SearchInResponseBody(
	params *network.SearchInResponseBodyParams,
) <-chan *network.SearchInResponseBodyResult

SearchInResponseBody searches for given string in response content.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-searchInResponseBody EXPERIMENTAL.

func (*NetworkProtocol) SetBlockedURLs

func (protocol *NetworkProtocol) SetBlockedURLs(
	params *network.SetBlockedURLsParams,
) <-chan *network.SetBlockedURLsResult

SetBlockedURLs blocks URLs from loading.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setBlockedURLs EXPERIMENTAL.

func (*NetworkProtocol) SetBypassServiceWorker

func (protocol *NetworkProtocol) SetBypassServiceWorker(
	params *network.SetBypassServiceWorkerParams,
) <-chan *network.SetBypassServiceWorkerResult

SetBypassServiceWorker toggles ignoring of service worker for each request.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setBypassServiceWorker EXPERIMENTAL.

func (*NetworkProtocol) SetCacheDisabled

func (protocol *NetworkProtocol) SetCacheDisabled(
	params *network.SetCacheDisabledParams,
) <-chan *network.SetCacheDisabledResult

SetCacheDisabled toggles ignoring cache for each request. If `true`, cache will not be used.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setCacheDisabled

func (*NetworkProtocol) SetCookie

func (protocol *NetworkProtocol) SetCookie(
	params *network.SetCookieParams,
) <-chan *network.SetCookieResult

SetCookie sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setCookie

func (*NetworkProtocol) SetCookies

func (protocol *NetworkProtocol) SetCookies(
	params *network.SetCookiesParams,
) <-chan *network.SetCookiesResult

SetCookies sets given cookies.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setCookies

func (*NetworkProtocol) SetDataSizeLimitsForTest

func (protocol *NetworkProtocol) SetDataSizeLimitsForTest(
	params *network.SetDataSizeLimitsForTestParams,
) <-chan *network.SetDataSizeLimitsForTestResult

SetDataSizeLimitsForTest is for testing.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setDataSizeLimitsForTest EXPERIMENTAL.

func (*NetworkProtocol) SetExtraHTTPHeaders

func (protocol *NetworkProtocol) SetExtraHTTPHeaders(
	params *network.SetExtraHTTPHeadersParams,
) <-chan *network.SetExtraHTTPHeadersResult

SetExtraHTTPHeaders specifies whether to always send extra HTTP headers with the requests from this page.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setExtraHTTPHeaders

func (*NetworkProtocol) SetRequestInterception

func (protocol *NetworkProtocol) SetRequestInterception(
	params *network.SetRequestInterceptionParams,
) <-chan *network.SetRequestInterceptionResult

SetRequestInterception sets the requests to intercept that match a the provided patterns and optionally resource types.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setRequestInterception EXPERIMENTAL.

func (*NetworkProtocol) SetUserAgentOverride

func (protocol *NetworkProtocol) SetUserAgentOverride(
	params *network.SetUserAgentOverrideParams,
) <-chan *network.SetUserAgentOverrideResult

SetUserAgentOverride allows overriding user agent with the given string.

https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setUserAgentOverride

type OverlayProtocol

type OverlayProtocol struct {
	Socket Socketer
}

OverlayProtocol provides a namespace for the Chrome Overlay protocol methods. The Overlay protocol provides various functionality related to drawing atop the inspected page.

https://chromedevtools.github.io/devtools-protocol/tot/Overlay/ EXPERIMENTAL.

func (*OverlayProtocol) Disable

func (protocol *OverlayProtocol) Disable() <-chan *overlay.DisableResult

Disable disables domain notifications.

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

func (*OverlayProtocol) Enable

func (protocol *OverlayProtocol) Enable() <-chan *overlay.EnableResult

Enable enables domain notifications.

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

func (*OverlayProtocol) HideHighlight

func (protocol *OverlayProtocol) HideHighlight() <-chan *overlay.HideHighlightResult

HideHighlight hides any highlight.

https://chromedevtools.github.io/devtools-protocol/tot/Overlay/#method-hideHighlight

func (*OverlayProtocol) HighlightFrame

func (protocol *OverlayProtocol) HighlightFrame(
	params *overlay.HighlightFrameParams,
) <-chan *overlay.HighlightFrameResult

HighlightFrame highlights owner element of the frame with given ID.

https://chromedevtools.github.io/devtools-protocol/tot/Overlay/#method-highlightFrame

func (*OverlayProtocol) HighlightNode

func (protocol *OverlayProtocol) HighlightNode(
	params *overlay.HighlightNodeParams,
) <-chan *overlay.HighlightNodeResult

HighlightNode highlights DOM node with given ID or with the given JavaScript object wrapper. Either nodeID or objectID must be specified.

https://chromedevtools.github.io/devtools-protocol/tot/Overlay/#method-highlightNode

func (*OverlayProtocol) HighlightQuad

func (protocol *OverlayProtocol) HighlightQuad(
	params *overlay.HighlightQuadParams,
) <-chan *overlay.HighlightQuadResult

HighlightQuad highlights given quad. Coordinates are absolute with respect to the main frame viewport.

https://chromedevtools.github.io/devtools-protocol/tot/Overlay/#method-highlightQuad

func (*OverlayProtocol) HighlightRect

func (protocol *OverlayProtocol) HighlightRect(
	params *overlay.HighlightRectParams,
) <-chan *overlay.HighlightRectResult

HighlightRect highlights given rectangle. Coordinates are absolute with respect to the main frame viewport.

https://chromedevtools.github.io/devtools-protocol/tot/Overlay/#method-highlightRect

func (*OverlayProtocol) OnInspectNodeRequested

func (protocol *OverlayProtocol) OnInspectNodeRequested(
	callback func(event *overlay.InspectNodeRequestedEvent),
)

OnInspectNodeRequested adds a handler to the Overlay.inspectNodeRequested event. Overlay.inspectNodeRequested fires when the node should be inspected. This happens after call to `setInspectMode` or when user manually inspects an element.

https://chromedevtools.github.io/devtools-protocol/tot/Overlay/#event-inspectNodeRequested

func (*OverlayProtocol) OnNodeHighlightRequested

func (protocol *OverlayProtocol) OnNodeHighlightRequested(
	callback func(event *overlay.NodeHighlightRequestedEvent),
)

OnNodeHighlightRequested adds a handler to the Overlay.nodeHighlightRequested event. Overlay.nodeHighlightRequested fires when the node should be highlighted. This happens after call to `setInspectMode`.

https://chromedevtools.github.io/devtools-protocol/tot/Overlay/#event-nodeHighlightRequested

func (*OverlayProtocol) OnScreenshotRequested

func (protocol *OverlayProtocol) OnScreenshotRequested(
	callback func(event *overlay.ScreenshotRequestedEvent),
)

OnScreenshotRequested adds a handler to the Overlay.screenshotRequested event. Overlay.screenshotRequested fires when user asks to capture screenshot of some area on the page.

https://chromedevtools.github.io/devtools-protocol/tot/Overlay/#event-screenshotRequested

func (*OverlayProtocol) SetInspectMode

func (protocol *OverlayProtocol) SetInspectMode(
	params *overlay.SetInspectModeParams,
) <-chan *overlay.SetInspectModeResult

SetInspectMode enters the 'inspect' mode. In this mode, elements that user is hovering over are highlighted. Backend then generates 'inspectNodeRequested' event upon element selection.

https://chromedevtools.github.io/devtools-protocol/tot/Overlay/#method-setInspectMode

func (*OverlayProtocol) SetPausedInDebuggerMessage

func (protocol *OverlayProtocol) SetPausedInDebuggerMessage(
	params *overlay.SetPausedInDebuggerMessageParams,
) <-chan *overlay.SetPausedInDebuggerMessageResult

SetPausedInDebuggerMessage sets the paused message

https://chromedevtools.github.io/devtools-protocol/tot/Overlay/#method-setPausedInDebuggerMessage

func (*OverlayProtocol) SetShowDebugBorders

func (protocol *OverlayProtocol) SetShowDebugBorders(
	params *overlay.SetShowDebugBordersParams,
) <-chan *overlay.SetShowDebugBordersResult

SetShowDebugBorders requests that backend shows debug borders on layers.

https://chromedevtools.github.io/devtools-protocol/tot/Overlay/#method-setShowDebugBorders

func (*OverlayProtocol) SetShowFPSCounter

func (protocol *OverlayProtocol) SetShowFPSCounter(
	params *overlay.SetShowFPSCounterParams,
) <-chan *overlay.SetShowFPSCounterResult

SetShowFPSCounter requests that backend shows the FPS counter.

https://chromedevtools.github.io/devtools-protocol/tot/Overlay/#method-setShowFPSCounter

func (*OverlayProtocol) SetShowPaintRects

func (protocol *OverlayProtocol) SetShowPaintRects(
	params *overlay.SetShowPaintRectsParams,
) <-chan *overlay.SetShowPaintRectsResult

SetShowPaintRects that backend shows paint rectangles.

https://chromedevtools.github.io/devtools-protocol/tot/Overlay/#method-setShowPaintRects

func (*OverlayProtocol) SetShowScrollBottleneckRects

func (protocol *OverlayProtocol) SetShowScrollBottleneckRects(
	params *overlay.SetShowScrollBottleneckRectsParams,
) <-chan *overlay.SetShowScrollBottleneckRectsResult

SetShowScrollBottleneckRects requests that backend shows scroll bottleneck rects.

https://chromedevtools.github.io/devtools-protocol/tot/Overlay/#method-setShowScrollBottleneckRects

func (*OverlayProtocol) SetShowViewportSizeOnResize

func (protocol *OverlayProtocol) SetShowViewportSizeOnResize(
	params *overlay.SetShowViewportSizeOnResizeParams,
) <-chan *overlay.SetShowViewportSizeOnResizeResult

SetShowViewportSizeOnResize paints viewport size upon main frame resize.

https://chromedevtools.github.io/devtools-protocol/tot/Overlay/#method-setShowViewportSizeOnResize

func (*OverlayProtocol) SetSuspended

func (protocol *OverlayProtocol) SetSuspended(
	params *overlay.SetSuspendedParams,
) <-chan *overlay.SetSuspendedResult

SetSuspended sets the suspended state

https://chromedevtools.github.io/devtools-protocol/tot/Overlay/#method-setSuspended

type PageProtocol

type PageProtocol struct {
	Socket Socketer
}

PageProtocol provides a namespace for the Chrome Page protocol methods. The Page protocol provides actions and events related to the inspected page belong to the page domain.

https://chromedevtools.github.io/devtools-protocol/tot/Page/

func (*PageProtocol) AddScriptToEvaluateOnLoad

func (protocol *PageProtocol) AddScriptToEvaluateOnLoad(
	params *page.AddScriptToEvaluateOnLoadParams,
) <-chan *page.AddScriptToEvaluateOnLoadResult

AddScriptToEvaluateOnLoad is eprecated, please use addScriptToEvaluateOnNewDocument instead.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-addScriptToEvaluateOnLoad EXPERIMENTAL. DEPRECATED.

func (*PageProtocol) AddScriptToEvaluateOnNewDocument

func (protocol *PageProtocol) AddScriptToEvaluateOnNewDocument(
	params *page.AddScriptToEvaluateOnNewDocumentParams,
) <-chan *page.AddScriptToEvaluateOnNewDocumentResult

AddScriptToEvaluateOnNewDocument evaluates given script in every frame upon creation (before loading frame's scripts).

https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-addScriptToEvaluateOnNewDocument

func (*PageProtocol) BringToFront

func (protocol *PageProtocol) BringToFront() <-chan *page.BringToFrontResult

BringToFront brings page to front (activates tab).

https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-bringToFront

func (*PageProtocol) CaptureScreenshot

func (protocol *PageProtocol) CaptureScreenshot(
	params *page.CaptureScreenshotParams,
) <-chan *page.CaptureScreenshotResult

CaptureScreenshot capture a page screenshot.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-captureScreenshot

func (*PageProtocol) CreateIsolatedWorld

func (protocol *PageProtocol) CreateIsolatedWorld(
	params *page.CreateIsolatedWorldParams,
) <-chan *page.CreateIsolatedWorldResult

CreateIsolatedWorld creates an isolated world for the given frame.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-createIsolatedWorld

func (*PageProtocol) Disable

func (protocol *PageProtocol) Disable() <-chan *page.DisableResult

Disable disables page domain notifications.

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

func (*PageProtocol) Enable

func (protocol *PageProtocol) Enable() <-chan *page.EnableResult

Enable Ennables page domain notifications.

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

func (*PageProtocol) GetAppManifest

func (protocol *PageProtocol) GetAppManifest(
	params *page.GetAppManifestParams,
) <-chan *page.GetAppManifestResult

GetAppManifest gets the app manifest.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-getAppManifest

func (*PageProtocol) GetFrameTree

func (protocol *PageProtocol) GetFrameTree() <-chan *page.GetFrameTreeResult

GetFrameTree returns present frame tree structure.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-getFrameTree

func (*PageProtocol) GetLayoutMetrics

func (protocol *PageProtocol) GetLayoutMetrics() <-chan *page.GetLayoutMetricsResult

GetLayoutMetrics returns metrics relating to the layouting of the page, such as viewport bounds/scale.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-getLayoutMetrics

func (*PageProtocol) GetNavigationHistory

func (protocol *PageProtocol) GetNavigationHistory() <-chan *page.GetNavigationHistoryResult

GetNavigationHistory returns navigation history for the current page.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-getNavigationHistory

func (*PageProtocol) GetResourceContent

func (protocol *PageProtocol) GetResourceContent(
	params *page.GetResourceContentParams,
) <-chan *page.GetResourceContentResult

GetResourceContent returns content of the given resource.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-getResourceContent EXPERIMENTAL.

func (*PageProtocol) GetResourceTree

func (protocol *PageProtocol) GetResourceTree() <-chan *page.GetResourceTreeResult

GetResourceTree returns present frame / resource tree structure.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-getResourceTree EXPERIMENTAL.

func (*PageProtocol) HandleJavaScriptDialog

func (protocol *PageProtocol) HandleJavaScriptDialog(
	params *page.HandleJavaScriptDialogParams,
) <-chan *page.HandleJavaScriptDialogResult

HandleJavaScriptDialog accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).

https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-handleJavaScriptDialog

func (*PageProtocol) Navigate

func (protocol *PageProtocol) Navigate(
	params *page.NavigateParams,
) <-chan *page.NavigateResult

Navigate navigates current page to the given URL.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-navigate

func (*PageProtocol) NavigateToHistoryEntry

func (protocol *PageProtocol) NavigateToHistoryEntry(
	params *page.NavigateToHistoryEntryParams,
) <-chan *page.NavigateToHistoryEntryResult

NavigateToHistoryEntry navigates current page to the given history entry.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-navigateToHistoryEntry

func (*PageProtocol) OnDOMContentEventFired

func (protocol *PageProtocol) OnDOMContentEventFired(
	callback func(event *page.DOMContentEventFiredEvent),
)

OnDOMContentEventFired adds a handler to the Page.domContentEventFired event. Page.domContentEventFired fires when a content event occurs in the DOM.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-domContentEventFired

func (*PageProtocol) OnFrameAttached

func (protocol *PageProtocol) OnFrameAttached(
	callback func(event *page.FrameAttachedEvent),
)

OnFrameAttached adds a handler to the Page.frameAttached event. Page.frameAttached fires when a frame has been attached to its parent.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-frameAttached

func (*PageProtocol) OnFrameClearedScheduledNavigation

func (protocol *PageProtocol) OnFrameClearedScheduledNavigation(
	callback func(event *page.FrameClearedScheduledNavigationEvent),
)

OnFrameClearedScheduledNavigation adds a handler to the Page.frameClearedScheduledNavigation event. Page.frameClearedScheduledNavigation fires when a frame no longer has a scheduled navigation.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-frameClearedScheduledNavigation EXPERIMENTAL.

func (*PageProtocol) OnFrameDetached

func (protocol *PageProtocol) OnFrameDetached(
	callback func(event *page.FrameDetachedEvent),
)

OnFrameDetached adds a handler to the Page.frameDetached event. Page.frameDetached fires when a frame has been detached from its parent.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-frameDetached

func (*PageProtocol) OnFrameNavigated

func (protocol *PageProtocol) OnFrameNavigated(
	callback func(event *page.FrameNavigatedEvent),
)

OnFrameNavigated adds a handler to the Page.frameNavigated event. Page.frameNavigated fires once navigation of the frame has completed. Frame is now associated with the new loader.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-frameNavigated

func (*PageProtocol) OnFrameResized

func (protocol *PageProtocol) OnFrameResized(
	callback func(event *page.FrameResizedEvent),
)

OnFrameResized adds a handler to the Page.frameResized event. Page.frameResized fires when frame is resized.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-frameResized EXPERIMENTAL.

func (*PageProtocol) OnFrameScheduledNavigation

func (protocol *PageProtocol) OnFrameScheduledNavigation(
	callback func(event *page.FrameScheduledNavigationEvent),
)

OnFrameScheduledNavigation adds a handler to the Page.frameScheduledNavigation event. Page.frameScheduledNavigation fires when frame schedules a potential navigation.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-frameScheduledNavigation EXPERIMENTAL.

func (*PageProtocol) OnFrameStartedLoading

func (protocol *PageProtocol) OnFrameStartedLoading(
	callback func(event *page.FrameStartedLoadingEvent),
)

OnFrameStartedLoading adds a handler to the Page.frameStartedLoading event. Page.frameStartedLoading fires when frame has started loading.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-frameStartedLoading EXPERIMENTAL.

func (*PageProtocol) OnFrameStoppedLoading

func (protocol *PageProtocol) OnFrameStoppedLoading(
	callback func(event *page.FrameStoppedLoadingEvent),
)

OnFrameStoppedLoading adds a handler to the Page.frameStoppedLoading event. Page.frameStoppedLoading fires when frame has stopped loading.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-frameStoppedLoading EXPERIMENTAL.

func (*PageProtocol) OnInterstitialHidden

func (protocol *PageProtocol) OnInterstitialHidden(
	callback func(event *page.InterstitialHiddenEvent),
)

OnInterstitialHidden adds a handler to the Page.interstitialHidden event. Page.interstitialHidden fires when interstitial page was hidden.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-interstitialHidden

func (*PageProtocol) OnInterstitialShown

func (protocol *PageProtocol) OnInterstitialShown(
	callback func(event *page.InterstitialShownEvent),
)

OnInterstitialShown adds a handler to the Page.interstitialShown event. Page.interstitialShown fires when interstitial page was shown.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-interstitialShown

func (*PageProtocol) OnJavascriptDialogClosed

func (protocol *PageProtocol) OnJavascriptDialogClosed(
	callback func(event *page.JavascriptDialogClosedEvent),
)

OnJavascriptDialogClosed adds a handler to the Page.javascriptDialogClosed event. Page.javascriptDialogClosed fires when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been closed.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-javascriptDialogClosed

func (*PageProtocol) OnJavascriptDialogOpening

func (protocol *PageProtocol) OnJavascriptDialogOpening(
	callback func(event *page.JavascriptDialogOpeningEvent),
)

OnJavascriptDialogOpening adds a handler to the Page.javascriptDialogOpening event. Page.javascriptDialogOpening fires when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to open.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-javascriptDialogOpening

func (*PageProtocol) OnLifecycleEvent

func (protocol *PageProtocol) OnLifecycleEvent(
	callback func(event *page.LifecycleEventEvent),
)

OnLifecycleEvent adds a handler to the Page.lifecycleEvent event. Page.lifecycleEvent fires for top level page lifecycle events such as navigation, load, paint, etc.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-lifecycleEvent

func (*PageProtocol) OnLoadEventFired

func (protocol *PageProtocol) OnLoadEventFired(
	callback func(event *page.LoadEventFiredEvent),
)

OnLoadEventFired adds a handler to the Page.loadEventFired event. Page.loadEventFired fires when the page has finished loading.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-loadEventFired

func (*PageProtocol) OnScreencastFrame

func (protocol *PageProtocol) OnScreencastFrame(
	callback func(event *page.ScreencastFrameEvent),
)

OnScreencastFrame adds a handler to the Page.screencastFrame event. Page.screencastFrame fires when compressed image data is requested by the `startScreencast` method.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-screencastFrame EXPERIMENTAL.

func (*PageProtocol) OnScreencastVisibilityChanged

func (protocol *PageProtocol) OnScreencastVisibilityChanged(
	callback func(event *page.ScreencastVisibilityChangedEvent),
)

OnScreencastVisibilityChanged adds a handler to the Page.screencastVisibilityChanged event. Page.screencastVisibilityChanged fires when the page with currently enabled screencast was shown or hidden.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-screencastVisibilityChanged EXPERIMENTAL.

func (*PageProtocol) OnWindowOpen

func (protocol *PageProtocol) OnWindowOpen(
	callback func(event *page.WindowOpenEvent),
)

OnWindowOpen adds a handler to the Page.windowOpen event. Page.windowOpen fires when a new window is going to be opened, via window.open(), link click, form submission, etc.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#event-windowOpen

func (*PageProtocol) PrintToPDF

func (protocol *PageProtocol) PrintToPDF(
	params *page.PrintToPDFParams,
) <-chan *page.PrintToPDFResult

PrintToPDF print page as PDF.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-printToPDF

func (*PageProtocol) Reload

func (protocol *PageProtocol) Reload(
	params *page.ReloadParams,
) <-chan *page.ReloadResult

Reload reloads given page optionally ignoring the cache.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-reload

func (*PageProtocol) RemoveScriptToEvaluateOnLoad

func (protocol *PageProtocol) RemoveScriptToEvaluateOnLoad(
	params *page.RemoveScriptToEvaluateOnLoadParams,
) <-chan *page.RemoveScriptToEvaluateOnLoadResult

RemoveScriptToEvaluateOnLoad deprecated, please use removeScriptToEvaluateOnNewDocument instead.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-removeScriptToEvaluateOnLoad EXPERIMENTAL. DEPRECATED.

func (*PageProtocol) RemoveScriptToEvaluateOnNewDocument

func (protocol *PageProtocol) RemoveScriptToEvaluateOnNewDocument(
	params *page.RemoveScriptToEvaluateOnNewDocumentParams,
) <-chan *page.RemoveScriptToEvaluateOnNewDocumentResult

RemoveScriptToEvaluateOnNewDocument removes given script from the list.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-removeScriptToEvaluateOnNewDocument

func (*PageProtocol) RequestAppBanner

func (protocol *PageProtocol) RequestAppBanner() <-chan *page.RequestAppBannerResult

RequestAppBanner is experimental.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-requestAppBanner EXPERIMENTAL.

func (*PageProtocol) ScreencastFrameAck

func (protocol *PageProtocol) ScreencastFrameAck(
	params *page.ScreencastFrameAckParams,
) <-chan *page.ScreencastFrameAckResult

ScreencastFrameAck acknowledges that a screencast frame has been received by the frontend.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-screencastFrameAck EXPERIMENTAL.

func (*PageProtocol) SearchInResource

func (protocol *PageProtocol) SearchInResource(
	params *page.SearchInResourceParams,
) <-chan *page.SearchInResourceResult

SearchInResource searches for given string in resource content.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-searchInResource EXPERIMENTAL.

func (*PageProtocol) SetAdBlockingEnabled

func (protocol *PageProtocol) SetAdBlockingEnabled(
	params *page.SetAdBlockingEnabledParams,
) <-chan *page.SetAdBlockingEnabledResult

SetAdBlockingEnabled enable Chrome's experimental ad filter on all sites.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-setAdBlockingEnabled EXPERIMENTAL.

func (*PageProtocol) SetAutoAttachToCreatedPages

func (protocol *PageProtocol) SetAutoAttachToCreatedPages(
	params *page.SetAutoAttachToCreatedPagesParams,
) <-chan *page.SetAutoAttachToCreatedPagesResult

SetAutoAttachToCreatedPages controls whether browser will open a new inspector window for connected pages.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-setAutoAttachToCreatedPages EXPERIMENTAL.

func (*PageProtocol) SetDocumentContent

func (protocol *PageProtocol) SetDocumentContent(
	params *page.SetDocumentContentParams,
) <-chan *page.SetDocumentContentResult

SetDocumentContent sets given markup as the document's HTML.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-setDocumentContent

func (*PageProtocol) SetDownloadBehavior

func (protocol *PageProtocol) SetDownloadBehavior(
	params *page.SetDownloadBehaviorParams,
) <-chan *page.SetDownloadBehaviorResult

SetDownloadBehavior sets the behavior when downloading a file.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-setDownloadBehavior EXPERIMENTAL.

func (*PageProtocol) SetLifecycleEventsEnabled

func (protocol *PageProtocol) SetLifecycleEventsEnabled(
	params *page.SetLifecycleEventsEnabledParams,
) <-chan *page.SetLifecycleEventsEnabledResult

SetLifecycleEventsEnabled controls whether page will emit lifecycle events.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-setLifecycleEventsEnabled EXPERIMENTAL.

func (*PageProtocol) StartScreencast

func (protocol *PageProtocol) StartScreencast(
	params *page.StartScreencastParams,
) <-chan *page.StartScreencastResult

StartScreencast starts sending each frame using the `screencastFrame` event.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-startScreencast EXPERIMENTAL.

func (*PageProtocol) StopLoading

func (protocol *PageProtocol) StopLoading() <-chan *page.StopLoadingResult

StopLoading force the page stop all navigations and pending resource fetches.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-stopLoading

func (*PageProtocol) StopScreencast

func (protocol *PageProtocol) StopScreencast() <-chan *page.StopScreencastResult

StopScreencast stops sending each frame in the `screencastFrame`.

https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-stopScreencast EXPERIMENTAL.

type Payload

type Payload struct {
	ID     int         `json:"id"`
	Method string      `json:"method"`
	Params interface{} `json:"params"`
}

Payload represents a WebSocket JSON payload for a sending a command to the websocket.

type PerformanceProtocol

type PerformanceProtocol struct {
	Socket Socketer
}

PerformanceProtocol provides a namespace for the Chrome Performance protocol methods.

https://chromedevtools.github.io/devtools-protocol/tot/Performance/

func (*PerformanceProtocol) Disable

func (protocol *PerformanceProtocol) Disable() <-chan *performance.DisableResult

Disable disables collecting and reporting metrics.

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

func (*PerformanceProtocol) Enable

func (protocol *PerformanceProtocol) Enable() <-chan *performance.EnableResult

Enable enables collecting and reporting metrics.

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

func (*PerformanceProtocol) GetMetrics

func (protocol *PerformanceProtocol) GetMetrics() <-chan *performance.GetMetricsResult

GetMetrics retrieves current values of run-time metrics.

https://chromedevtools.github.io/devtools-protocol/tot/Performance/#method-getMetrics

func (*PerformanceProtocol) OnMetrics

func (protocol *PerformanceProtocol) OnMetrics(
	callback func(event *performance.MetricsEvent),
)

OnMetrics adds a handler to the Performance.metrics event. Performance.metrics returns current values of the metrics.

https://chromedevtools.github.io/devtools-protocol/tot/Performance/#event-metrics

type ProfilerProtocol

type ProfilerProtocol struct {
	Socket Socketer
}

ProfilerProtocol provides a namespace for the Chrome Profiler protocol methods.

https://chromedevtools.github.io/devtools-protocol/tot/Profiler/

func (*ProfilerProtocol) Disable

func (protocol *ProfilerProtocol) Disable() <-chan *profiler.DisableResult

Disable disables profiling.

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

func (*ProfilerProtocol) Enable

func (protocol *ProfilerProtocol) Enable() <-chan *profiler.EnableResult

Enable enables profiling.

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

func (*ProfilerProtocol) GetBestEffortCoverage

func (protocol *ProfilerProtocol) GetBestEffortCoverage() <-chan *profiler.GetBestEffortCoverageResult

GetBestEffortCoverage collects coverage data for the current isolate. The coverage data may be incomplete due to garbage collection.

https://chromedevtools.github.io/devtools-protocol/tot/Profiler/#method-getBestEffortCoverage

func (*ProfilerProtocol) OnConsoleProfileFinished

func (protocol *ProfilerProtocol) OnConsoleProfileFinished(
	callback func(event *profiler.ConsoleProfileFinishedEvent),
)

OnConsoleProfileFinished adds a handler to the Profiler.consoleProfileFinished event. Profiler.consoleProfileFinished fires when profile recording finishes.

https://chromedevtools.github.io/devtools-protocol/tot/Profiler/#event-consoleProfileFinished

func (*ProfilerProtocol) OnConsoleProfileStarted

func (protocol *ProfilerProtocol) OnConsoleProfileStarted(
	callback func(event *profiler.ConsoleProfileStartedEvent),
)

OnConsoleProfileStarted adds a handler to the Profiler.consoleProfileStarted event. Profiler.consoleProfileStarted fires when new profile recording is started using console.profile() call.

https://chromedevtools.github.io/devtools-protocol/tot/Profiler/#event-consoleProfileStarted

func (*ProfilerProtocol) SetSamplingInterval

func (protocol *ProfilerProtocol) SetSamplingInterval(
	params *profiler.SetSamplingIntervalParams,
) <-chan *profiler.SetSamplingIntervalResult

SetSamplingInterval changes CPU profiler sampling interval. Must be called before CPU profiles recording started.

https://chromedevtools.github.io/devtools-protocol/tot/Profiler/#method-setSamplingInterval

func (*ProfilerProtocol) Start

func (protocol *ProfilerProtocol) Start() <-chan *profiler.StartResult

Start starts profiling.

https://chromedevtools.github.io/devtools-protocol/tot/Profiler/#method-start

func (*ProfilerProtocol) StartPreciseCoverage

func (protocol *ProfilerProtocol) StartPreciseCoverage(
	params *profiler.StartPreciseCoverageParams,
) <-chan *profiler.StartPreciseCoverageResult

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.

https://chromedevtools.github.io/devtools-protocol/tot/Profiler/#method-startPreciseCoverage

func (*ProfilerProtocol) StartTypeProfile

func (protocol *ProfilerProtocol) StartTypeProfile() <-chan *profiler.StartTypeProfileResult

StartTypeProfile enables type profile.

https://chromedevtools.github.io/devtools-protocol/tot/Profiler/#method-startTypeProfile EXPERIMENTAL.

func (*ProfilerProtocol) Stop

func (protocol *ProfilerProtocol) Stop() <-chan *profiler.StopResult

Stop stops profiling.

https://chromedevtools.github.io/devtools-protocol/tot/Profiler/#method-stop

func (*ProfilerProtocol) StopPreciseCoverage

func (protocol *ProfilerProtocol) StopPreciseCoverage() <-chan *profiler.StopPreciseCoverageResult

StopPreciseCoverage disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code.

https://chromedevtools.github.io/devtools-protocol/tot/Profiler/#method-stopPreciseCoverage

func (*ProfilerProtocol) StopTypeProfile

func (protocol *ProfilerProtocol) StopTypeProfile() <-chan *profiler.StopTypeProfileResult

StopTypeProfile disables type profile. Disabling releases type profile data collected so far.

https://chromedevtools.github.io/devtools-protocol/tot/Profiler/#method-stopTypeProfile EXPERIMENTAL.

func (*ProfilerProtocol) TakePreciseCoverage

func (protocol *ProfilerProtocol) TakePreciseCoverage() <-chan *profiler.TakePreciseCoverageResult

TakePreciseCoverage collects coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started.

https://chromedevtools.github.io/devtools-protocol/tot/Profiler/#method-takePreciseCoverage

func (*ProfilerProtocol) TakeTypeProfile

func (protocol *ProfilerProtocol) TakeTypeProfile() <-chan *profiler.TakeTypeProfileResult

TakeTypeProfile collect type profile.

https://chromedevtools.github.io/devtools-protocol/tot/Profiler/#method-takeTypeProfile EXPERIMENTAL.

type Protocoller

type Protocoller interface {
	// Accessibility returns the AccessibilityProtocol instance.
	Accessibility() *AccessibilityProtocol

	// Animation returns the AnimationProtocol instance.
	Animation() *AnimationProtocol

	// ApplicationCache returns the ApplicationCacheProtocol instance.
	ApplicationCache() *ApplicationCacheProtocol

	// Audits returns the AuditsProtocol instance.
	Audits() *AuditsProtocol

	// Browser returns the BrowserProtocol instance.
	Browser() *BrowserProtocol

	// CacheStorage returns the CacheStorageProtocol instance.
	CacheStorage() *CacheStorageProtocol

	// Console returns the ConsoleProtocol instance.
	Console() *ConsoleProtocol

	// CSS returns the CSSProtocol instance.
	CSS() *CSSProtocol

	// Database returns the DatabaseProtocol instance.
	Database() *DatabaseProtocol

	// Debugger returns the DebuggerProtocol instance.
	Debugger() *DebuggerProtocol

	// DeviceOrientation returns the DeviceOrientationProtocol instance.
	DeviceOrientation() *DeviceOrientationProtocol

	// DOMDebugger returns the DOMDebuggerProtocol instance.
	DOMDebugger() *DOMDebuggerProtocol

	// DOMSnapshot returns the DOMSnapshotProtocol instance.
	DOMSnapshot() *DOMSnapshotProtocol

	// DOMStorage returns the DOMStorageProtocol instance.
	DOMStorage() *DOMStorageProtocol

	// DOM returns the DOMProtocol instance.
	DOM() *DOMProtocol

	// Emulation returns the EmulationProtocol instance.
	Emulation() *EmulationProtocol

	// HeadlessExperimental returns the HeadlessExperimentalProtocol instance.
	HeadlessExperimental() *HeadlessExperimentalProtocol

	// HeapProfiler returns the HeapProfilerProtocol instance.
	HeapProfiler() *HeapProfilerProtocol

	// IndexedDB returns the IndexedDBProtocol instance.
	IndexedDB() *IndexedDBProtocol

	// Input returns the InputProtocol instance.
	Input() *InputProtocol

	// IO returns the IOProtocol instance.
	IO() *IOProtocol

	// LayerTree returns the LayerTreeProtocol instance.
	LayerTree() *LayerTreeProtocol

	// Log returns the LogProtocol instance.
	Log() *LogProtocol

	// Memory returns the MemoryProtocol instance.
	Memory() *MemoryProtocol

	// Network returns the NetworkProtocol instance.
	Network() *NetworkProtocol

	// Overlay returns the OverlayProtocol instance.
	Overlay() *OverlayProtocol

	// Page returns the PageProtocol instance.
	Page() *PageProtocol

	// Performance returns the PerformanceProtocol instance.
	Performance() *PerformanceProtocol

	// Profiler returns the ProfilerProtocol instance.
	Profiler() *ProfilerProtocol

	// Runtime returns the RuntimeProtocol instance.
	Runtime() *RuntimeProtocol

	// Schema returns the SchemaProtocol instance.
	Schema() *SchemaProtocol

	// Security returns the SecurityProtocol instance.
	Security() *SecurityProtocol

	// ServiceWorker returns the ServiceWorkerProtocol instance.
	ServiceWorker() *ServiceWorkerProtocol

	// Storage returns the StorageProtocol instance.
	Storage() *StorageProtocol

	// SystemInfo returns the SystemInfoProtocol instance.
	SystemInfo() *SystemInfoProtocol

	// Target returns the TargetProtocol instance.
	Target() *TargetProtocol

	// Tethering returns the TetheringProtocol instance.
	Tethering() *TetheringProtocol

	// Tracing returns the TracingProtocol instance.
	Tracing() *TracingProtocol
}

Protocoller defines the Chrome DevTools Protocol API methods

https://chromedevtools.github.io/devtools-protocol/

type Response

type Response struct {
	Error  *Error          `json:"error"`
	ID     int             `json:"id"`
	Method string          `json:"method"`
	Params json.RawMessage `json:"params"`
	Result json.RawMessage `json:"result"`
}

Response represents a socket message.

type RuntimeProtocol

type RuntimeProtocol struct {
	Socket Socketer
}

RuntimeProtocol provides a namespace for the Chrome Runtime protocol methods. The Runtime protocol exposes JavaScript runtime by means of remote evaluation and mirror objects. Evaluation results are returned as mirror object that expose object type, string representation and unique identifier that can be used for further object reference. Original objects are maintained in memory unless they are either explicitly released or are released along with the other objects in their object group.

https://chromedevtools.github.io/devtools-protocol/tot/Runtime/

func (*RuntimeProtocol) AwaitPromise

func (protocol *RuntimeProtocol) AwaitPromise(
	params *runtime.AwaitPromiseParams,
) <-chan *runtime.AwaitPromiseResult

AwaitPromise adds handler to promise with given promise object ID.

https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#method-awaitPromise

func (*RuntimeProtocol) CallFunctionOn

func (protocol *RuntimeProtocol) CallFunctionOn(
	params *runtime.CallFunctionOnParams,
) <-chan *runtime.CallFunctionOnResult

CallFunctionOn calls a function with given declaration on the given object. Object group of the result is inherited from the target object.

https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#method-callFunctionOn

func (*RuntimeProtocol) CompileScript

func (protocol *RuntimeProtocol) CompileScript(
	params *runtime.CompileScriptParams,
) <-chan *runtime.CompileScriptResult

CompileScript compiles an expression.

https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#method-compileScript

func (*RuntimeProtocol) Disable

func (protocol *RuntimeProtocol) Disable() <-chan *runtime.DisableResult

Disable disables reporting of execution contexts creation.

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

func (*RuntimeProtocol) DiscardConsoleEntries

func (protocol *RuntimeProtocol) DiscardConsoleEntries() <-chan *runtime.DiscardConsoleEntriesResult

DiscardConsoleEntries discards collected exceptions and console API calls.

https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#method-discardConsoleEntries

func (*RuntimeProtocol) Enable

func (protocol *RuntimeProtocol) Enable() <-chan *runtime.EnableResult

Enable enables reporting of execution contexts creation by means of the Runtime.executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context.

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

func (*RuntimeProtocol) Evaluate

func (protocol *RuntimeProtocol) Evaluate(
	params *runtime.EvaluateParams,
) <-chan *runtime.EvaluateResult

Evaluate evaluates expression on global object.

https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#method-evaluate

func (*RuntimeProtocol) GetProperties

func (protocol *RuntimeProtocol) GetProperties(
	params *runtime.GetPropertiesParams,
) <-chan *runtime.GetPropertiesResult

GetProperties returns properties of a given object. Object group of the result is inherited from the target object.

https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#method-getProperties

func (*RuntimeProtocol) GlobalLexicalScopeNames

func (protocol *RuntimeProtocol) GlobalLexicalScopeNames(
	params *runtime.GlobalLexicalScopeNamesParams,
) <-chan *runtime.GlobalLexicalScopeNamesResult

GlobalLexicalScopeNames returns all let, const and class variables from global scope.

https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#method-globalLexicalScopeNames

func (*RuntimeProtocol) OnConsoleAPICalled

func (protocol *RuntimeProtocol) OnConsoleAPICalled(
	callback func(event *runtime.ConsoleAPICalledEvent),
)

OnConsoleAPICalled adds a handler to the Runtime.consoleAPICalled event. Runtime.consoleAPICalled fires when the console API is called.

https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#event-consoleAPICalled

func (*RuntimeProtocol) OnExceptionRevoked

func (protocol *RuntimeProtocol) OnExceptionRevoked(
	callback func(event *runtime.ExceptionRevokedEvent),
)

OnExceptionRevoked adds a handler to the Runtime.exceptionRevoked event. Runtime.exceptionRevoked fires when an unhandled exception is revoked.

https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#event-exceptionRevoked

func (*RuntimeProtocol) OnExceptionThrown

func (protocol *RuntimeProtocol) OnExceptionThrown(
	callback func(event *runtime.ExceptionThrownEvent),
)

OnExceptionThrown adds a handler to the Runtime.exceptionThrown event. Runtime.exceptionThrown fires when an exception is thrown and is unhandled.

https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#event-exceptionThrown

func (*RuntimeProtocol) OnExecutionContextCreated

func (protocol *RuntimeProtocol) OnExecutionContextCreated(
	callback func(event *runtime.ExecutionContextCreatedEvent),
)

OnExecutionContextCreated adds a handler to the Runtime.executionContextCreated event. Runtime.executionContextCreated fires when a new execution context is created.

https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#event-executionContextCreated

func (*RuntimeProtocol) OnExecutionContextDestroyed

func (protocol *RuntimeProtocol) OnExecutionContextDestroyed(
	callback func(event *runtime.ExecutionContextDestroyedEvent),
)

OnExecutionContextDestroyed adds a handler to the Runtime.executionContextDestroyed event. Runtime.executionContextDestroyed fires when execution context is destroyed.

https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#event-executionContextDestroyed

func (*RuntimeProtocol) OnExecutionContextsCleared

func (protocol *RuntimeProtocol) OnExecutionContextsCleared(
	callback func(event *runtime.ExecutionContextsClearedEvent),
)

OnExecutionContextsCleared adds a handler to the Runtime.executionContextsCleared event. Runtime.executionContextsCleared fires when all executionContexts were cleared in browser.

https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#event-executionContextsCleared

func (*RuntimeProtocol) OnInspectRequested

func (protocol *RuntimeProtocol) OnInspectRequested(
	callback func(event *runtime.InspectRequestedEvent),
)

OnInspectRequested adds a handler to the Runtime.inspectRequested event. Runtime.inspectRequested fires when an object should be inspected (for example, as a result of inspect() command line API call).

https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#event-inspectRequested

func (*RuntimeProtocol) QueryObjects

func (protocol *RuntimeProtocol) QueryObjects(
	params *runtime.QueryObjectsParams,
) <-chan *runtime.QueryObjectsResult

QueryObjects returns objects for a given prototype ID.

https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#method-queryObjects

func (*RuntimeProtocol) ReleaseObject

func (protocol *RuntimeProtocol) ReleaseObject(
	params *runtime.ReleaseObjectParams,
) <-chan *runtime.ReleaseObjectResult

ReleaseObject releases remote object with given id.

https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#method-releaseObject

func (*RuntimeProtocol) ReleaseObjectGroup

func (protocol *RuntimeProtocol) ReleaseObjectGroup(
	params *runtime.ReleaseObjectGroupParams,
) <-chan *runtime.ReleaseObjectGroupResult

ReleaseObjectGroup releases all remote objects that belong to a given group.

https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#method-releaseObjectGroup

func (*RuntimeProtocol) RunIfWaitingForDebugger

func (protocol *RuntimeProtocol) RunIfWaitingForDebugger() <-chan *runtime.RunIfWaitingForDebuggerResult

RunIfWaitingForDebugger tells inspected instance to run if it was waiting for debugger to attach.

https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#method-runIfWaitingForDebugger

func (*RuntimeProtocol) RunScript

func (protocol *RuntimeProtocol) RunScript(
	params *runtime.RunScriptParams,
) <-chan *runtime.RunScriptResult

RunScript runs the script with given ID in a given context.

https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#method-runScript

func (*RuntimeProtocol) SetCustomObjectFormatterEnabled

func (protocol *RuntimeProtocol) SetCustomObjectFormatterEnabled(
	params *runtime.SetCustomObjectFormatterEnabledParams,
) <-chan *runtime.SetCustomObjectFormatterEnabledResult

SetCustomObjectFormatterEnabled is experimental.

https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#method-setCustomObjectFormatterEnabled EXPERIMENTAL.

type SchemaProtocol

type SchemaProtocol struct {
	Socket Socketer
}

SchemaProtocol provides a namespace for the Chrome Schema protocol methods.

https://chromedevtools.github.io/devtools-protocol/tot/Schema/ DEPRECATED.

func (*SchemaProtocol) GetDomains

func (protocol *SchemaProtocol) GetDomains() <-chan *schema.GetDomainsResult

GetDomains returns supported domains.

https://chromedevtools.github.io/devtools-protocol/tot/Schema/#method-getDomains

type SecurityProtocol

type SecurityProtocol struct {
	Socket Socketer
}

SecurityProtocol provides a namespace for the Chrome Security protocol methods.

https://chromedevtools.github.io/devtools-protocol/tot/Security/

func (*SecurityProtocol) Disable

func (protocol *SecurityProtocol) Disable() <-chan *security.DisableResult

Disable disables tracking security state changes.

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

func (*SecurityProtocol) Enable

func (protocol *SecurityProtocol) Enable() <-chan *security.EnableResult

Enable tracking security state changes.

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

func (*SecurityProtocol) HandleCertificateError

func (protocol *SecurityProtocol) HandleCertificateError(
	params *security.HandleCertificateErrorParams,
) <-chan *security.HandleCertificateErrorResult

HandleCertificateError handles a certificate error that fired a certificateError event.

https://chromedevtools.github.io/devtools-protocol/tot/Security/#method-handleCertificateError

func (*SecurityProtocol) OnCertificateError

func (protocol *SecurityProtocol) OnCertificateError(
	callback func(event *security.CertificateErrorEvent),
)

OnCertificateError adds a handler to the Security.certificateError event. Security.certificateError fires when 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.

https://chromedevtools.github.io/devtools-protocol/tot/Security/#event-certificateError

func (*SecurityProtocol) OnSecurityStateChanged

func (protocol *SecurityProtocol) OnSecurityStateChanged(
	callback func(event *security.StateChangedEvent),
)

OnSecurityStateChanged adds a handler to the Security.StateChanged event. Security.StateChanged fires when the security state of the page changed.

https://chromedevtools.github.io/devtools-protocol/tot/Security/#event-securityStateChanged

func (*SecurityProtocol) SetIgnoreCertificateErrors

func (protocol *SecurityProtocol) SetIgnoreCertificateErrors(
	params *security.SetIgnoreCertificateErrorsParams,
) <-chan *security.SetIgnoreCertificateErrorsResult

SetIgnoreCertificateErrors enables/disables whether all certificate errors should be ignored.

https://chromedevtools.github.io/devtools-protocol/tot/Security/#method-setIgnoreCertificateErrors EXPERIMENTAL.

func (*SecurityProtocol) SetOverrideCertificateErrors

func (protocol *SecurityProtocol) SetOverrideCertificateErrors(
	params *security.SetOverrideCertificateErrorsParams,
) <-chan *security.SetOverrideCertificateErrorsResult

SetOverrideCertificateErrors enables/disables overriding certificate errors. If enabled, all certificate error events need to be handled by the DevTools client and should be answered with HandleCertificateError commands.

https://chromedevtools.github.io/devtools-protocol/tot/Security/#method-setOverrideCertificateErrors

type ServiceWorkerProtocol

type ServiceWorkerProtocol struct {
	Socket Socketer
}

ServiceWorkerProtocol provides a namespace for the Chrome ServiceWorker protocol methods.

https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/ EXPERIMENTAL.

func (*ServiceWorkerProtocol) DeliverPushMessage

func (protocol *ServiceWorkerProtocol) DeliverPushMessage(
	params *worker.DeliverPushMessageParams,
) <-chan *worker.DeliverPushMessageResult

DeliverPushMessage is experimental.

https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-deliverPushMessage EXPERIMENTAL.

func (*ServiceWorkerProtocol) Disable

func (protocol *ServiceWorkerProtocol) Disable() <-chan *worker.DisableResult

Disable is experimental.

https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-disable EXPERIMENTAL.

func (*ServiceWorkerProtocol) DispatchSyncEvent

func (protocol *ServiceWorkerProtocol) DispatchSyncEvent(
	params *worker.DispatchSyncEventParams,
) <-chan *worker.DispatchSyncEventResult

DispatchSyncEvent is experimental.

https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-dispatchSyncEvent EXPERIMENTAL.

func (*ServiceWorkerProtocol) Enable

func (protocol *ServiceWorkerProtocol) Enable() <-chan *worker.EnableResult

Enable is experimental.

https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-enable EXPERIMENTAL.

func (*ServiceWorkerProtocol) InspectWorker

func (protocol *ServiceWorkerProtocol) InspectWorker(
	params *worker.InspectWorkerParams,
) <-chan *worker.InspectWorkerResult

InspectWorker is experimental.

https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-inspectWorker EXPERIMENTAL.

func (*ServiceWorkerProtocol) OnWorkerErrorReported

func (protocol *ServiceWorkerProtocol) OnWorkerErrorReported(
	callback func(event *worker.ErrorReportedEvent),
)

OnWorkerErrorReported is experimental.

https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#event-workerErrorReported EXPERIMENTAL.

func (*ServiceWorkerProtocol) OnWorkerRegistrationUpdated

func (protocol *ServiceWorkerProtocol) OnWorkerRegistrationUpdated(
	callback func(event *worker.RegistrationUpdatedEvent),
)

OnWorkerRegistrationUpdated is experimental.

https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#event-workerRegistrationUpdated EXPERIMENTAL.

func (*ServiceWorkerProtocol) OnWorkerVersionUpdated

func (protocol *ServiceWorkerProtocol) OnWorkerVersionUpdated(
	callback func(event *worker.VersionUpdatedEvent),
)

OnWorkerVersionUpdated is experimental.

https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#event-workerVersionUpdated EXPERIMENTAL.

func (*ServiceWorkerProtocol) SetForceUpdateOnPageLoad

func (protocol *ServiceWorkerProtocol) SetForceUpdateOnPageLoad(
	params *worker.SetForceUpdateOnPageLoadParams,
) <-chan *worker.SetForceUpdateOnPageLoadResult

SetForceUpdateOnPageLoad is experimental.

https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-setForceUpdateOnPageLoad EXPERIMENTAL.

func (*ServiceWorkerProtocol) SkipWaiting

func (protocol *ServiceWorkerProtocol) SkipWaiting(
	params *worker.SkipWaitingParams,
) <-chan *worker.SkipWaitingResult

SkipWaiting is experimental.

https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-skipWaiting EXPERIMENTAL.

func (*ServiceWorkerProtocol) StartWorker

func (protocol *ServiceWorkerProtocol) StartWorker(
	params *worker.StartWorkerParams,
) <-chan *worker.StartWorkerResult

StartWorker is experimental.

https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-startWorker EXPERIMENTAL.

func (*ServiceWorkerProtocol) StopAllWorkers

func (protocol *ServiceWorkerProtocol) StopAllWorkers() <-chan *worker.StopAllWorkersResult

StopAllWorkers is experimental.

https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-stopAllWorkers EXPERIMENTAL.

func (*ServiceWorkerProtocol) StopWorker

func (protocol *ServiceWorkerProtocol) StopWorker(
	params *worker.StopWorkerParams,
) <-chan *worker.StopWorkerResult

StopWorker is experimental.

https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-stopWorker EXPERIMENTAL.

func (*ServiceWorkerProtocol) Unregister

func (protocol *ServiceWorkerProtocol) Unregister(
	params *worker.UnregisterParams,
) <-chan *worker.UnregisterResult

Unregister is experimental.

https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-unregister EXPERIMENTAL.

func (*ServiceWorkerProtocol) UpdateRegistration

func (protocol *ServiceWorkerProtocol) UpdateRegistration(
	params *worker.UpdateRegistrationParams,
) <-chan *worker.UpdateRegistrationResult

UpdateRegistration is experimental.

https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-updateRegistration EXPERIMENTAL.

type Socket

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

Socket is a Socketer implementation.

func New

func New(url *url.URL) *Socket

New returns a pointer to a websocket struct that implements Socketer interface listening to the specified URL.

func (*Socket) Accessibility

func (socket *Socket) Accessibility() *AccessibilityProtocol

Accessibility returns the AccessibilityProtocol instance.

Accessibility is a Protocoller implementation.

func (*Socket) AddEventHandler

func (socket *Socket) AddEventHandler(
	handler EventHandler,
)

AddEventHandler adds an event handler to the stack of listeners for an event.

AddEventHandler is a Socketer implementation.

func (*Socket) Animation

func (socket *Socket) Animation() *AnimationProtocol

Animation returns the AnimationProtocol instance.

Animation is a Protocoller implementation.

func (*Socket) ApplicationCache

func (socket *Socket) ApplicationCache() *ApplicationCacheProtocol

ApplicationCache returns the ApplicationCacheProtocol instance.

ApplicationCache is a Protocoller implementation.

func (*Socket) Audits

func (socket *Socket) Audits() *AuditsProtocol

Audits returns the AuditsProtocol instance.

Audits is a Protocoller implementation.

func (*Socket) Browser

func (socket *Socket) Browser() *BrowserProtocol

Browser returns the BrowserProtocol instance.

Browser is a Protocoller implementation.

func (*Socket) CSS

func (socket *Socket) CSS() *CSSProtocol

CSS returns the CSSProtocol instance.

CSS is a Protocoller implementation.

func (*Socket) CacheStorage

func (socket *Socket) CacheStorage() *CacheStorageProtocol

CacheStorage returns the CacheStorageProtocol instance.

CacheStorage is a Protocoller implementation.

func (*Socket) Conn

func (socket *Socket) Conn() WebSocketer

Conn returns the current web socket pointer.

Conn is a Conner implementation.

func (*Socket) Connect

func (socket *Socket) Connect() error

Connect establishes a websocket connection.

Connect is a Conner implementation.

func (*Socket) Connected

func (socket *Socket) Connected() bool

Connected returns whether a connection exists.

Connected is a Conner implementation.

func (*Socket) Console

func (socket *Socket) Console() *ConsoleProtocol

Console returns the ConsoleProtocol instance.

Console is a Protocoller implementation.

func (*Socket) CurCommandID

func (socket *Socket) CurCommandID() int

CurCommandID returns the latest command ID.

CurCommandID is a Socketer implementation.

func (*Socket) DOM

func (socket *Socket) DOM() *DOMProtocol

DOM returns the DOMProtocol instance.

DOM is a Protocoller implementation.

func (*Socket) DOMDebugger

func (socket *Socket) DOMDebugger() *DOMDebuggerProtocol

DOMDebugger returns the DOMDebuggerProtocol instance.

DOMDebugger is a Protocoller implementation.

func (*Socket) DOMSnapshot

func (socket *Socket) DOMSnapshot() *DOMSnapshotProtocol

DOMSnapshot returns the DOMSnapshotProtocol instance.

DOMSnapshot is a Protocoller implementation.

func (*Socket) DOMStorage

func (socket *Socket) DOMStorage() *DOMStorageProtocol

DOMStorage returns the DOMStorageProtocol instance.

DOMStorage is a Protocoller implementation.

func (*Socket) Database

func (socket *Socket) Database() *DatabaseProtocol

Database returns the DatabaseProtocol instance.

Database is a Protocoller implementation.

func (*Socket) Debugger

func (socket *Socket) Debugger() *DebuggerProtocol

Debugger returns the DebuggerProtocol instance.

Debugger is a Protocoller implementation.

func (*Socket) DeviceOrientation

func (socket *Socket) DeviceOrientation() *DeviceOrientationProtocol

DeviceOrientation returns the DeviceOrientationProtocol instance.

DeviceOrientation is a Protocoller implementation.

func (*Socket) Disconnect

func (socket *Socket) Disconnect() error

Disconnect closes a websocket connection.

Disconnect is a Conner implementation.

func (*Socket) Emulation

func (socket *Socket) Emulation() *EmulationProtocol

Emulation returns the EmulationProtocol instance.

Emulation is a Protocoller implementation.

func (*Socket) HeadlessExperimental

func (socket *Socket) HeadlessExperimental() *HeadlessExperimentalProtocol

HeadlessExperimental returns the HeadlessExperimentalProtocol instance.

HeadlessExperimental is a Protocoller implementation.

func (*Socket) HeapProfiler

func (socket *Socket) HeapProfiler() *HeapProfilerProtocol

HeapProfiler returns the HeapProfilerProtocol instance.

HeapProfiler is a Protocoller implementation.

func (*Socket) IO

func (socket *Socket) IO() *IOProtocol

IO returns the IOProtocol instance.

IO is a Protocoller implementation.

func (*Socket) IndexedDB

func (socket *Socket) IndexedDB() *IndexedDBProtocol

IndexedDB returns the IndexedDBProtocol instance.

IndexedDB is a Protocoller implementation.

func (*Socket) Input

func (socket *Socket) Input() *InputProtocol

Input returns the InputProtocol instance.

Input is a Protocoller implementation.

func (*Socket) LayerTree

func (socket *Socket) LayerTree() *LayerTreeProtocol

LayerTree returns the LayerTreeProtocol instance.

LayerTree is a Protocoller implementation.

func (*Socket) Listen

func (socket *Socket) Listen()

Listen starts the socket read loop and delivers messages to handleResponse() and handleEvent() as appropriate.

Listen is a Socketer implementation.

func (*Socket) Log

func (socket *Socket) Log() *LogProtocol

Log returns the LogProtocol instance.

Log is a Protocoller implementation.

func (*Socket) Memory

func (socket *Socket) Memory() *MemoryProtocol

Memory returns the MemoryProtocol instance.

Memory is a Protocoller implementation.

func (*Socket) Network

func (socket *Socket) Network() *NetworkProtocol

Network returns the NetworkProtocol instance.

Network is a Protocoller implementation.

func (*Socket) NextCommandID

func (socket *Socket) NextCommandID() int

NextCommandID generates and returns the next command ID.

NextCommandID is a Socketer implementation.

func (*Socket) Overlay

func (socket *Socket) Overlay() *OverlayProtocol

Overlay returns the OverlayProtocol instance.

Overlay is a Protocoller implementation.

func (*Socket) Page

func (socket *Socket) Page() *PageProtocol

Page returns the PageProtocol instance.

Page is a Protocoller implementation.

func (*Socket) Performance

func (socket *Socket) Performance() *PerformanceProtocol

Performance returns the PerformanceProtocol instance.

Performance is a Protocoller implementation.

func (*Socket) Profiler

func (socket *Socket) Profiler() *ProfilerProtocol

Profiler returns the ProfilerProtocol instance.

Profiler is a Protocoller implementation.

func (*Socket) ReadJSON

func (socket *Socket) ReadJSON(v interface{}) error

ReadJSON reads data from a websocket connection.

ReadJSON is a Conner implementation.

func (*Socket) RemoveEventHandler

func (socket *Socket) RemoveEventHandler(
	handler EventHandler,
) error

RemoveEventHandler removes a handler from the stack of listeners for an event.

RemoveEventHandler is a Socketer implementation.

func (*Socket) Runtime

func (socket *Socket) Runtime() *RuntimeProtocol

Runtime returns the RuntimeProtocol instance.

Runtime is a Protocoller implementation.

func (*Socket) Schema

func (socket *Socket) Schema() *SchemaProtocol

Schema returns the SchemaProtocol instance.

Schema is a Protocoller implementation.

func (*Socket) Security

func (socket *Socket) Security() *SecurityProtocol

Security returns the SecurityProtocol instance.

Security is a Protocoller implementation.

func (*Socket) SendCommand

func (socket *Socket) SendCommand(command Commander) chan *Response

SendCommand delivers a command payload to the websocket connection.

SendCommand is a Socketer implementation.

Workflow:

  1. The socket's command mutex is locked.
  2. The command counter is incremented.
  3. The payload is sent to the socket connection and the mutex is unlocked.
  4. The command is stored using the generated ID.
  5. When the command has been executed and the socket responds, socket.HandleCmd() is triggered from the command instance to generate the response and the command unlocks itself.

func (*Socket) ServiceWorker

func (socket *Socket) ServiceWorker() *ServiceWorkerProtocol

ServiceWorker returns the ServiceWorkerProtocol instance.

ServiceWorker is a Protocoller implementation.

func (*Socket) Stop

func (socket *Socket) Stop() error

Stop signals the socket read loop to stop listening for data and close the websocket connection.

Stop is a Socketer implementation.

func (*Socket) Storage

func (socket *Socket) Storage() *StorageProtocol

Storage returns the StorageProtocol instance.

Storage is a Protocoller implementation.

func (*Socket) SystemInfo

func (socket *Socket) SystemInfo() *SystemInfoProtocol

SystemInfo returns the SystemInfoProtocol instance.

SystemInfo is a Protocoller implementation.

func (*Socket) Target

func (socket *Socket) Target() *TargetProtocol

Target returns the TargetProtocol instance.

Target is a Protocoller implementation.

func (*Socket) Tethering

func (socket *Socket) Tethering() *TetheringProtocol

Tethering returns the TetheringProtocol instance.

Tethering is a Protocoller implementation.

func (*Socket) Tracing

func (socket *Socket) Tracing() *TracingProtocol

Tracing returns the TracingProtocol instance.

Tracing is a Protocoller implementation.

func (*Socket) URL

func (socket *Socket) URL() *url.URL

URL returns the URL of the websocket connection.

URL is a Socketer implementation.

func (*Socket) WriteJSON

func (socket *Socket) WriteJSON(v interface{}) error

WriteJSON writes data to a websocket connection.

WriteJSON is a Conner implementation.

type Socketer

type Socketer interface {
	// AddEventHandler adds an event handler to the stack of listeners for an
	// event.
	AddEventHandler(handler EventHandler)

	// CurCommandID returns the latest command ID.
	CurCommandID() int

	// Listen starts the socket read loop and delivers messages to
	// HandleCommand() and HandleEvent() as appropriate.
	Listen()

	// NextCommandID generates and returns the next command ID.
	NextCommandID() int

	// RemoveEventHandler removes a handler from the stack of listeners for an
	// event.
	RemoveEventHandler(handler EventHandler) error

	// SendCommand delivers a command payload to the websocket connection.
	SendCommand(command Commander) chan *Response

	// Stop signals the socket read loop to stop listening for data and close
	// the websocket connection.
	Stop() error

	// URL returns the URL of the websocket connection.
	URL() *url.URL
}

Socketer defines the websocket connection interface for managing sockets.

type StorageProtocol

type StorageProtocol struct {
	Socket Socketer
}

StorageProtocol provides a namespace for the Chrome Storage protocol methods.

https://chromedevtools.github.io/devtools-protocol/tot/Storage/ EXPERIMENTAL.

func (*StorageProtocol) ClearDataForOrigin

func (protocol *StorageProtocol) ClearDataForOrigin(
	params *storage.ClearDataForOriginParams,
) <-chan *storage.ClearDataForOriginResult

ClearDataForOrigin clears storage for origin.

https://chromedevtools.github.io/devtools-protocol/tot/Storage/#method-clearDataForOrigin

func (*StorageProtocol) GetUsageAndQuota

func (protocol *StorageProtocol) GetUsageAndQuota(
	params *storage.GetUsageAndQuotaParams,
) <-chan *storage.GetUsageAndQuotaResult

GetUsageAndQuota returns usage and quota in bytes.

https://chromedevtools.github.io/devtools-protocol/tot/Storage/#method-getUsageAndQuota

func (*StorageProtocol) OnCacheStorageContentUpdated

func (protocol *StorageProtocol) OnCacheStorageContentUpdated(
	callback func(event *storage.CacheStorageContentUpdatedEvent),
)

OnCacheStorageContentUpdated adds a handler to the Storage.cacheStorageContentUpdated event. Storage.cacheStorageContentUpdated fires when a cache's contents have been modified.

https://chromedevtools.github.io/devtools-protocol/tot/Storage/#event-cacheStorageContentUpdated

func (*StorageProtocol) OnCacheStorageListUpdated

func (protocol *StorageProtocol) OnCacheStorageListUpdated(
	callback func(event *storage.CacheStorageListUpdatedEvent),
)

OnCacheStorageListUpdated adds a handler to the Storage.cacheStorageListUpdated event. Storage.cacheStorageListUpdated fires when cache has been added/deleted.

https://chromedevtools.github.io/devtools-protocol/tot/Storage/#event-cacheStorageListUpdated

func (*StorageProtocol) OnIndexedDBContentUpdated

func (protocol *StorageProtocol) OnIndexedDBContentUpdated(
	callback func(event *storage.IndexedDBContentUpdatedEvent),
)

OnIndexedDBContentUpdated adds a handler to the Storage.indexedDBContentUpdated event. Storage.indexedDBContentUpdated fires when the origin's IndexedDB object store has been modified.

https://chromedevtools.github.io/devtools-protocol/tot/Storage/#event-indexedDBContentUpdated

func (*StorageProtocol) OnIndexedDBListUpdated

func (protocol *StorageProtocol) OnIndexedDBListUpdated(
	callback func(event *storage.IndexedDBListUpdatedEvent),
)

OnIndexedDBListUpdated adds a handler to the Storage.indexedDBListUpdated event. Storage.indexedDBListUpdated fires when the origin's IndexedDB database list has been modified.

https://chromedevtools.github.io/devtools-protocol/tot/Storage/#event-indexedDBListUpdated

func (*StorageProtocol) TrackCacheStorageForOrigin

func (protocol *StorageProtocol) TrackCacheStorageForOrigin(
	params *storage.TrackCacheStorageForOriginParams,
) <-chan *storage.TrackCacheStorageForOriginResult

TrackCacheStorageForOrigin registers origin to be notified when an update occurs to its cache storage list.

https://chromedevtools.github.io/devtools-protocol/tot/Storage/#method-trackCacheStorageForOrigin

func (*StorageProtocol) TrackIndexedDBForOrigin

func (protocol *StorageProtocol) TrackIndexedDBForOrigin(
	params *storage.TrackIndexedDBForOriginParams,
) <-chan *storage.TrackIndexedDBForOriginResult

TrackIndexedDBForOrigin registers origin to be notified when an update occurs to its IndexedDB.

https://chromedevtools.github.io/devtools-protocol/tot/Storage/#method-trackIndexedDBForOrigin

func (*StorageProtocol) UntrackCacheStorageForOrigin

func (protocol *StorageProtocol) UntrackCacheStorageForOrigin(
	params *storage.UntrackCacheStorageForOriginParams,
) <-chan *storage.UntrackCacheStorageForOriginResult

UntrackCacheStorageForOrigin unregisters origin from receiving notifications for cache storage.

https://chromedevtools.github.io/devtools-protocol/tot/Storage/#method-untrackCacheStorageForOrigin

func (*StorageProtocol) UntrackIndexedDBForOrigin

func (protocol *StorageProtocol) UntrackIndexedDBForOrigin(
	params *storage.UntrackIndexedDBForOriginParams,
) <-chan *storage.UntrackIndexedDBForOriginResult

UntrackIndexedDBForOrigin unregisters origin from receiving notifications for IndexedDB.

https://chromedevtools.github.io/devtools-protocol/tot/Storage/#method-untrackIndexedDBForOrigin

type SystemInfoProtocol

type SystemInfoProtocol struct {
	Socket Socketer
}

SystemInfoProtocol provides a namespace for the Chrome SystemInfo protocol methods. The SystemInfo protocol defines methods and events for querying low-level system information.

https://chromedevtools.github.io/devtools-protocol/tot/SystemInfo/ EXPERIMENTAL.

func (*SystemInfoProtocol) GetInfo

func (protocol *SystemInfoProtocol) GetInfo() <-chan *info.GetInfoResult

GetInfo returns information about the system.

https://chromedevtools.github.io/devtools-protocol/tot/SystemInfo/#method-getInfo

type TargetProtocol

type TargetProtocol struct {
	Socket Socketer
}

TargetProtocol provides a namespace for the Chrome Target protocol methods. The Target protocol supports additional targets discovery and allows to attach to them.

https://chromedevtools.github.io/devtools-protocol/tot/Target/

func (*TargetProtocol) ActivateTarget

func (protocol *TargetProtocol) ActivateTarget(
	params *target.ActivateTargetParams,
) <-chan *target.ActivateTargetResult

ActivateTarget activates (focuses) the target.

https://chromedevtools.github.io/devtools-protocol/tot/Target/#method-activateTarget

func (*TargetProtocol) AttachToTarget

func (protocol *TargetProtocol) AttachToTarget(
	params *target.AttachToTargetParams,
) <-chan *target.AttachToTargetResult

AttachToTarget attaches to the target with given id.

https://chromedevtools.github.io/devtools-protocol/tot/Target/#method-attachToTarget

func (*TargetProtocol) CloseTarget

func (protocol *TargetProtocol) CloseTarget(
	params *target.CloseTargetParams,
) <-chan *target.CloseTargetResult

CloseTarget closes the target. If the target is a page that gets closed too.

https://chromedevtools.github.io/devtools-protocol/tot/Target/#method-closeTarget

func (*TargetProtocol) CreateBrowserContext

func (protocol *TargetProtocol) CreateBrowserContext() <-chan *target.CreateBrowserContextResult

CreateBrowserContext creates a new empty BrowserContext. Similar to an incognito profile but you can have more than one.

https://chromedevtools.github.io/devtools-protocol/tot/Target/#method-createBrowserContext EXPERIMENTAL.

func (*TargetProtocol) CreateTarget

func (protocol *TargetProtocol) CreateTarget(
	params *target.CreateTargetParams,
) <-chan *target.CreateTargetResult

CreateTarget creates a new page.

https://chromedevtools.github.io/devtools-protocol/tot/Target/#method-createTarget

func (*TargetProtocol) DetachFromTarget

func (protocol *TargetProtocol) DetachFromTarget(
	params *target.DetachFromTargetParams,
) <-chan *target.DetachFromTargetResult

DetachFromTarget detaches session with given id.

https://chromedevtools.github.io/devtools-protocol/tot/Target/#method-detachFromTarget

func (*TargetProtocol) DisposeBrowserContext

func (protocol *TargetProtocol) DisposeBrowserContext(
	params *target.DisposeBrowserContextParams,
) <-chan *target.DisposeBrowserContextResult

DisposeBrowserContext deletes a BrowserContext, will fail of any open page uses it.

https://chromedevtools.github.io/devtools-protocol/tot/Target/#method-disposeBrowserContext EXPERIMENTAL.

func (*TargetProtocol) GetTargetInfo

func (protocol *TargetProtocol) GetTargetInfo(
	params *target.GetTargetInfoParams,
) <-chan *target.GetTargetInfoResult

GetTargetInfo returns information about a target.

https://chromedevtools.github.io/devtools-protocol/tot/Target/#method-getTargetInfo EXPERIMENTAL.

func (*TargetProtocol) GetTargets

func (protocol *TargetProtocol) GetTargets(
	params *target.GetTargetsParams,
) <-chan *target.GetTargetsResult

GetTargets retrieves a list of available targets.

https://chromedevtools.github.io/devtools-protocol/tot/Target/#method-getTargets

func (*TargetProtocol) OnAttachedToTarget

func (protocol *TargetProtocol) OnAttachedToTarget(
	callback func(event *target.AttachedToTargetEvent),
)

OnAttachedToTarget adds a handler to the Target.attachedToTarget event. Target.attachedToTarget fires when attached to target because of auto-attach or AttachToTarget command.

https://chromedevtools.github.io/devtools-protocol/tot/Target/#event-attachedToTarget EXPERIMENTAL.

func (*TargetProtocol) OnDetachedFromTarget

func (protocol *TargetProtocol) OnDetachedFromTarget(
	callback func(event *target.DetachedFromTargetEvent),
)

OnDetachedFromTarget adds a handler to the Target.detachedFromTarget event. Target.detachedFromTarget fires 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.

https://chromedevtools.github.io/devtools-protocol/tot/Target/#event-detachedFromTarget EXPERIMENTAL.

func (*TargetProtocol) OnReceivedMessageFromTarget

func (protocol *TargetProtocol) OnReceivedMessageFromTarget(
	callback func(event *target.ReceivedMessageFromTargetEvent),
)

OnReceivedMessageFromTarget adds a handler to the Target.receivedMessageFromTarget event. Target.receivedMessageFromTarget fires when a new protocol message received from the session (as reported in `attachedToTarget` event).

https://chromedevtools.github.io/devtools-protocol/tot/Target/#event-receivedMessageFromTarget

func (*TargetProtocol) OnTargetCreated

func (protocol *TargetProtocol) OnTargetCreated(
	callback func(event *target.CreatedEvent),
)

OnTargetCreated adds a handler to the Target.Created event. Target.Created fires when a possible inspection target is created.

https://chromedevtools.github.io/devtools-protocol/tot/Target/#event-targetCreated

func (*TargetProtocol) OnTargetDestroyed

func (protocol *TargetProtocol) OnTargetDestroyed(
	callback func(event *target.DestroyedEvent),
)

OnTargetDestroyed adds a handler to the Target.Destroyed event. Target.Destroyed fires when a target is destroyed.

https://chromedevtools.github.io/devtools-protocol/tot/Target/#event-targetDestroyed

func (*TargetProtocol) OnTargetInfoChanged

func (protocol *TargetProtocol) OnTargetInfoChanged(
	callback func(event *target.InfoChangedEvent),
)

OnTargetInfoChanged adds a handler to the Target.InfoChanged event. Target.InfoChanged fires when some information about a target has changed. This only happens between `targetCreated` and `targetDestroyed` events.

https://chromedevtools.github.io/devtools-protocol/tot/Target/#event-targetInfoChanged

func (*TargetProtocol) SendMessageToTarget

func (protocol *TargetProtocol) SendMessageToTarget(
	params *target.SendMessageToTargetParams,
) <-chan *target.SendMessageToTargetResult

SendMessageToTarget sends protocol message over session with given id.

https://chromedevtools.github.io/devtools-protocol/tot/Target/#method-sendMessageToTarget

func (*TargetProtocol) SetAttachToFrames

func (protocol *TargetProtocol) SetAttachToFrames(
	params *target.SetAttachToFramesParams,
) <-chan *target.SetAttachToFramesResult

SetAttachToFrames is experimental.

https://chromedevtools.github.io/devtools-protocol/tot/Target/#method-setAttachToFrames EXPERIMENTAL.

func (*TargetProtocol) SetAutoAttach

func (protocol *TargetProtocol) SetAutoAttach(
	params *target.SetAutoAttachParams,
) <-chan *target.SetAutoAttachResult

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.

https://chromedevtools.github.io/devtools-protocol/tot/Target/#method-setAutoAttach EXPERIMENTAL.

func (*TargetProtocol) SetDiscoverTargets

func (protocol *TargetProtocol) SetDiscoverTargets(
	params *target.SetDiscoverTargetsParams,
) <-chan *target.SetDiscoverTargetsResult

SetDiscoverTargets controls whether to discover available targets and notify via `targetCreated`, `targetInfoChanged` and `targetDestroyed` events.

https://chromedevtools.github.io/devtools-protocol/tot/Target/#method-setDiscoverTargets

func (*TargetProtocol) SetRemoteLocations

func (protocol *TargetProtocol) SetRemoteLocations(
	params *target.SetRemoteLocationsParams,
) <-chan *target.SetRemoteLocationsResult

SetRemoteLocations enables target discovery for the specified locations, when SetDiscoverTargets was set to `true`.

https://chromedevtools.github.io/devtools-protocol/tot/Target/#method-setRemoteLocations EXPERIMENTAL.

type TetheringProtocol

type TetheringProtocol struct {
	Socket Socketer
}

TetheringProtocol provides a namespace for the Chrome Tethering protocol methods. The Tethering protocol defines methods and events for browser port binding.

https://chromedevtools.github.io/devtools-protocol/tot/Tethering/

func (*TetheringProtocol) Bind

func (protocol *TetheringProtocol) Bind(
	params *tethering.BindParams,
) <-chan *tethering.BindResult

Bind requests browser port binding.

https://chromedevtools.github.io/devtools-protocol/tot/Tethering/#method-bind

func (*TetheringProtocol) OnAccepted

func (protocol *TetheringProtocol) OnAccepted(
	callback func(event *tethering.AcceptedEvent),
)

OnAccepted adds a handler to the Tethering.accepted event. Tethering.accepted fires when a port was successfully bound and got a specified connection id.

https://chromedevtools.github.io/devtools-protocol/tot/Tethering/#event-accepted

func (*TetheringProtocol) Unbind

func (protocol *TetheringProtocol) Unbind(
	params *tethering.UnbindParams,
) <-chan *tethering.UnbindResult

Unbind requests browser port unbinding.

https://chromedevtools.github.io/devtools-protocol/tot/Tethering/#method-unbind

type TracingProtocol

type TracingProtocol struct {
	Socket Socketer
}

TracingProtocol provides a namespace for the Chrome Tracing protocol methods.

https://chromedevtools.github.io/devtools-protocol/tot/Tracing/ EXPERIMENTAL.

func (*TracingProtocol) End

func (protocol *TracingProtocol) End() <-chan *tracing.EndResult

End stops trace events collection.

https://chromedevtools.github.io/devtools-protocol/tot/Tracing/#method-end

func (*TracingProtocol) GetCategories

func (protocol *TracingProtocol) GetCategories() <-chan *tracing.GetCategoriesResult

GetCategories gets supported tracing categories.

https://chromedevtools.github.io/devtools-protocol/tot/Tracing/#method-getCategories

func (*TracingProtocol) OnBufferUsage

func (protocol *TracingProtocol) OnBufferUsage(
	callback func(event *tracing.BufferUsageEvent),
)

OnBufferUsage adds a handler to the Tracing.bufferUsage event. Tracing.bufferUsage fires when a buffer is used.

https://chromedevtools.github.io/devtools-protocol/tot/Tracing/#event-bufferUsage

func (*TracingProtocol) OnDataCollected

func (protocol *TracingProtocol) OnDataCollected(
	callback func(event *tracing.DataCollectedEvent),
)

OnDataCollected adds a handler to the Tracing.dataCollected event. Tracing.dataCollected fires when tracing is stopped, collected events will be sent as a sequence of dataCollected events followed by tracingComplete event. Contains an bucket of collected trace events.

https://chromedevtools.github.io/devtools-protocol/tot/Tracing/#event-dataCollected

func (*TracingProtocol) OnTracingComplete

func (protocol *TracingProtocol) OnTracingComplete(
	callback func(event *tracing.CompleteEvent),
)

OnTracingComplete adds a handler to the Tracing.Complete event. Tracing.Complete fires when tracing is stopped and there is no trace buffers pending flush, all data were delivered via DataCollected events.

https://chromedevtools.github.io/devtools-protocol/tot/Tracing/#event-tracingComplete

func (*TracingProtocol) RecordClockSyncMarker

func (protocol *TracingProtocol) RecordClockSyncMarker(
	params *tracing.RecordClockSyncMarkerParams,
) <-chan *tracing.RecordClockSyncMarkerResult

RecordClockSyncMarker records a clock sync marker in the trace.

https://chromedevtools.github.io/devtools-protocol/tot/Tracing/#method-recordClockSyncMarker

func (*TracingProtocol) RequestMemoryDump

func (protocol *TracingProtocol) RequestMemoryDump() <-chan *tracing.RequestMemoryDumpResult

RequestMemoryDump requests a global memory dump.

https://chromedevtools.github.io/devtools-protocol/tot/Tracing/#method-requestMemoryDump

func (*TracingProtocol) Start

func (protocol *TracingProtocol) Start(
	params *tracing.StartParams,
) <-chan *tracing.StartResult

Start starts trace events collection.

https://chromedevtools.github.io/devtools-protocol/tot/Tracing/#method-start

type WebSocketer

type WebSocketer interface {
	// Close closes the current websocket connection.
	Close() error

	// ReadJSON listens for the next websocket message and unmarshalls it into
	// the provided variable.
	ReadJSON(v interface{}) error

	// WriteJSON marshalls the provided data as JSON and writes it to the
	// websocket.
	WriteJSON(v interface{}) error
}

WebSocketer defines the minimum interface required API for web socket connections to the Chromium browser.

func NewWebsocket

func NewWebsocket(socketURL *url.URL) (WebSocketer, error)

NewWebsocket returns a connected socket connection that implements the WebSocketer interface.

Jump to

Keyboard shortcuts

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