domain

package
v0.0.0-...-09063df Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2020 License: MIT Imports: 46 Imported by: 0

Documentation

Overview

Package domain helps executing cdproto commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accessibility

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

Accessibility executes a cdproto command under Accessibility domain.

func (Accessibility) Disable

func (doAccessibility Accessibility) Disable() (err error)

Disable disables the accessibility domain.

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

func (Accessibility) Enable

func (doAccessibility Accessibility) Enable() (err error)

Enable enables the accessibility domain which causes AXNodeIds to remain consistent between method calls. This turns on accessibility for the page, which can impact performance until accessibility is disabled.

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

func (Accessibility) GetFullAXTree

func (doAccessibility Accessibility) GetFullAXTree() (retNodes []*accessibility.Node, err error)

GetFullAXTree fetches the entire accessibility tree.

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

returns:

  • `retNodes`

func (Accessibility) GetPartialAXTree

func (doAccessibility Accessibility) GetPartialAXTree(nodeID *cdp.NodeID, backendNodeID *cdp.BackendNodeID, objectID *runtime.RemoteObjectID, fetchRelatives *bool) (retNodes []*accessibility.Node, err error)

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

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

parameters:

  • `nodeID`: This can be nil. (Optional) Identifier of the node to get the partial accessibility tree for.
  • `backendNodeID`: This can be nil. (Optional) Identifier of the backend node to get the partial accessibility tree for.
  • `objectID`: This can be nil. (Optional) JavaScript object id of the node wrapper to get the partial accessibility tree for.
  • `fetchRelatives`: This can be nil. (Optional) Whether to fetch this nodes ancestors, siblings and children. Defaults to true.

returns:

  • `retNodes`: The Accessibility.AXNode for this DOM node, if it exists, plus its ancestors, siblings and children, if requested.

type Animation

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

Animation executes a cdproto command under Animation domain.

func (Animation) Disable

func (doAnimation Animation) Disable() (err error)

Disable disables animation domain notifications.

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

func (Animation) Enable

func (doAnimation Animation) Enable() (err error)

Enable enables animation domain notifications.

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

func (Animation) GetCurrentTime

func (doAnimation Animation) GetCurrentTime(id string) (retCurrentTime float64, err error)

GetCurrentTime returns the current time of the an animation.

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

parameters:

  • `id`: Id of animation.

returns:

  • `retCurrentTime`: Current time of the page.

func (Animation) GetPlaybackRate

func (doAnimation Animation) GetPlaybackRate() (retPlaybackRate float64, err error)

GetPlaybackRate gets the playback rate of the document timeline.

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

returns:

  • `retPlaybackRate`: Playback rate for animations on page.

func (Animation) ReleaseAnimations

func (doAnimation Animation) ReleaseAnimations(animations []string) (err error)

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

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

parameters:

  • `animations`: List of animation ids to seek.

func (Animation) ResolveAnimation

func (doAnimation Animation) ResolveAnimation(animationID string) (retRemoteObject *runtime.RemoteObject, err error)

ResolveAnimation gets the remote object of the Animation.

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

parameters:

  • `animationID`: Animation id.

returns:

  • `retRemoteObject`: Corresponding remote object.

func (Animation) SeekAnimations

func (doAnimation Animation) SeekAnimations(animations []string, currentTime float64) (err error)

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

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

parameters:

  • `animations`: List of animation ids to seek.
  • `currentTime`: Set the current time of each animation.

func (Animation) SetPaused

func (doAnimation Animation) SetPaused(animations []string, paused bool) (err error)

SetPaused sets the paused state of a set of animations.

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

parameters:

  • `animations`: Animations to set the pause state of.
  • `paused`: Paused state to set to.

func (Animation) SetPlaybackRate

func (doAnimation Animation) SetPlaybackRate(playbackRate float64) (err error)

SetPlaybackRate sets the playback rate of the document timeline.

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

parameters:

  • `playbackRate`: Playback rate for animations on page

func (Animation) SetTiming

func (doAnimation Animation) SetTiming(animationID string, duration float64, delay float64) (err error)

SetTiming sets the timing of an animation node.

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

parameters:

  • `animationID`: Animation id.
  • `duration`: Duration of the animation.
  • `delay`: Delay of the animation.

type ApplicationCache

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

ApplicationCache executes a cdproto command under ApplicationCache domain.

func (ApplicationCache) Enable

func (doApplicationCache ApplicationCache) Enable() (err error)

Enable enables application cache domain notifications.

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

func (ApplicationCache) GetApplicationCacheForFrame

func (doApplicationCache ApplicationCache) GetApplicationCacheForFrame(frameID cdp.FrameID) (retApplicationCache *applicationcache.ApplicationCache, err error)

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

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

parameters:

  • `frameID`: Identifier of the frame containing document whose application cache is retrieved.

returns:

  • `retApplicationCache`: Relevant application cache data for the document in given frame.

func (ApplicationCache) GetFramesWithManifests

func (doApplicationCache ApplicationCache) GetFramesWithManifests() (retFrameIds []*applicationcache.FrameWithManifest, err error)

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

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

returns:

  • `retFrameIds`: Array of frame identifiers with manifest urls for each frame containing a document associated with some application cache.

func (ApplicationCache) GetManifestForFrame

func (doApplicationCache ApplicationCache) GetManifestForFrame(frameID cdp.FrameID) (retManifestURL string, err error)

GetManifestForFrame returns manifest URL for document in the given frame.

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

parameters:

  • `frameID`: Identifier of the frame containing document whose manifest is retrieved.

returns:

  • `retManifestURL`: Manifest URL for document in the given frame.

type Audits

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

Audits executes a cdproto command under Audits domain.

func (Audits) GetEncodedResponse

func (doAudits Audits) GetEncodedResponse(requestID network.RequestID, encoding audits.GetEncodedResponseEncoding, quality *float64, sizeOnly *bool) (retBody []byte, retOriginalSize int64, retEncodedSize int64, err error)

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

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

parameters:

  • `requestID`: Identifier of the network request to get content for.
  • `encoding`: The encoding to use.
  • `quality`: This can be nil. (Optional) The quality of the encoding (0-1). (defaults to 1)
  • `sizeOnly`: This can be nil. (Optional) Whether to only return the size information (defaults to false).

returns:

  • `retBody`: The encoded body as a base64 string. Omitted if sizeOnly is true.
  • `retOriginalSize`: Size before re-encoding.
  • `retEncodedSize`: Size after re-encoding.

type BackgroundService

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

BackgroundService executes a cdproto command under BackgroundService domain.

func (BackgroundService) ClearEvents

func (doBackgroundService BackgroundService) ClearEvents(service backgroundservice.ServiceName) (err error)

ClearEvents clears all stored data for the service.

See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#method-clearEvents

parameters:

  • `service`

func (BackgroundService) SetRecording

func (doBackgroundService BackgroundService) SetRecording(shouldRecord bool, service backgroundservice.ServiceName) (err error)

SetRecording set the recording state for the service.

See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#method-setRecording

parameters:

  • `shouldRecord`
  • `service`

func (BackgroundService) StartObserving

func (doBackgroundService BackgroundService) StartObserving(service backgroundservice.ServiceName) (err error)

StartObserving enables event updates for the service.

See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#method-startObserving

parameters:

  • `service`

func (BackgroundService) StopObserving

func (doBackgroundService BackgroundService) StopObserving(service backgroundservice.ServiceName) (err error)

StopObserving disables event updates for the service.

See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#method-stopObserving

parameters:

  • `service`

type Browser

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

Browser executes a cdproto command under Browser domain.

func (Browser) Close

func (doBrowser Browser) Close() (err error)

Close close browser gracefully.

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

func (Browser) Crash

func (doBrowser Browser) Crash() (err error)

Crash crashes browser on the main thread.

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

func (Browser) CrashGpuProcess

func (doBrowser Browser) CrashGpuProcess() (err error)

CrashGpuProcess crashes GPU process.

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

func (Browser) GetBrowserCommandLine

func (doBrowser Browser) GetBrowserCommandLine() (retArguments []string, err error)

GetBrowserCommandLine returns the command line switches for the browser process if, and only if --enable-automation is on the commandline.

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

returns:

  • `retArguments`: Commandline parameters

func (Browser) GetHistogram

func (doBrowser Browser) GetHistogram(name string, delta *bool) (retHistogram *browser.Histogram, err error)

GetHistogram get a Chrome histogram by name.

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

parameters:

  • `name`: Requested histogram name.
  • `delta`: This can be nil. (Optional) If true, retrieve delta since last call.

returns:

  • `retHistogram`: Histogram.

func (Browser) GetHistograms

func (doBrowser Browser) GetHistograms(query *string, delta *bool) (retHistograms []*browser.Histogram, err error)

GetHistograms get Chrome histograms.

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

parameters:

  • `query`: This can be nil. (Optional) Requested substring in name. Only histograms which have query as a substring in their name are extracted. An empty or absent query returns all histograms.
  • `delta`: This can be nil. (Optional) If true, retrieve delta since last call.

returns:

  • `retHistograms`: Histograms.

func (Browser) GetVersion

func (doBrowser Browser) GetVersion() (retProtocolVersion string, retProduct string, retRevision string, retUserAgent string, retJsVersion string, err error)

GetVersion returns version information.

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

returns:

  • `retProtocolVersion`: Protocol version.
  • `retProduct`: Product name.
  • `retRevision`: Product revision.
  • `retUserAgent`: User-Agent.
  • `retJsVersion`: V8 version.

func (Browser) GetWindowBounds

func (doBrowser Browser) GetWindowBounds(windowID browser.WindowID) (retBounds *browser.Bounds, err error)

GetWindowBounds get position and size of the browser window.

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

parameters:

  • `windowID`: Browser window id.

returns:

  • `retBounds`: Bounds information of the window. When window state is 'minimized', the restored window position and size are returned.

func (Browser) GetWindowForTarget

func (doBrowser Browser) GetWindowForTarget(targetID *target.ID) (retWindowID browser.WindowID, retBounds *browser.Bounds, err error)

GetWindowForTarget get the browser window that contains the devtools target.

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

parameters:

  • `targetID`: This can be nil. (Optional) Devtools agent host id. If called as a part of the session, associated targetId is used.

returns:

  • `retWindowID`: Browser window id.
  • `retBounds`: Bounds information of the window. When window state is 'minimized', the restored window position and size are returned.

func (Browser) GrantPermissions

func (doBrowser Browser) GrantPermissions(origin string, permissions []browser.PermissionType, browserContextID *cdp.BrowserContextID) (err error)

GrantPermissions grant specific permissions to the given origin and reject all others.

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

parameters:

  • `origin`
  • `permissions`
  • `browserContextID`: This can be nil. (Optional) BrowserContext to override permissions. When omitted, default browser context is used.

func (Browser) ResetPermissions

func (doBrowser Browser) ResetPermissions(browserContextID *cdp.BrowserContextID) (err error)

ResetPermissions reset all permission management for all origins.

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

parameters:

  • `browserContextID`: This can be nil. (Optional) BrowserContext to reset permissions. When omitted, default browser context is used.

func (Browser) SetDockTile

func (doBrowser Browser) SetDockTile(badgeLabel *string, image *string) (err error)

SetDockTile set dock tile details, platform-specific.

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

parameters:

  • `badgeLabel`
  • `image`: This can be nil. (Optional) Png encoded image.

func (Browser) SetPermission

func (doBrowser Browser) SetPermission(origin string, permission *browser.PermissionDescriptor, setting browser.PermissionSetting, browserContextID *cdp.BrowserContextID) (err error)

SetPermission set permission settings for given origin.

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

parameters:

  • `origin`: Origin the permission applies to.
  • `permission`: Descriptor of permission to override.
  • `setting`: Setting of the permission.
  • `browserContextID`: This can be nil. (Optional) Context to override. When omitted, default browser context is used.

func (Browser) SetWindowBounds

func (doBrowser Browser) SetWindowBounds(windowID browser.WindowID, bounds *browser.Bounds) (err error)

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

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

parameters:

  • `windowID`: Browser window id.
  • `bounds`: New window bounds. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'. Leaves unspecified fields unchanged.

type CSS

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

CSS executes a cdproto command under CSS domain.

func (CSS) AddRule

func (doCSS CSS) AddRule(styleSheetID css.StyleSheetID, ruleText string, location *css.SourceRange) (retRule *css.Rule, err error)

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

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

parameters:

  • `styleSheetID`: The css style sheet identifier where a new rule should be inserted.
  • `ruleText`: The text of a new rule.
  • `location`: Text position of a new rule in the target style sheet.

returns:

  • `retRule`: The newly created rule.

func (CSS) CollectClassNames

func (doCSS CSS) CollectClassNames(styleSheetID css.StyleSheetID) (retClassNames []string, err error)

CollectClassNames returns all class names from specified stylesheet.

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

parameters:

  • `styleSheetID`

returns:

  • `retClassNames`: Class name list.

func (CSS) CreateStyleSheet

func (doCSS CSS) CreateStyleSheet(frameID cdp.FrameID) (retStyleSheetID css.StyleSheetID, err error)

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

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

parameters:

  • `frameID`: Identifier of the frame where "via-inspector" stylesheet should be created.

returns:

  • `retStyleSheetID`: Identifier of the created "via-inspector" stylesheet.

func (CSS) Disable

func (doCSS CSS) Disable() (err error)

Disable disables the CSS agent for the given page.

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

func (CSS) Enable

func (doCSS CSS) Enable() (err error)

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.

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

func (CSS) ForcePseudoState

func (doCSS CSS) ForcePseudoState(nodeID cdp.NodeID, forcedPseudoClasses []string) (err error)

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

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

parameters:

  • `nodeID`: The element id for which to force the pseudo state.
  • `forcedPseudoClasses`: Element pseudo classes to force when computing the element's style.

func (CSS) GetBackgroundColors

func (doCSS CSS) GetBackgroundColors(nodeID cdp.NodeID) (retBackgroundColors []string, retComputedFontSize string, retComputedFontWeight string, err error)

GetBackgroundColors [no description].

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

parameters:

  • `nodeID`: Id of the node to get background colors for.

returns:

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

func (CSS) GetComputedStyleForNode

func (doCSS CSS) GetComputedStyleForNode(nodeID cdp.NodeID) (retComputedStyle []*css.ComputedStyleProperty, err error)

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

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

parameters:

  • `nodeID`

returns:

  • `retComputedStyle`: Computed style for the specified DOM node.

func (CSS) GetInlineStylesForNode

func (doCSS CSS) GetInlineStylesForNode(nodeID cdp.NodeID) (retInlineStyle *css.Style, retAttributesStyle *css.Style, err error)

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

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

parameters:

  • `nodeID`

returns:

  • `retInlineStyle`: Inline style for the specified DOM node.
  • `retAttributesStyle`: Attribute-defined element style (e.g. resulting from "width=20 height=100%").

func (CSS) GetMatchedStylesForNode

func (doCSS CSS) GetMatchedStylesForNode(nodeID cdp.NodeID) (retInlineStyle *css.Style, retAttributesStyle *css.Style, retMatchedCSSRules []*css.RuleMatch, retPseudoElements []*css.PseudoElementMatches, retInherited []*css.InheritedStyleEntry, retCSSKeyframesRules []*css.KeyframesRule, err error)

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

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

parameters:

  • `nodeID`

returns:

  • `retInlineStyle`: Inline style for the specified DOM node.
  • `retAttributesStyle`: Attribute-defined element style (e.g. resulting from "width=20 height=100%").
  • `retMatchedCSSRules`: CSS rules matching this node, from all applicable stylesheets.
  • `retPseudoElements`: Pseudo style matches for this node.
  • `retInherited`: A chain of inherited styles (from the immediate node parent up to the DOM tree root).
  • `retCSSKeyframesRules`: A list of CSS keyframed animations matching this node.

func (CSS) GetMediaQueries

func (doCSS CSS) GetMediaQueries() (retMedias []*css.Media, err error)

GetMediaQueries returns all media queries parsed by the rendering engine.

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

returns:

  • `retMedias`

func (CSS) GetPlatformFontsForNode

func (doCSS CSS) GetPlatformFontsForNode(nodeID cdp.NodeID) (retFonts []*css.PlatformFontUsage, err error)

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

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

parameters:

  • `nodeID`

returns:

  • `retFonts`: Usage statistics for every employed platform font.

func (CSS) GetStyleSheetText

func (doCSS CSS) GetStyleSheetText(styleSheetID css.StyleSheetID) (retText string, err error)

GetStyleSheetText returns the current textual content for a stylesheet.

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

parameters:

  • `styleSheetID`

returns:

  • `retText`: The stylesheet text.

func (CSS) SetEffectivePropertyValueForNode

func (doCSS CSS) SetEffectivePropertyValueForNode(nodeID cdp.NodeID, propertyName string, value string) (err error)

SetEffectivePropertyValueForNode find a rule with the given active property for the given node and set the new value for this property.

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

parameters:

  • `nodeID`: The element id for which to set property.
  • `propertyName`
  • `value`

func (CSS) SetKeyframeKey

func (doCSS CSS) SetKeyframeKey(styleSheetID css.StyleSheetID, rangeVal *css.SourceRange, keyText string) (retKeyText *css.Value, err error)

SetKeyframeKey modifies the keyframe rule key text.

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

parameters:

  • `styleSheetID`
  • `range`
  • `keyText`

returns:

  • `retKeyText`: The resulting key text after modification.

func (CSS) SetMediaText

func (doCSS CSS) SetMediaText(styleSheetID css.StyleSheetID, rangeVal *css.SourceRange, text string) (retMedia *css.Media, err error)

SetMediaText modifies the rule selector.

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

parameters:

  • `styleSheetID`
  • `range`
  • `text`

returns:

  • `retMedia`: The resulting CSS media rule after modification.

func (CSS) SetRuleSelector

func (doCSS CSS) SetRuleSelector(styleSheetID css.StyleSheetID, rangeVal *css.SourceRange, selector string) (retSelectorList *css.SelectorList, err error)

SetRuleSelector modifies the rule selector.

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

parameters:

  • `styleSheetID`
  • `range`
  • `selector`

returns:

  • `retSelectorList`: The resulting selector list after modification.

func (CSS) SetStyleSheetText

func (doCSS CSS) SetStyleSheetText(styleSheetID css.StyleSheetID, text string) (retSourceMapURL string, err error)

SetStyleSheetText sets the new stylesheet text.

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

parameters:

  • `styleSheetID`
  • `text`

returns:

  • `retSourceMapURL`: URL of source map associated with script (if any).

func (CSS) SetStyleTexts

func (doCSS CSS) SetStyleTexts(edits []*css.StyleDeclarationEdit) (retStyles []*css.Style, err error)

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

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

parameters:

  • `edits`

returns:

  • `retStyles`: The resulting styles after modification.

func (CSS) StartRuleUsageTracking

func (doCSS CSS) StartRuleUsageTracking() (err error)

StartRuleUsageTracking enables the selector recording.

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

func (CSS) StopRuleUsageTracking

func (doCSS CSS) StopRuleUsageTracking() (retRuleUsage []*css.RuleUsage, err error)

StopRuleUsageTracking stop tracking rule usage and return the list of rules that were used since last call to takeCoverageDelta (or since start of coverage instrumentation).

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

returns:

  • `retRuleUsage`

func (CSS) TakeCoverageDelta

func (doCSS CSS) TakeCoverageDelta() (retCoverage []*css.RuleUsage, retTimestamp float64, err error)

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

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

returns:

  • `retCoverage`
  • `retTimestamp`: Monotonically increasing time, in seconds.

type CacheStorage

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

CacheStorage executes a cdproto command under CacheStorage domain.

func (CacheStorage) DeleteCache

func (doCacheStorage CacheStorage) DeleteCache(cacheID cachestorage.CacheID) (err error)

DeleteCache deletes a cache.

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

parameters:

  • `cacheID`: Id of cache for deletion.

func (CacheStorage) DeleteEntry

func (doCacheStorage CacheStorage) DeleteEntry(cacheID cachestorage.CacheID, request string) (err error)

DeleteEntry deletes a cache entry.

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

parameters:

  • `cacheID`: Id of cache where the entry will be deleted.
  • `request`: URL spec of the request.

func (CacheStorage) RequestCacheNames

func (doCacheStorage CacheStorage) RequestCacheNames(securityOrigin string) (retCaches []*cachestorage.Cache, err error)

RequestCacheNames requests cache names.

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

parameters:

  • `securityOrigin`: Security origin.

returns:

  • `retCaches`: Caches for the security origin.

func (CacheStorage) RequestCachedResponse

func (doCacheStorage CacheStorage) RequestCachedResponse(cacheID cachestorage.CacheID, requestURL string, requestHeaders []*cachestorage.Header) (retResponse *cachestorage.CachedResponse, err error)

RequestCachedResponse fetches cache entry.

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

parameters:

  • `cacheID`: Id of cache that contains the entry.
  • `requestURL`: URL spec of the request.
  • `requestHeaders`: headers of the request.

returns:

  • `retResponse`: Response read from the cache.

func (CacheStorage) RequestEntries

func (doCacheStorage CacheStorage) RequestEntries(cacheID cachestorage.CacheID, skipCount *int64, pageSize *int64, pathFilter *string) (retCacheDataEntries []*cachestorage.DataEntry, retReturnCount float64, err error)

RequestEntries requests data from cache.

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

parameters:

  • `cacheID`: ID of cache to get entries from.
  • `skipCount`: This can be nil. (Optional) Number of records to skip.
  • `pageSize`: This can be nil. (Optional) Number of records to fetch.
  • `pathFilter`: This can be nil. (Optional) If present, only return the entries containing this substring in the path

returns:

  • `retCacheDataEntries`: Array of object store data entries.
  • `retReturnCount`: Count of returned entries from this storage. If pathFilter is empty, it is the count of all entries from this storage.

type Cast

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

Cast executes a cdproto command under Cast domain.

func (Cast) Disable

func (doCast Cast) Disable() (err error)

Disable stops observing for sinks and issues.

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

func (Cast) Enable

func (doCast Cast) Enable(presentationURL *string) (err error)

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

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

parameters:

  • `presentationURL`

func (Cast) SetSinkToUse

func (doCast Cast) SetSinkToUse(sinkName string) (err error)

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

See: https://chromedevtools.github.io/devtools-protocol/tot/Cast#method-setSinkToUse

parameters:

  • `sinkName`

func (Cast) StartTabMirroring

func (doCast Cast) StartTabMirroring(sinkName string) (err error)

StartTabMirroring starts mirroring the tab to the sink.

See: https://chromedevtools.github.io/devtools-protocol/tot/Cast#method-startTabMirroring

parameters:

  • `sinkName`

func (Cast) StopCasting

func (doCast Cast) StopCasting(sinkName string) (err error)

StopCasting stops the active Cast session on the sink.

See: https://chromedevtools.github.io/devtools-protocol/tot/Cast#method-stopCasting

parameters:

  • `sinkName`

type DOM

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

DOM executes a cdproto command under DOM domain.

func (DOM) CollectClassNamesFromSubtree

func (doDOM DOM) CollectClassNamesFromSubtree(nodeID cdp.NodeID) (retClassNames []string, err error)

CollectClassNamesFromSubtree collects class names for the node with given id and all of it's child nodes.

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

parameters:

  • `nodeID`: Id of the node to collect class names.

returns:

  • `retClassNames`: Class name list.

func (DOM) CopyTo

func (doDOM DOM) CopyTo(nodeID cdp.NodeID, targetNodeID cdp.NodeID, insertBeforeNodeID *cdp.NodeID) (retNodeID cdp.NodeID, err error)

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

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

parameters:

  • `nodeID`: Id of the node to copy.
  • `targetNodeID`: Id of the element to drop the copy into.
  • `insertBeforeNodeID`: This can be nil. (Optional) Drop the copy before this node (if absent, the copy becomes the last child of targetNodeId).

returns:

  • `retNodeID`: Id of the node clone.

func (DOM) DescribeNode

func (doDOM DOM) DescribeNode(nodeID *cdp.NodeID, backendNodeID *cdp.BackendNodeID, objectID *runtime.RemoteObjectID, depth *int64, pierce *bool) (retNode *cdp.Node, err error)

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

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

parameters:

  • `nodeID`: This can be nil. (Optional) Identifier of the node.
  • `backendNodeID`: This can be nil. (Optional) Identifier of the backend node.
  • `objectID`: This can be nil. (Optional) JavaScript object id of the node wrapper.
  • `depth`: This can be nil. (Optional) The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
  • `pierce`: This can be nil. (Optional) Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).

returns:

  • `retNode`: Node description.

func (DOM) Disable

func (doDOM DOM) Disable() (err error)

Disable disables DOM agent for the given page.

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

func (DOM) DiscardSearchResults

func (doDOM DOM) DiscardSearchResults(searchID string) (err error)

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

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

parameters:

  • `searchID`: Unique search session identifier.

func (DOM) Enable

func (doDOM DOM) Enable() (err error)

Enable enables DOM agent for the given page.

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

func (DOM) Focus

func (doDOM DOM) Focus(nodeID *cdp.NodeID, backendNodeID *cdp.BackendNodeID, objectID *runtime.RemoteObjectID) (err error)

Focus focuses the given element.

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

parameters:

  • `nodeID`: This can be nil. (Optional) Identifier of the node.
  • `backendNodeID`: This can be nil. (Optional) Identifier of the backend node.
  • `objectID`: This can be nil. (Optional) JavaScript object id of the node wrapper.

func (DOM) GetAttributes

func (doDOM DOM) GetAttributes(nodeID cdp.NodeID) (retAttributes []string, err error)

GetAttributes returns attributes for the specified node.

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

parameters:

  • `nodeID`: Id of the node to retrieve attibutes for.

returns:

  • `retAttributes`: An interleaved array of node attribute names and values.

func (DOM) GetBoxModel

func (doDOM DOM) GetBoxModel(nodeID *cdp.NodeID, backendNodeID *cdp.BackendNodeID, objectID *runtime.RemoteObjectID) (retModel *dom.BoxModel, err error)

GetBoxModel returns boxes for the given node.

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

parameters:

  • `nodeID`: This can be nil. (Optional) Identifier of the node.
  • `backendNodeID`: This can be nil. (Optional) Identifier of the backend node.
  • `objectID`: This can be nil. (Optional) JavaScript object id of the node wrapper.

returns:

  • `retModel`: Box model for the node.

func (DOM) GetContentQuads

func (doDOM DOM) GetContentQuads(nodeID *cdp.NodeID, backendNodeID *cdp.BackendNodeID, objectID *runtime.RemoteObjectID) (retQuads []dom.Quad, err error)

GetContentQuads returns quads that describe node position on the page. This method might return multiple quads for inline nodes.

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

parameters:

  • `nodeID`: This can be nil. (Optional) Identifier of the node.
  • `backendNodeID`: This can be nil. (Optional) Identifier of the backend node.
  • `objectID`: This can be nil. (Optional) JavaScript object id of the node wrapper.

returns:

  • `retQuads`: Quads that describe node layout relative to viewport.

func (DOM) GetDocument

func (doDOM DOM) GetDocument(depth *int64, pierce *bool) (retRoot *cdp.Node, err error)

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

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

parameters:

  • `depth`: This can be nil. (Optional) The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
  • `pierce`: This can be nil. (Optional) Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).

returns:

  • `retRoot`: Resulting node.

func (DOM) GetFileInfo

func (doDOM DOM) GetFileInfo(objectID runtime.RemoteObjectID) (retPath string, err error)

GetFileInfo returns file information for the given File wrapper.

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

parameters:

  • `objectID`: JavaScript object id of the node wrapper.

returns:

  • `retPath`

func (DOM) GetFlattenedDocument

func (doDOM DOM) GetFlattenedDocument(depth *int64, pierce *bool) (retNodes []*cdp.Node, err error)

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

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

parameters:

  • `depth`: This can be nil. (Optional) The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
  • `pierce`: This can be nil. (Optional) Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).

returns:

  • `retNodes`: Resulting node.

func (DOM) GetFrameOwner

func (doDOM DOM) GetFrameOwner(frameID cdp.FrameID) (retBackendNodeID cdp.BackendNodeID, retNodeID cdp.NodeID, err error)

GetFrameOwner returns iframe node that owns iframe with the given domain.

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

parameters:

  • `frameID`

returns:

  • `retBackendNodeID`: Resulting node.
  • `retNodeID`: Id of the node at given coordinates, only when enabled and requested document.

func (DOM) GetNodeForLocation

func (doDOM DOM) GetNodeForLocation(x int64, y int64, includeUserAgentShadowDOM *bool, ignorePointerEventsNone *bool) (retBackendNodeID cdp.BackendNodeID, retFrameID cdp.FrameID, retNodeID cdp.NodeID, err error)

GetNodeForLocation returns node id at given location. Depending on whether DOM domain is enabled, nodeId is either returned or not.

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

parameters:

  • `x`: X coordinate.
  • `y`: Y coordinate.
  • `includeUserAgentShadowDOM`: This can be nil. (Optional) False to skip to the nearest non-UA shadow root ancestor (default: false).
  • `ignorePointerEventsNone`: This can be nil. (Optional) Whether to ignore pointer-events: none on elements and hit test them.

returns:

  • `retBackendNodeID`: Resulting node.
  • `retFrameID`: Frame this node belongs to.
  • `retNodeID`: Id of the node at given coordinates, only when enabled and requested document.

func (DOM) GetNodeStackTraces

func (doDOM DOM) GetNodeStackTraces(nodeID cdp.NodeID) (retCreation *runtime.StackTrace, err error)

GetNodeStackTraces gets stack traces associated with a Node. As of now, only provides stack trace for Node creation.

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

parameters:

  • `nodeID`: Id of the node to get stack traces for.

returns:

  • `retCreation`: Creation stack trace, if available.

func (DOM) GetOuterHTML

func (doDOM DOM) GetOuterHTML(nodeID *cdp.NodeID, backendNodeID *cdp.BackendNodeID, objectID *runtime.RemoteObjectID) (retOuterHTML string, err error)

GetOuterHTML returns node's HTML markup.

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

parameters:

  • `nodeID`: This can be nil. (Optional) Identifier of the node.
  • `backendNodeID`: This can be nil. (Optional) Identifier of the backend node.
  • `objectID`: This can be nil. (Optional) JavaScript object id of the node wrapper.

returns:

  • `retOuterHTML`: Outer HTML markup.

func (DOM) GetRelayoutBoundary

func (doDOM DOM) GetRelayoutBoundary(nodeID cdp.NodeID) (retNodeID cdp.NodeID, err error)

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

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

parameters:

  • `nodeID`: Id of the node.

returns:

  • `retNodeID`: Relayout boundary node id for the given node.

func (DOM) GetSearchResults

func (doDOM DOM) GetSearchResults(searchID string, fromIndex int64, toIndex int64) (retNodeIds []cdp.NodeID, err error)

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

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

parameters:

  • `searchID`: Unique search session identifier.
  • `fromIndex`: Start index of the search result to be returned.
  • `toIndex`: End index of the search result to be returned.

returns:

  • `retNodeIds`: Ids of the search result nodes.

func (DOM) MarkUndoableState

func (doDOM DOM) MarkUndoableState() (err error)

MarkUndoableState marks last undoable state.

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

func (DOM) MoveTo

func (doDOM DOM) MoveTo(nodeID cdp.NodeID, targetNodeID cdp.NodeID, insertBeforeNodeID *cdp.NodeID) (retNodeID cdp.NodeID, err error)

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

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

parameters:

  • `nodeID`: Id of the node to move.
  • `targetNodeID`: Id of the element to drop the moved node into.
  • `insertBeforeNodeID`: This can be nil. (Optional) Drop node before this one (if absent, the moved node becomes the last child of targetNodeId).

returns:

  • `retNodeID`: New id of the moved node.

func (DOM) PerformSearch

func (doDOM DOM) PerformSearch(query string, includeUserAgentShadowDOM *bool) (retSearchID string, retResultCount int64, err error)

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

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

parameters:

  • `query`: Plain text or query selector or XPath search query.
  • `includeUserAgentShadowDOM`: This can be nil. (Optional) True to search in user agent shadow DOM.

returns:

  • `retSearchID`: Unique search session identifier.
  • `retResultCount`: Number of search results.

func (DOM) PushNodeByPathToFrontend

func (doDOM DOM) PushNodeByPathToFrontend(path string) (retNodeID cdp.NodeID, err error)

PushNodeByPathToFrontend requests that the node is sent to the caller given its path. // FIXME, use XPath.

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

parameters:

  • `path`: Path to node in the proprietary format.

returns:

  • `retNodeID`: Id of the node for given path.

func (DOM) PushNodesByBackendIdsToFrontend

func (doDOM DOM) PushNodesByBackendIdsToFrontend(backendNodeIds []cdp.BackendNodeID) (retNodeIds []cdp.NodeID, err error)

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

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

parameters:

  • `backendNodeIds`: The array of backend node ids.

returns:

  • `retNodeIds`: The array of ids of pushed nodes that correspond to the backend ids specified in backendNodeIds.

func (DOM) QuerySelector

func (doDOM DOM) QuerySelector(nodeID cdp.NodeID, selector string) (retNodeID cdp.NodeID, err error)

QuerySelector executes querySelector on a given node.

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

parameters:

  • `nodeID`: Id of the node to query upon.
  • `selector`: Selector string.

returns:

  • `retNodeID`: Query selector result.

func (DOM) QuerySelectorAll

func (doDOM DOM) QuerySelectorAll(nodeID cdp.NodeID, selector string) (retNodeIds []cdp.NodeID, err error)

QuerySelectorAll executes querySelectorAll on a given node.

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

parameters:

  • `nodeID`: Id of the node to query upon.
  • `selector`: Selector string.

returns:

  • `retNodeIds`: Query selector result.

func (DOM) Redo

func (doDOM DOM) Redo() (err error)

Redo re-does the last undone action.

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

func (DOM) RemoveAttribute

func (doDOM DOM) RemoveAttribute(nodeID cdp.NodeID, name string) (err error)

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

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

parameters:

  • `nodeID`: Id of the element to remove attribute from.
  • `name`: Name of the attribute to remove.

func (DOM) RemoveNode

func (doDOM DOM) RemoveNode(nodeID cdp.NodeID) (err error)

RemoveNode removes node with given id.

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

parameters:

  • `nodeID`: Id of the node to remove.

func (DOM) RequestChildNodes

func (doDOM DOM) RequestChildNodes(nodeID cdp.NodeID, depth *int64, pierce *bool) (err error)

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

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

parameters:

  • `nodeID`: Id of the node to get children for.
  • `depth`: This can be nil. (Optional) The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
  • `pierce`: This can be nil. (Optional) Whether or not iframes and shadow roots should be traversed when returning the sub-tree (default is false).

func (DOM) RequestNode

func (doDOM DOM) RequestNode(objectID runtime.RemoteObjectID) (retNodeID cdp.NodeID, err error)

RequestNode requests that the node is sent to the caller given the JavaScript node object reference. All nodes that form the path from the node to the root are also sent to the client as a series of setChildNodes notifications.

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

parameters:

  • `objectID`: JavaScript object id to convert into node.

returns:

  • `retNodeID`: Node id for given object.

func (DOM) ResolveNode

func (doDOM DOM) ResolveNode(nodeID *cdp.NodeID, backendNodeID *cdp.BackendNodeID, objectGroup *string, executionContextID *runtime.ExecutionContextID) (retObject *runtime.RemoteObject, err error)

ResolveNode resolves the JavaScript node object for a given NodeId or BackendNodeId.

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

parameters:

  • `nodeID`: This can be nil. (Optional) Id of the node to resolve.
  • `backendNodeID`: This can be nil. (Optional) Backend identifier of the node to resolve.
  • `objectGroup`: This can be nil. (Optional) Symbolic group name that can be used to release multiple objects.
  • `executionContextID`: This can be nil. (Optional) Execution context in which to resolve the node.

returns:

  • `retObject`: JavaScript object wrapper for given node.

func (DOM) SetAttributeValue

func (doDOM DOM) SetAttributeValue(nodeID cdp.NodeID, name string, value string) (err error)

SetAttributeValue sets attribute for an element with given id.

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

parameters:

  • `nodeID`: Id of the element to set attribute for.
  • `name`: Attribute name.
  • `value`: Attribute value.

func (DOM) SetAttributesAsText

func (doDOM DOM) SetAttributesAsText(nodeID cdp.NodeID, text string, name *string) (err error)

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

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

parameters:

  • `nodeID`: Id of the element to set attributes for.
  • `text`: Text with a number of attributes. Will parse this text using HTML parser.
  • `name`: This can be nil. (Optional) Attribute name to replace with new attributes derived from text in case text parsed successfully.

func (DOM) SetFileInputFiles

func (doDOM DOM) SetFileInputFiles(files []string, nodeID *cdp.NodeID, backendNodeID *cdp.BackendNodeID, objectID *runtime.RemoteObjectID) (err error)

SetFileInputFiles sets files for the given file input element.

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

parameters:

  • `files`: Array of file paths to set.
  • `nodeID`: This can be nil. (Optional) Identifier of the node.
  • `backendNodeID`: This can be nil. (Optional) Identifier of the backend node.
  • `objectID`: This can be nil. (Optional) JavaScript object id of the node wrapper.

func (DOM) SetInspectedNode

func (doDOM DOM) SetInspectedNode(nodeID cdp.NodeID) (err error)

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

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

parameters:

  • `nodeID`: DOM node id to be accessible by means of $x command line API.

func (DOM) SetNodeName

func (doDOM DOM) SetNodeName(nodeID cdp.NodeID, name string) (retNodeID cdp.NodeID, err error)

SetNodeName sets node name for a node with given id.

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

parameters:

  • `nodeID`: Id of the node to set name for.
  • `name`: New node's name.

returns:

  • `retNodeID`: New node's id.

func (DOM) SetNodeStackTracesEnabled

func (doDOM DOM) SetNodeStackTracesEnabled(enable bool) (err error)

SetNodeStackTracesEnabled sets if stack traces should be captured for Nodes. See Node.getNodeStackTraces. Default is disabled.

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

parameters:

  • `enable`: Enable or disable.

func (DOM) SetNodeValue

func (doDOM DOM) SetNodeValue(nodeID cdp.NodeID, value string) (err error)

SetNodeValue sets node value for a node with given id.

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

parameters:

  • `nodeID`: Id of the node to set value for.
  • `value`: New node's value.

func (DOM) SetOuterHTML

func (doDOM DOM) SetOuterHTML(nodeID cdp.NodeID, outerHTML string) (err error)

SetOuterHTML sets node HTML markup, returns new node id.

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

parameters:

  • `nodeID`: Id of the node to set markup for.
  • `outerHTML`: Outer HTML markup to set.

func (DOM) Undo

func (doDOM DOM) Undo() (err error)

Undo undoes the last performed action.

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

type DOMDebugger

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

DOMDebugger executes a cdproto command under DOMDebugger domain.

func (DOMDebugger) GetEventListeners

func (doDOMDebugger DOMDebugger) GetEventListeners(objectID runtime.RemoteObjectID, depth *int64, pierce *bool) (retListeners []*domdebugger.EventListener, err error)

GetEventListeners returns event listeners of the given object.

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

parameters:

  • `objectID`: Identifier of the object to return listeners for.
  • `depth`: This can be nil. (Optional) The maximum depth at which Node children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
  • `pierce`: This can be nil. (Optional) Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false). Reports listeners for all contexts if pierce is enabled.

returns:

  • `retListeners`: Array of relevant listeners.

func (DOMDebugger) RemoveDOMBreakpoint

func (doDOMDebugger DOMDebugger) RemoveDOMBreakpoint(nodeID cdp.NodeID, typeVal domdebugger.DOMBreakpointType) (err error)

RemoveDOMBreakpoint removes DOM breakpoint that was set using setDOMBreakpoint.

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

parameters:

  • `nodeID`: Identifier of the node to remove breakpoint from.
  • `type`: Type of the breakpoint to remove.

func (DOMDebugger) RemoveEventListenerBreakpoint

func (doDOMDebugger DOMDebugger) RemoveEventListenerBreakpoint(eventName string, targetName *string) (err error)

RemoveEventListenerBreakpoint removes breakpoint on particular DOM event.

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

parameters:

  • `eventName`: Event name.
  • `targetName`: This can be nil. (Optional) EventTarget interface name.

func (DOMDebugger) RemoveInstrumentationBreakpoint

func (doDOMDebugger DOMDebugger) RemoveInstrumentationBreakpoint(eventName string) (err error)

RemoveInstrumentationBreakpoint removes breakpoint on particular native event.

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

parameters:

  • `eventName`: Instrumentation name to stop on.

func (DOMDebugger) RemoveXHRBreakpoint

func (doDOMDebugger DOMDebugger) RemoveXHRBreakpoint(url string) (err error)

RemoveXHRBreakpoint removes breakpoint from XMLHttpRequest.

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

parameters:

  • `url`: Resource URL substring.

func (DOMDebugger) SetDOMBreakpoint

func (doDOMDebugger DOMDebugger) SetDOMBreakpoint(nodeID cdp.NodeID, typeVal domdebugger.DOMBreakpointType) (err error)

SetDOMBreakpoint sets breakpoint on particular operation with DOM.

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

parameters:

  • `nodeID`: Identifier of the node to set breakpoint on.
  • `type`: Type of the operation to stop upon.

func (DOMDebugger) SetEventListenerBreakpoint

func (doDOMDebugger DOMDebugger) SetEventListenerBreakpoint(eventName string, targetName *string) (err error)

SetEventListenerBreakpoint sets breakpoint on particular DOM event.

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

parameters:

  • `eventName`: DOM Event name to stop on (any DOM event will do).
  • `targetName`: This can be nil. (Optional) EventTarget interface name to stop on. If equal to "*" or not provided, will stop on any EventTarget.

func (DOMDebugger) SetInstrumentationBreakpoint

func (doDOMDebugger DOMDebugger) SetInstrumentationBreakpoint(eventName string) (err error)

SetInstrumentationBreakpoint sets breakpoint on particular native event.

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

parameters:

  • `eventName`: Instrumentation name to stop on.

func (DOMDebugger) SetXHRBreakpoint

func (doDOMDebugger DOMDebugger) SetXHRBreakpoint(url string) (err error)

SetXHRBreakpoint sets breakpoint on XMLHttpRequest.

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

parameters:

  • `url`: Resource URL substring. All XHRs having this substring in the URL will get stopped upon.

type DOMSnapshot

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

DOMSnapshot executes a cdproto command under DOMSnapshot domain.

func (DOMSnapshot) CaptureSnapshot

func (doDOMSnapshot DOMSnapshot) CaptureSnapshot(computedStyles []string, includePaintOrder *bool, includeDOMRects *bool) (retDocuments []*domsnapshot.DocumentSnapshot, retStrings []string, err error)

CaptureSnapshot returns a document snapshot, including the full DOM tree of the root node (including iframes, template contents, and imported documents) in a flattened array, as well as layout and white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is flattened.

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

parameters:

  • `computedStyles`: Whitelist of computed styles to return.
  • `includePaintOrder`: This can be nil. (Optional) Whether to include layout object paint orders into the snapshot.
  • `includeDOMRects`: This can be nil. (Optional) Whether to include DOM rectangles (offsetRects, clientRects, scrollRects) into the snapshot

returns:

  • `retDocuments`: The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document.
  • `retStrings`: Shared string table that all string properties refer to with indexes.

func (DOMSnapshot) Disable

func (doDOMSnapshot DOMSnapshot) Disable() (err error)

Disable disables DOM snapshot agent for the given page.

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

func (DOMSnapshot) Enable

func (doDOMSnapshot DOMSnapshot) Enable() (err error)

Enable enables DOM snapshot agent for the given page.

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

type DOMStorage

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

DOMStorage executes a cdproto command under DOMStorage domain.

func (DOMStorage) Clear

func (doDOMStorage DOMStorage) Clear(storageID *domstorage.StorageID) (err error)

Clear [no description].

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

parameters:

  • `storageID`

func (DOMStorage) Disable

func (doDOMStorage DOMStorage) Disable() (err error)

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

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

func (DOMStorage) Enable

func (doDOMStorage DOMStorage) Enable() (err error)

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

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

func (DOMStorage) GetDOMStorageItems

func (doDOMStorage DOMStorage) GetDOMStorageItems(storageID *domstorage.StorageID) (retEntries []domstorage.Item, err error)

GetDOMStorageItems [no description].

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

parameters:

  • `storageID`

returns:

  • `retEntries`

func (DOMStorage) RemoveDOMStorageItem

func (doDOMStorage DOMStorage) RemoveDOMStorageItem(storageID *domstorage.StorageID, key string) (err error)

RemoveDOMStorageItem [no description].

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

parameters:

  • `storageID`
  • `key`

func (DOMStorage) SetDOMStorageItem

func (doDOMStorage DOMStorage) SetDOMStorageItem(storageID *domstorage.StorageID, key string, value string) (err error)

SetDOMStorageItem [no description].

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

parameters:

  • `storageID`
  • `key`
  • `value`

type Database

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

Database executes a cdproto command under Database domain.

func (Database) Disable

func (doDatabase Database) Disable() (err error)

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

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

func (Database) Enable

func (doDatabase Database) Enable() (err error)

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

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

func (Database) ExecuteSQL

func (doDatabase Database) ExecuteSQL(databaseID database.ID, query string) (retColumnNames []string, retValues []easyjson.RawMessage, retSQLError *database.Error, err error)

ExecuteSQL [no description].

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

parameters:

  • `databaseID`
  • `query`

returns:

  • `retColumnNames`
  • `retValues`
  • `retSQLError`

func (Database) GetDatabaseTableNames

func (doDatabase Database) GetDatabaseTableNames(databaseID database.ID) (retTableNames []string, err error)

GetDatabaseTableNames [no description].

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

parameters:

  • `databaseID`

returns:

  • `retTableNames`

type Debugger

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

Debugger executes a cdproto command under Debugger domain.

func (Debugger) ContinueToLocation

func (doDebugger Debugger) ContinueToLocation(location *debugger.Location, targetCallFrames *debugger.ContinueToLocationTargetCallFrames) (err error)

ContinueToLocation continues execution until specific location is reached.

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

parameters:

  • `location`: Location to continue to.
  • `targetCallFrames`

func (Debugger) Disable

func (doDebugger Debugger) Disable() (err error)

Disable disables debugger for given page.

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

func (Debugger) Enable

func (doDebugger Debugger) Enable(maxScriptsCacheSize *float64) (retDebuggerID runtime.UniqueDebuggerID, err error)

Enable enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received.

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

parameters:

  • `maxScriptsCacheSize`: This can be nil. (Optional) The maximum size in bytes of collected scripts (not referenced by other heap objects) the debugger can hold. Puts no limit if parameter is omitted.

returns:

  • `retDebuggerID`: Unique identifier of the debugger.

func (Debugger) EvaluateOnCallFrame

func (doDebugger Debugger) EvaluateOnCallFrame(callFrameID debugger.CallFrameID, expression string, objectGroup *string, includeCommandLineAPI *bool, silent *bool, returnByValue *bool, generatePreview *bool, throwOnSideEffect *bool, timeout *runtime.TimeDelta) (retResult *runtime.RemoteObject, retExceptionDetails *runtime.ExceptionDetails, err error)

EvaluateOnCallFrame evaluates expression on a given call frame.

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

parameters:

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

returns:

  • `retResult`: Object wrapper for the evaluation result.
  • `retExceptionDetails`: Exception details.

func (Debugger) GetPossibleBreakpoints

func (doDebugger Debugger) GetPossibleBreakpoints(start *debugger.Location, end *debugger.Location, restrictToFunction *bool) (retLocations []*debugger.BreakLocation, err error)

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

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

parameters:

  • `start`: Start of range to search possible breakpoint locations in.
  • `end`: This can be nil. (Optional) End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range.
  • `restrictToFunction`: This can be nil. (Optional) Only consider locations which are in the same (non-nested) function as start.

returns:

  • `retLocations`: List of the possible breakpoint locations.

func (Debugger) GetScriptSource

func (doDebugger Debugger) GetScriptSource(scriptID runtime.ScriptID) (retScriptSource string, retBytecode []byte, err error)

GetScriptSource returns source for the script with given id.

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

parameters:

  • `scriptID`: Id of the script to get source for.

returns:

  • `retScriptSource`: Script source (empty in case of Wasm bytecode).
  • `retBytecode`: Wasm bytecode.

func (Debugger) GetStackTrace

func (doDebugger Debugger) GetStackTrace(stackTraceID *runtime.StackTraceID) (retStackTrace *runtime.StackTrace, err error)

GetStackTrace returns stack trace with given stackTraceId.

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

parameters:

  • `stackTraceID`

returns:

  • `retStackTrace`

func (Debugger) Pause

func (doDebugger Debugger) Pause() (err error)

Pause stops on the next JavaScript statement.

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

func (Debugger) RemoveBreakpoint

func (doDebugger Debugger) RemoveBreakpoint(breakpointID debugger.BreakpointID) (err error)

RemoveBreakpoint removes JavaScript breakpoint.

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

parameters:

  • `breakpointID`

func (Debugger) RestartFrame

func (doDebugger Debugger) RestartFrame(callFrameID debugger.CallFrameID) (retCallFrames []*debugger.CallFrame, retAsyncStackTrace *runtime.StackTrace, retAsyncStackTraceID *runtime.StackTraceID, err error)

RestartFrame restarts particular call frame from the beginning.

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

parameters:

  • `callFrameID`: Call frame identifier to evaluate on.

returns:

  • `retCallFrames`: New stack trace.
  • `retAsyncStackTrace`: Async stack trace, if any.
  • `retAsyncStackTraceID`: Async stack trace, if any.

func (Debugger) Resume

func (doDebugger Debugger) Resume() (err error)

Resume resumes JavaScript execution.

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

func (Debugger) SearchInContent

func (doDebugger Debugger) SearchInContent(scriptID runtime.ScriptID, query string, caseSensitive *bool, isRegex *bool) (retResult []*debugger.SearchMatch, err error)

SearchInContent searches for given string in script content.

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

parameters:

  • `scriptID`: Id of the script to search in.
  • `query`: String to search for.
  • `caseSensitive`: This can be nil. (Optional) If true, search is case sensitive.
  • `isRegex`: This can be nil. (Optional) If true, treats string parameter as regex.

returns:

  • `retResult`: List of search matches.

func (Debugger) SetAsyncCallStackDepth

func (doDebugger Debugger) SetAsyncCallStackDepth(maxDepth int64) (err error)

SetAsyncCallStackDepth enables or disables async call stacks tracking.

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

parameters:

  • `maxDepth`: Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default).

func (Debugger) SetBlackboxPatterns

func (doDebugger Debugger) SetBlackboxPatterns(patterns []string) (err error)

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

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

parameters:

  • `patterns`: Array of regexps that will be used to check script url for blackbox state.

func (Debugger) SetBlackboxedRanges

func (doDebugger Debugger) SetBlackboxedRanges(scriptID runtime.ScriptID, positions []*debugger.ScriptPosition) (err error)

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

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

parameters:

  • `scriptID`: Id of the script.
  • `positions`

func (Debugger) SetBreakpoint

func (doDebugger Debugger) SetBreakpoint(location *debugger.Location, condition *string) (retBreakpointID debugger.BreakpointID, retActualLocation *debugger.Location, err error)

SetBreakpoint sets JavaScript breakpoint at a given location.

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

parameters:

  • `location`: Location to set breakpoint in.
  • `condition`: This can be nil. (Optional) Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true.

returns:

  • `retBreakpointID`: Id of the created breakpoint for further reference.
  • `retActualLocation`: Location this breakpoint resolved into.

func (Debugger) SetBreakpointByURL

func (doDebugger Debugger) SetBreakpointByURL(lineNumber int64, url *string, urlRegex *string, scriptHash *string, columnNumber *int64, condition *string) (retBreakpointID debugger.BreakpointID, retLocations []*debugger.Location, err error)

SetBreakpointByURL sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads.

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

parameters:

  • `lineNumber`: Line number to set breakpoint at.
  • `url`: This can be nil. (Optional) URL of the resources to set breakpoint on.
  • `urlRegex`: This can be nil. (Optional) Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified.
  • `scriptHash`: This can be nil. (Optional) Script hash of the resources to set breakpoint on.
  • `columnNumber`: This can be nil. (Optional) Offset in the line to set breakpoint at.
  • `condition`: This can be nil. (Optional) Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true.

returns:

  • `retBreakpointID`: Id of the created breakpoint for further reference.
  • `retLocations`: List of the locations this breakpoint resolved into upon addition.

func (Debugger) SetBreakpointOnFunctionCall

func (doDebugger Debugger) SetBreakpointOnFunctionCall(objectID runtime.RemoteObjectID, condition *string) (retBreakpointID debugger.BreakpointID, err error)

SetBreakpointOnFunctionCall sets JavaScript breakpoint before each call to the given function. If another function was created from the same source as a given one, calling it will also trigger the breakpoint.

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

parameters:

  • `objectID`: Function object id.
  • `condition`: This can be nil. (Optional) Expression to use as a breakpoint condition. When specified, debugger will stop on the breakpoint if this expression evaluates to true.

returns:

  • `retBreakpointID`: Id of the created breakpoint for further reference.

func (Debugger) SetBreakpointsActive

func (doDebugger Debugger) SetBreakpointsActive(active bool) (err error)

SetBreakpointsActive activates / deactivates all breakpoints on the page.

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

parameters:

  • `active`: New value for breakpoints active state.

func (Debugger) SetInstrumentationBreakpoint

func (doDebugger Debugger) SetInstrumentationBreakpoint(instrumentation debugger.SetInstrumentationBreakpointInstrumentation) (retBreakpointID debugger.BreakpointID, err error)

SetInstrumentationBreakpoint sets instrumentation breakpoint.

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

parameters:

  • `instrumentation`: Instrumentation name.

returns:

  • `retBreakpointID`: Id of the created breakpoint for further reference.

func (Debugger) SetPauseOnExceptions

func (doDebugger Debugger) SetPauseOnExceptions(state debugger.ExceptionsState) (err error)

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

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

parameters:

  • `state`: Pause on exceptions mode.

func (Debugger) SetReturnValue

func (doDebugger Debugger) SetReturnValue(newValue *runtime.CallArgument) (err error)

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

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

parameters:

  • `newValue`: New return value.

func (Debugger) SetScriptSource

func (doDebugger Debugger) SetScriptSource(scriptID runtime.ScriptID, scriptSource string, dryRun *bool) (retCallFrames []*debugger.CallFrame, retStackChanged bool, retAsyncStackTrace *runtime.StackTrace, retAsyncStackTraceID *runtime.StackTraceID, retExceptionDetails *runtime.ExceptionDetails, err error)

SetScriptSource edits JavaScript source live.

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

parameters:

  • `scriptID`: Id of the script to edit.
  • `scriptSource`: New content of the script.
  • `dryRun`: This can be nil. (Optional) If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code.

returns:

  • `retCallFrames`: New stack trace in case editing has happened while VM was stopped.
  • `retStackChanged`: Whether current call stack was modified after applying the changes.
  • `retAsyncStackTrace`: Async stack trace, if any.
  • `retAsyncStackTraceID`: Async stack trace, if any.
  • `retExceptionDetails`: Exception details if any.

func (Debugger) SetSkipAllPauses

func (doDebugger Debugger) SetSkipAllPauses(skip bool) (err error)

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

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

parameters:

  • `skip`: New value for skip pauses state.

func (Debugger) SetVariableValue

func (doDebugger Debugger) SetVariableValue(scopeNumber int64, variableName string, newValue *runtime.CallArgument, callFrameID debugger.CallFrameID) (err error)

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

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

parameters:

  • `scopeNumber`: 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually.
  • `variableName`: Variable name.
  • `newValue`: New variable value.
  • `callFrameID`: Id of callframe that holds variable.

func (Debugger) StepInto

func (doDebugger Debugger) StepInto(breakOnAsyncCall *bool) (err error)

StepInto steps into the function call.

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

parameters:

  • `breakOnAsyncCall`: This can be nil. (Optional) Debugger will pause on the execution of the first async task which was scheduled before next pause.

func (Debugger) StepOut

func (doDebugger Debugger) StepOut() (err error)

StepOut steps out of the function call.

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

func (Debugger) StepOver

func (doDebugger Debugger) StepOver() (err error)

StepOver steps over the statement.

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

type DeviceOrientation

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

DeviceOrientation executes a cdproto command under DeviceOrientation domain.

func (DeviceOrientation) ClearDeviceOrientationOverride

func (doDeviceOrientation DeviceOrientation) ClearDeviceOrientationOverride() (err error)

ClearDeviceOrientationOverride clears the overridden Device Orientation.

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

func (DeviceOrientation) SetDeviceOrientationOverride

func (doDeviceOrientation DeviceOrientation) SetDeviceOrientationOverride(alpha float64, beta float64, gamma float64) (err error)

SetDeviceOrientationOverride overrides the Device Orientation.

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

parameters:

  • `alpha`: Mock alpha
  • `beta`: Mock beta
  • `gamma`: Mock gamma

type Domain

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

Domain executes a cdproto command against a chromedp context.

func Do

func Do(ctxWithExecutor context.Context) Domain

Do makes a Domain that executes a cdproto command against a chromedp context. Set up arg `ctxWithExecutor` with `cdp.WithExecutor()` and `chromedp.FromContext()` beforehand.

func (Domain) Accessibility

func (d Domain) Accessibility() Accessibility

Accessibility executes a cdproto command under Accessibility domain.

func (Domain) Animation

func (d Domain) Animation() Animation

Animation executes a cdproto command under Animation domain.

func (Domain) ApplicationCache

func (d Domain) ApplicationCache() ApplicationCache

ApplicationCache executes a cdproto command under ApplicationCache domain.

func (Domain) Audits

func (d Domain) Audits() Audits

Audits executes a cdproto command under Audits domain.

func (Domain) BackgroundService

func (d Domain) BackgroundService() BackgroundService

BackgroundService executes a cdproto command under BackgroundService domain.

func (Domain) Browser

func (d Domain) Browser() Browser

Browser executes a cdproto command under Browser domain.

func (Domain) CSS

func (d Domain) CSS() CSS

CSS executes a cdproto command under CSS domain.

func (Domain) CacheStorage

func (d Domain) CacheStorage() CacheStorage

CacheStorage executes a cdproto command under CacheStorage domain.

func (Domain) Cast

func (d Domain) Cast() Cast

Cast executes a cdproto command under Cast domain.

func (Domain) DOM

func (d Domain) DOM() DOM

DOM executes a cdproto command under DOM domain.

func (Domain) DOMDebugger

func (d Domain) DOMDebugger() DOMDebugger

DOMDebugger executes a cdproto command under DOMDebugger domain.

func (Domain) DOMSnapshot

func (d Domain) DOMSnapshot() DOMSnapshot

DOMSnapshot executes a cdproto command under DOMSnapshot domain.

func (Domain) DOMStorage

func (d Domain) DOMStorage() DOMStorage

DOMStorage executes a cdproto command under DOMStorage domain.

func (Domain) Database

func (d Domain) Database() Database

Database executes a cdproto command under Database domain.

func (Domain) Debugger

func (d Domain) Debugger() Debugger

Debugger executes a cdproto command under Debugger domain.

func (Domain) DeviceOrientation

func (d Domain) DeviceOrientation() DeviceOrientation

DeviceOrientation executes a cdproto command under DeviceOrientation domain.

func (Domain) Emulation

func (d Domain) Emulation() Emulation

Emulation executes a cdproto command under Emulation domain.

func (Domain) Fetch

func (d Domain) Fetch() Fetch

Fetch executes a cdproto command under Fetch domain.

func (Domain) HAR

func (d Domain) HAR() HAR

HAR executes a cdproto command under HAR domain.

func (Domain) HeadlessExperimental

func (d Domain) HeadlessExperimental() HeadlessExperimental

HeadlessExperimental executes a cdproto command under HeadlessExperimental domain.

func (Domain) HeapProfiler

func (d Domain) HeapProfiler() HeapProfiler

HeapProfiler executes a cdproto command under HeapProfiler domain.

func (Domain) IO

func (d Domain) IO() IO

IO executes a cdproto command under IO domain.

func (Domain) IndexedDB

func (d Domain) IndexedDB() IndexedDB

IndexedDB executes a cdproto command under IndexedDB domain.

func (Domain) Input

func (d Domain) Input() Input

Input executes a cdproto command under Input domain.

func (Domain) Inspector

func (d Domain) Inspector() Inspector

Inspector executes a cdproto command under Inspector domain.

func (Domain) LayerTree

func (d Domain) LayerTree() LayerTree

LayerTree executes a cdproto command under LayerTree domain.

func (Domain) Log

func (d Domain) Log() Log

Log executes a cdproto command under Log domain.

func (Domain) Media

func (d Domain) Media() Media

Media executes a cdproto command under Media domain.

func (Domain) Memory

func (d Domain) Memory() Memory

Memory executes a cdproto command under Memory domain.

func (Domain) Network

func (d Domain) Network() Network

Network executes a cdproto command under Network domain.

func (Domain) Overlay

func (d Domain) Overlay() Overlay

Overlay executes a cdproto command under Overlay domain.

func (Domain) Page

func (d Domain) Page() Page

Page executes a cdproto command under Page domain.

func (Domain) Performance

func (d Domain) Performance() Performance

Performance executes a cdproto command under Performance domain.

func (Domain) Profiler

func (d Domain) Profiler() Profiler

Profiler executes a cdproto command under Profiler domain.

func (Domain) Runtime

func (d Domain) Runtime() Runtime

Runtime executes a cdproto command under Runtime domain.

func (Domain) Security

func (d Domain) Security() Security

Security executes a cdproto command under Security domain.

func (Domain) ServiceWorker

func (d Domain) ServiceWorker() ServiceWorker

ServiceWorker executes a cdproto command under ServiceWorker domain.

func (Domain) Storage

func (d Domain) Storage() Storage

Storage executes a cdproto command under Storage domain.

func (Domain) SystemInfo

func (d Domain) SystemInfo() SystemInfo

SystemInfo executes a cdproto command under SystemInfo domain.

func (Domain) Target

func (d Domain) Target() Target

Target executes a cdproto command under Target domain.

func (Domain) Tethering

func (d Domain) Tethering() Tethering

Tethering executes a cdproto command under Tethering domain.

func (Domain) Tracing

func (d Domain) Tracing() Tracing

Tracing executes a cdproto command under Tracing domain.

func (Domain) WebAudio

func (d Domain) WebAudio() WebAudio

WebAudio executes a cdproto command under WebAudio domain.

func (Domain) WebAuthn

func (d Domain) WebAuthn() WebAuthn

WebAuthn executes a cdproto command under WebAuthn domain.

type Emulation

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

Emulation executes a cdproto command under Emulation domain.

func (Emulation) CanEmulate

func (doEmulation Emulation) CanEmulate() (retResult bool, err error)

CanEmulate tells whether emulation is supported.

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

returns:

  • `retResult`: True if emulation is supported.

func (Emulation) ClearDeviceMetricsOverride

func (doEmulation Emulation) ClearDeviceMetricsOverride() (err error)

ClearDeviceMetricsOverride clears the overridden device metrics.

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

func (Emulation) ClearGeolocationOverride

func (doEmulation Emulation) ClearGeolocationOverride() (err error)

ClearGeolocationOverride clears the overridden Geolocation Position and Error.

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

func (Emulation) ResetPageScaleFactor

func (doEmulation Emulation) ResetPageScaleFactor() (err error)

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

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

func (Emulation) SetCPUThrottlingRate

func (doEmulation Emulation) SetCPUThrottlingRate(rate float64) (err error)

SetCPUThrottlingRate enables CPU throttling to emulate slow CPUs.

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

parameters:

  • `rate`: Throttling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc).

func (Emulation) SetDefaultBackgroundColorOverride

func (doEmulation Emulation) SetDefaultBackgroundColorOverride(color *cdp.RGBA) (err error)

SetDefaultBackgroundColorOverride sets or clears an override of the default background color of the frame. This override is used if the content does not specify one.

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

parameters:

  • `color`: This can be nil. (Optional) RGBA of the default background color. If not specified, any existing override will be cleared.

func (Emulation) SetDeviceMetricsOverride

func (doEmulation Emulation) SetDeviceMetricsOverride(width int64, height int64, deviceScaleFactor float64, mobile bool, scale *float64, screenWidth *int64, screenHeight *int64, positionX *int64, positionY *int64, dontSetVisibleSize *bool, screenOrientation *emulation.ScreenOrientation, viewport *page.Viewport) (err error)

SetDeviceMetricsOverride overrides the values of device screen dimensions (window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media query results).

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

parameters:

  • `width`: Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.
  • `height`: Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.
  • `deviceScaleFactor`: Overriding device scale factor value. 0 disables the override.
  • `mobile`: Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more.
  • `scale`: This can be nil. (Optional) Scale to apply to resulting view image.
  • `screenWidth`: This can be nil. (Optional) Overriding screen width value in pixels (minimum 0, maximum 10000000).
  • `screenHeight`: This can be nil. (Optional) Overriding screen height value in pixels (minimum 0, maximum 10000000).
  • `positionX`: This can be nil. (Optional) Overriding view X position on screen in pixels (minimum 0, maximum 10000000).
  • `positionY`: This can be nil. (Optional) Overriding view Y position on screen in pixels (minimum 0, maximum 10000000).
  • `dontSetVisibleSize`: This can be nil. (Optional) Do not set visible view size, rely upon explicit setVisibleSize call.
  • `screenOrientation`: This can be nil. (Optional) Screen orientation override.
  • `viewport`: This can be nil. (Optional) If set, the visible area of the page will be overridden to this viewport. This viewport change is not observed by the page, e.g. viewport-relative elements do not change positions.

func (Emulation) SetDocumentCookieDisabled

func (doEmulation Emulation) SetDocumentCookieDisabled(disabled bool) (err error)

SetDocumentCookieDisabled [no description].

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

parameters:

  • `disabled`: Whether document.coookie API should be disabled.

func (Emulation) SetEmitTouchEventsForMouse

func (doEmulation Emulation) SetEmitTouchEventsForMouse(enabled bool, configuration *emulation.SetEmitTouchEventsForMouseConfiguration) (err error)

SetEmitTouchEventsForMouse [no description].

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

parameters:

  • `enabled`: Whether touch emulation based on mouse input should be enabled.
  • `configuration`: This can be nil. (Optional) Touch/gesture events configuration. Default: current platform.

func (Emulation) SetEmulatedMedia

func (doEmulation Emulation) SetEmulatedMedia(media *string, features []*emulation.MediaFeature) (err error)

SetEmulatedMedia emulates the given media type or media feature for CSS media queries.

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

parameters:

  • `media`: This can be nil. (Optional) Media type to emulate. Empty string disables the override.
  • `features`: This can be nil. (Optional) Media features to emulate.

func (Emulation) SetFocusEmulationEnabled

func (doEmulation Emulation) SetFocusEmulationEnabled(enabled bool) (err error)

SetFocusEmulationEnabled enables or disables simulating a focused and active page.

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

parameters:

  • `enabled`: Whether to enable to disable focus emulation.

func (Emulation) SetGeolocationOverride

func (doEmulation Emulation) SetGeolocationOverride(latitude *float64, longitude *float64, accuracy *float64) (err error)

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

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

parameters:

  • `latitude`: This can be nil. (Optional) Mock latitude
  • `longitude`: This can be nil. (Optional) Mock longitude
  • `accuracy`: This can be nil. (Optional) Mock accuracy

func (Emulation) SetPageScaleFactor

func (doEmulation Emulation) SetPageScaleFactor(pageScaleFactor float64) (err error)

SetPageScaleFactor sets a specified page scale factor.

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

parameters:

  • `pageScaleFactor`: Page scale factor.

func (Emulation) SetScriptExecutionDisabled

func (doEmulation Emulation) SetScriptExecutionDisabled(value bool) (err error)

SetScriptExecutionDisabled switches script execution in the page.

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

parameters:

  • `value`: Whether script execution should be disabled in the page.

func (Emulation) SetScrollbarsHidden

func (doEmulation Emulation) SetScrollbarsHidden(hidden bool) (err error)

SetScrollbarsHidden [no description].

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

parameters:

  • `hidden`: Whether scrollbars should be always hidden.

func (Emulation) SetTimezoneOverride

func (doEmulation Emulation) SetTimezoneOverride(timezoneID string) (err error)

SetTimezoneOverride overrides default host system timezone with the specified one.

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

parameters:

  • `timezoneID`: The timezone identifier. If empty, disables the override and restores default host system timezone.

func (Emulation) SetTouchEmulationEnabled

func (doEmulation Emulation) SetTouchEmulationEnabled(enabled bool, maxTouchPoints *int64) (err error)

SetTouchEmulationEnabled enables touch on platforms which do not support them.

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

parameters:

  • `enabled`: Whether the touch event emulation should be enabled.
  • `maxTouchPoints`: This can be nil. (Optional) Maximum touch points supported. Defaults to one.

func (Emulation) SetUserAgentOverride

func (doEmulation Emulation) SetUserAgentOverride(userAgent string, acceptLanguage *string, platform *string) (err error)

SetUserAgentOverride allows overriding user agent with the given string.

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

parameters:

  • `userAgent`: User agent to use.
  • `acceptLanguage`: This can be nil. (Optional) Browser langugage to emulate.
  • `platform`: This can be nil. (Optional) The platform navigator.platform should return.

func (Emulation) SetVirtualTimePolicy

func (doEmulation Emulation) SetVirtualTimePolicy(policy emulation.VirtualTimePolicy, budget *float64, maxVirtualTimeTaskStarvationCount *int64, waitForNavigation *bool, initialVirtualTime *cdp.TimeSinceEpoch) (retVirtualTimeTicksBase float64, err error)

SetVirtualTimePolicy turns on virtual time for all frames (replacing real-time with a synthetic time source) and sets the current virtual time policy. Note this supersedes any previous time budget.

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

parameters:

  • `policy`
  • `budget`: This can be nil. (Optional) If set, after this many virtual milliseconds have elapsed virtual time will be paused and a virtualTimeBudgetExpired event is sent.
  • `maxVirtualTimeTaskStarvationCount`: This can be nil. (Optional) If set this specifies the maximum number of tasks that can be run before virtual is forced forwards to prevent deadlock.
  • `waitForNavigation`: This can be nil. (Optional) If set the virtual time policy change should be deferred until any frame starts navigating. Note any previous deferred policy change is superseded.
  • `initialVirtualTime`: This can be nil. (Optional) If set, base::Time::Now will be overridden to initially return this value.

returns:

  • `retVirtualTimeTicksBase`: Absolute timestamp at which virtual time was first enabled (up time in milliseconds).

type Fetch

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

Fetch executes a cdproto command under Fetch domain.

func (Fetch) ContinueRequest

func (doFetch Fetch) ContinueRequest(requestID fetch.RequestID, url *string, method *string, postData *string, headers []*fetch.HeaderEntry) (err error)

ContinueRequest continues the request, optionally modifying some of its parameters.

See: https://chromedevtools.github.io/devtools-protocol/tot/Fetch#method-continueRequest

parameters:

  • `requestID`: An id the client received in requestPaused event.
  • `url`: This can be nil. (Optional) If set, the request url will be modified in a way that's not observable by page.
  • `method`: This can be nil. (Optional) If set, the request method is overridden.
  • `postData`: This can be nil. (Optional) If set, overrides the post data in the request.
  • `headers`: This can be nil. (Optional) If set, overrides the request headrts.

func (Fetch) ContinueWithAuth

func (doFetch Fetch) ContinueWithAuth(requestID fetch.RequestID, authChallengeResponse *fetch.AuthChallengeResponse) (err error)

ContinueWithAuth continues a request supplying authChallengeResponse following authRequired event.

See: https://chromedevtools.github.io/devtools-protocol/tot/Fetch#method-continueWithAuth

parameters:

  • `requestID`: An id the client received in authRequired event.
  • `authChallengeResponse`: Response to with an authChallenge.

func (Fetch) Disable

func (doFetch Fetch) Disable() (err error)

Disable disables the fetch domain.

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

func (Fetch) Enable

func (doFetch Fetch) Enable(patterns []*fetch.RequestPattern, handleAuthRequests *bool) (err error)

Enable enables issuing of requestPaused events. A request will be paused until client calls one of failRequest, fulfillRequest or continueRequest/continueWithAuth.

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

parameters:

  • `patterns`: This can be nil. (Optional) If specified, only requests matching any of these patterns will produce fetchRequested event and will be paused until clients response. If not set, all requests will be affected.
  • `handleAuthRequests`: This can be nil. (Optional) If true, authRequired events will be issued and requests will be paused expecting a call to continueWithAuth.

func (Fetch) FailRequest

func (doFetch Fetch) FailRequest(requestID fetch.RequestID, errorReason network.ErrorReason) (err error)

FailRequest causes the request to fail with specified reason.

See: https://chromedevtools.github.io/devtools-protocol/tot/Fetch#method-failRequest

parameters:

  • `requestID`: An id the client received in requestPaused event.
  • `errorReason`: Causes the request to fail with the given reason.

func (Fetch) FulfillRequest

func (doFetch Fetch) FulfillRequest(requestID fetch.RequestID, responseCode int64, responseHeaders []*fetch.HeaderEntry, binaryResponseHeaders *string, body *string, responsePhrase *string) (err error)

FulfillRequest provides response to the request.

See: https://chromedevtools.github.io/devtools-protocol/tot/Fetch#method-fulfillRequest

parameters:

  • `requestID`: An id the client received in requestPaused event.
  • `responseCode`: An HTTP response code.
  • `responseHeaders`: This can be nil. (Optional) Response headers.
  • `binaryResponseHeaders`: This can be nil. (Optional) Alternative way of specifying response headers as a \0-separated series of name: value pairs. Prefer the above method unless you need to represent some non-UTF8 values that can't be transmitted over the protocol as text.
  • `body`: This can be nil. (Optional) A response body.
  • `responsePhrase`: This can be nil. (Optional) A textual representation of responseCode. If absent, a standard phrase matching responseCode is used.

func (Fetch) GetResponseBody

func (doFetch Fetch) GetResponseBody(requestID fetch.RequestID) (retBody []byte, err error)

GetResponseBody causes the body of the response to be received from the server and returned as a single string. May only be issued for a request that is paused in the Response stage and is mutually exclusive with takeResponseBodyForInterceptionAsStream. Calling other methods that affect the request or disabling fetch domain before body is received results in an undefined behavior.

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

parameters:

  • `requestID`: Identifier for the intercepted request to get body for.

returns:

  • `retBody`: Response body.

func (Fetch) TakeResponseBodyAsStream

func (doFetch Fetch) TakeResponseBodyAsStream(requestID fetch.RequestID) (retStream io.StreamHandle, err error)

TakeResponseBodyAsStream returns a handle to the stream representing the response body. The request must be paused in the HeadersReceived stage. Note that after this command the request can't be continued as is -- client either needs to cancel it or to provide the response body. The stream only supports sequential read, IO.read will fail if the position is specified. This method is mutually exclusive with getResponseBody. Calling other methods that affect the request or disabling fetch domain before body is received results in an undefined behavior.

See: https://chromedevtools.github.io/devtools-protocol/tot/Fetch#method-takeResponseBodyAsStream

parameters:

  • `requestID`

returns:

  • `retStream`

type HAR

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

HAR executes a cdproto command under HAR domain.

type HeadlessExperimental

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

HeadlessExperimental executes a cdproto command under HeadlessExperimental domain.

func (HeadlessExperimental) BeginFrame

func (doHeadlessExperimental HeadlessExperimental) BeginFrame(frameTimeTicks *float64, interval *float64, noDisplayUpdates *bool, screenshot *headlessexperimental.ScreenshotParams) (retHasDamage bool, retScreenshotData []byte, err error)

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

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

parameters:

  • `frameTimeTicks`: This can be nil. (Optional) Timestamp of this BeginFrame in Renderer TimeTicks (milliseconds of uptime). If not set, the current time will be used.
  • `interval`: This can be nil. (Optional) The interval between BeginFrames that is reported to the compositor, in milliseconds. Defaults to a 60 frames/second interval, i.e. about 16.666 milliseconds.
  • `noDisplayUpdates`: This can be nil. (Optional) Whether updates should not be committed and drawn onto the display. False by default. If true, only side effects of the BeginFrame will be run, such as layout and animations, but any visual updates may not be visible on the display or in screenshots.
  • `screenshot`: This can be nil. (Optional) If set, a screenshot of the frame will be captured and returned in the response. Otherwise, no screenshot will be captured. Note that capturing a screenshot can fail, for example, during renderer initialization. In such a case, no screenshot data will be returned.

returns:

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

func (HeadlessExperimental) Disable

func (doHeadlessExperimental HeadlessExperimental) Disable() (err error)

Disable disables headless events for the target.

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

func (HeadlessExperimental) Enable

func (doHeadlessExperimental HeadlessExperimental) Enable() (err error)

Enable enables headless events for the target.

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

type HeapProfiler

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

HeapProfiler executes a cdproto command under HeapProfiler domain.

func (HeapProfiler) AddInspectedHeapObject

func (doHeapProfiler HeapProfiler) AddInspectedHeapObject(heapObjectID heapprofiler.HeapSnapshotObjectID) (err error)

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

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

parameters:

  • `heapObjectID`: Heap snapshot object id to be accessible by means of $x command line API.

func (HeapProfiler) CollectGarbage

func (doHeapProfiler HeapProfiler) CollectGarbage() (err error)

CollectGarbage [no description].

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

func (HeapProfiler) Disable

func (doHeapProfiler HeapProfiler) Disable() (err error)

Disable [no description].

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

func (HeapProfiler) Enable

func (doHeapProfiler HeapProfiler) Enable() (err error)

Enable [no description].

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

func (HeapProfiler) GetHeapObjectID

func (doHeapProfiler HeapProfiler) GetHeapObjectID(objectID runtime.RemoteObjectID) (retHeapSnapshotObjectID heapprofiler.HeapSnapshotObjectID, err error)

GetHeapObjectID [no description].

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

parameters:

  • `objectID`: Identifier of the object to get heap object id for.

returns:

  • `retHeapSnapshotObjectID`: Id of the heap snapshot object corresponding to the passed remote object id.

func (HeapProfiler) GetObjectByHeapObjectID

func (doHeapProfiler HeapProfiler) GetObjectByHeapObjectID(objectID heapprofiler.HeapSnapshotObjectID, objectGroup *string) (retResult *runtime.RemoteObject, err error)

GetObjectByHeapObjectID [no description].

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

parameters:

  • `objectID`
  • `objectGroup`: This can be nil. (Optional) Symbolic group name that can be used to release multiple objects.

returns:

  • `retResult`: Evaluation result.

func (HeapProfiler) GetSamplingProfile

func (doHeapProfiler HeapProfiler) GetSamplingProfile() (retProfile *heapprofiler.SamplingHeapProfile, err error)

GetSamplingProfile [no description].

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

returns:

  • `retProfile`: Return the sampling profile being collected.

func (HeapProfiler) StartSampling

func (doHeapProfiler HeapProfiler) StartSampling(samplingInterval *float64) (err error)

StartSampling [no description].

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

parameters:

  • `samplingInterval`: This can be nil. (Optional) Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes.

func (HeapProfiler) StartTrackingHeapObjects

func (doHeapProfiler HeapProfiler) StartTrackingHeapObjects(trackAllocations *bool) (err error)

StartTrackingHeapObjects [no description].

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

parameters:

  • `trackAllocations`

func (HeapProfiler) StopSampling

func (doHeapProfiler HeapProfiler) StopSampling() (retProfile *heapprofiler.SamplingHeapProfile, err error)

StopSampling [no description].

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

returns:

  • `retProfile`: Recorded sampling heap profile.

func (HeapProfiler) StopTrackingHeapObjects

func (doHeapProfiler HeapProfiler) StopTrackingHeapObjects(reportProgress *bool, treatGlobalObjectsAsRoots *bool) (err error)

StopTrackingHeapObjects [no description].

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

parameters:

  • `reportProgress`: This can be nil. (Optional) If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped.
  • `treatGlobalObjectsAsRoots`

func (HeapProfiler) TakeHeapSnapshot

func (doHeapProfiler HeapProfiler) TakeHeapSnapshot(reportProgress *bool, treatGlobalObjectsAsRoots *bool) (err error)

TakeHeapSnapshot [no description].

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

parameters:

  • `reportProgress`: This can be nil. (Optional) If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken.
  • `treatGlobalObjectsAsRoots`: This can be nil. (Optional) If true, a raw snapshot without artificial roots will be generated

type IO

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

IO executes a cdproto command under IO domain.

func (IO) Close

func (doIO IO) Close(handle io.StreamHandle) (err error)

Close close the stream, discard any temporary backing storage.

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

parameters:

  • `handle`: Handle of the stream to close.

func (IO) Read

func (doIO IO) Read(handle io.StreamHandle, offset *int64, size *int64) (retData string, retEOF bool, err error)

Read read a chunk of the stream.

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

parameters:

  • `handle`: Handle of the stream to read.
  • `offset`: This can be nil. (Optional) Seek to the specified offset before reading (if not specificed, proceed with offset following the last read). Some types of streams may only support sequential reads.
  • `size`: This can be nil. (Optional) Maximum number of bytes to read (left upon the agent discretion if not specified).

returns:

  • `retData`: Data that were read.
  • `retEOF`: Set if the end-of-file condition occurred while reading.

func (IO) ResolveBlob

func (doIO IO) ResolveBlob(objectID runtime.RemoteObjectID) (retUUID string, err error)

ResolveBlob return UUID of Blob object specified by a remote object id.

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

parameters:

  • `objectID`: Object id of a Blob object wrapper.

returns:

  • `retUUID`: UUID of the specified Blob.

type IndexedDB

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

IndexedDB executes a cdproto command under IndexedDB domain.

func (IndexedDB) ClearObjectStore

func (doIndexedDB IndexedDB) ClearObjectStore(securityOrigin string, databaseName string, objectStoreName string) (err error)

ClearObjectStore clears all entries from an object store.

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

parameters:

  • `securityOrigin`: Security origin.
  • `databaseName`: Database name.
  • `objectStoreName`: Object store name.

func (IndexedDB) DeleteDatabase

func (doIndexedDB IndexedDB) DeleteDatabase(securityOrigin string, databaseName string) (err error)

DeleteDatabase deletes a database.

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

parameters:

  • `securityOrigin`: Security origin.
  • `databaseName`: Database name.

func (IndexedDB) DeleteObjectStoreEntries

func (doIndexedDB IndexedDB) DeleteObjectStoreEntries(securityOrigin string, databaseName string, objectStoreName string, keyRange *indexeddb.KeyRange) (err error)

DeleteObjectStoreEntries delete a range of entries from an object store.

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

parameters:

  • `securityOrigin`
  • `databaseName`
  • `objectStoreName`
  • `keyRange`: Range of entry keys to delete

func (IndexedDB) Disable

func (doIndexedDB IndexedDB) Disable() (err error)

Disable disables events from backend.

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

func (IndexedDB) Enable

func (doIndexedDB IndexedDB) Enable() (err error)

Enable enables events from backend.

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

func (IndexedDB) GetMetadata

func (doIndexedDB IndexedDB) GetMetadata(securityOrigin string, databaseName string, objectStoreName string) (retEntriesCount float64, retKeyGeneratorValue float64, err error)

GetMetadata gets metadata of an object store.

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

parameters:

  • `securityOrigin`: Security origin.
  • `databaseName`: Database name.
  • `objectStoreName`: Object store name.

returns:

  • `retEntriesCount`: the entries count
  • `retKeyGeneratorValue`: the current value of key generator, to become the next inserted key into the object store. Valid if objectStore.autoIncrement is true.

func (IndexedDB) RequestData

func (doIndexedDB IndexedDB) RequestData(securityOrigin string, databaseName string, objectStoreName string, indexName string, skipCount int64, pageSize int64, keyRange *indexeddb.KeyRange) (retObjectStoreDataEntries []*indexeddb.DataEntry, retHasMore bool, err error)

RequestData requests data from object store or index.

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

parameters:

  • `securityOrigin`: Security origin.
  • `databaseName`: Database name.
  • `objectStoreName`: Object store name.
  • `indexName`: Index name, empty string for object store data requests.
  • `skipCount`: Number of records to skip.
  • `pageSize`: Number of records to fetch.
  • `keyRange`: This can be nil. (Optional) Key range.

returns:

  • `retObjectStoreDataEntries`: Array of object store data entries.
  • `retHasMore`: If true, there are more entries to fetch in the given range.

func (IndexedDB) RequestDatabase

func (doIndexedDB IndexedDB) RequestDatabase(securityOrigin string, databaseName string) (retDatabaseWithObjectStores *indexeddb.DatabaseWithObjectStores, err error)

RequestDatabase requests database with given name in given frame.

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

parameters:

  • `securityOrigin`: Security origin.
  • `databaseName`: Database name.

returns:

  • `retDatabaseWithObjectStores`: Database with an array of object stores.

func (IndexedDB) RequestDatabaseNames

func (doIndexedDB IndexedDB) RequestDatabaseNames(securityOrigin string) (retDatabaseNames []string, err error)

RequestDatabaseNames requests database names for given security origin.

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

parameters:

  • `securityOrigin`: Security origin.

returns:

  • `retDatabaseNames`: Database names for origin.

type Input

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

Input executes a cdproto command under Input domain.

func (Input) DispatchKeyEvent

func (doInput Input) DispatchKeyEvent(typeVal input.KeyType, modifiers *input.Modifier, timestamp *input.TimeSinceEpoch, text *string, unmodifiedText *string, keyIdentifier *string, code *string, key *string, windowsVirtualKeyCode *int64, nativeVirtualKeyCode *int64, autoRepeat *bool, isKeypad *bool, isSystemKey *bool, location *int64) (err error)

DispatchKeyEvent dispatches a key event to the page.

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

parameters:

  • `type`: Type of the key event.
  • `modifiers`: This can be nil. (Optional) Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
  • `timestamp`: This can be nil. (Optional) Time at which the event occurred.
  • `text`: This can be nil. (Optional) Text as generated by processing a virtual key code with a keyboard layout. Not needed for for keyUp and rawKeyDown events (default: "")
  • `unmodifiedText`: This can be nil. (Optional) Text that would have been generated by the keyboard if no modifiers were pressed (except for shift). Useful for shortcut (accelerator) key handling (default: "").
  • `keyIdentifier`: This can be nil. (Optional) Unique key identifier (e.g., 'U+0041') (default: "").
  • `code`: This can be nil. (Optional) Unique DOM defined string value for each physical key (e.g., 'KeyA') (default: "").
  • `key`: This can be nil. (Optional) Unique DOM defined string value describing the meaning of the key in the context of active modifiers, keyboard layout, etc (e.g., 'AltGr') (default: "").
  • `windowsVirtualKeyCode`: This can be nil. (Optional) Windows virtual key code (default: 0).
  • `nativeVirtualKeyCode`: This can be nil. (Optional) Native virtual key code (default: 0).
  • `autoRepeat`: This can be nil. (Optional) Whether the event was generated from auto repeat (default: false).
  • `isKeypad`: This can be nil. (Optional) Whether the event was generated from the keypad (default: false).
  • `isSystemKey`: This can be nil. (Optional) Whether the event was a system key event (default: false).
  • `location`: This can be nil. (Optional) Whether the event was from the left or right side of the keyboard. 1=Left, 2=Right (default: 0).

func (Input) DispatchMouseEvent

func (doInput Input) DispatchMouseEvent(typeVal input.MouseType, x float64, y float64, modifiers *input.Modifier, timestamp *input.TimeSinceEpoch, button *input.MouseButton, buttons *int64, clickCount *int64, deltaX *float64, deltaY *float64, pointerType *input.DispatchMouseEventPointerType) (err error)

DispatchMouseEvent dispatches a mouse event to the page.

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

parameters:

  • `type`: Type of the mouse event.
  • `x`: X coordinate of the event relative to the main frame's viewport in CSS pixels.
  • `y`: Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport.
  • `modifiers`: This can be nil. (Optional) Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
  • `timestamp`: This can be nil. (Optional) Time at which the event occurred.
  • `button`: This can be nil. (Optional) Mouse button (default: "none").
  • `buttons`: This can be nil. (Optional) A number indicating which buttons are pressed on the mouse when a mouse event is triggered. Left=1, Right=2, Middle=4, Back=8, Forward=16, None=0.
  • `clickCount`: This can be nil. (Optional) Number of times the mouse button was clicked (default: 0).
  • `deltaX`: This can be nil. (Optional) X delta in CSS pixels for mouse wheel event (default: 0).
  • `deltaY`: This can be nil. (Optional) Y delta in CSS pixels for mouse wheel event (default: 0).
  • `pointerType`: This can be nil. (Optional) Pointer type (default: "mouse").

func (Input) DispatchTouchEvent

func (doInput Input) DispatchTouchEvent(typeVal input.TouchType, touchPoints []*input.TouchPoint, modifiers *input.Modifier, timestamp *input.TimeSinceEpoch) (err error)

DispatchTouchEvent dispatches a touch event to the page.

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

parameters:

  • `type`: Type of the touch event. TouchEnd and TouchCancel must not contain any touch points, while TouchStart and TouchMove must contains at least one.
  • `touchPoints`: Active touch points on the touch device. One event per any changed point (compared to previous touch event in a sequence) is generated, emulating pressing/moving/releasing points one by one.
  • `modifiers`: This can be nil. (Optional) Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
  • `timestamp`: This can be nil. (Optional) Time at which the event occurred.

func (Input) EmulateTouchFromMouseEvent

func (doInput Input) EmulateTouchFromMouseEvent(typeVal input.MouseType, x int64, y int64, button input.MouseButton, timestamp *input.TimeSinceEpoch, deltaX *float64, deltaY *float64, modifiers *input.Modifier, clickCount *int64) (err error)

EmulateTouchFromMouseEvent emulates touch event from the mouse event parameters.

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

parameters:

  • `type`: Type of the mouse event.
  • `x`: X coordinate of the mouse pointer in DIP.
  • `y`: Y coordinate of the mouse pointer in DIP.
  • `button`: Mouse button. Only "none", "left", "right" are supported.
  • `timestamp`: This can be nil. (Optional) Time at which the event occurred (default: current time).
  • `deltaX`: This can be nil. (Optional) X delta in DIP for mouse wheel event (default: 0).
  • `deltaY`: This can be nil. (Optional) Y delta in DIP for mouse wheel event (default: 0).
  • `modifiers`: This can be nil. (Optional) Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
  • `clickCount`: This can be nil. (Optional) Number of times the mouse button was clicked (default: 0).

func (Input) InsertText

func (doInput Input) InsertText(text string) (err error)

InsertText this method emulates inserting text that doesn't come from a key press, for example an emoji keyboard or an IME.

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

parameters:

  • `text`: The text to insert.

func (Input) SetIgnoreInputEvents

func (doInput Input) SetIgnoreInputEvents(ignore bool) (err error)

SetIgnoreInputEvents ignores input events (useful while auditing page).

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

parameters:

  • `ignore`: Ignores input events processing when set to true.

func (Input) SynthesizePinchGesture

func (doInput Input) SynthesizePinchGesture(x float64, y float64, scaleFactor float64, relativeSpeed *int64, gestureSourceType *input.GestureSourceType) (err error)

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

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

parameters:

  • `x`: X coordinate of the start of the gesture in CSS pixels.
  • `y`: Y coordinate of the start of the gesture in CSS pixels.
  • `scaleFactor`: Relative scale factor after zooming (>1.0 zooms in, <1.0 zooms out).
  • `relativeSpeed`: This can be nil. (Optional) Relative pointer speed in pixels per second (default: 800).
  • `gestureSourceType`: This can be nil. (Optional) Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type).

func (Input) SynthesizeScrollGesture

func (doInput Input) SynthesizeScrollGesture(x float64, y float64, xDistance *float64, yDistance *float64, xOverscroll *float64, yOverscroll *float64, preventFling *bool, speed *int64, gestureSourceType *input.GestureSourceType, repeatCount *int64, repeatDelayMs *int64, interactionMarkerName *string) (err error)

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

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

parameters:

  • `x`: X coordinate of the start of the gesture in CSS pixels.
  • `y`: Y coordinate of the start of the gesture in CSS pixels.
  • `xDistance`: This can be nil. (Optional) The distance to scroll along the X axis (positive to scroll left).
  • `yDistance`: This can be nil. (Optional) The distance to scroll along the Y axis (positive to scroll up).
  • `xOverscroll`: This can be nil. (Optional) The number of additional pixels to scroll back along the X axis, in addition to the given distance.
  • `yOverscroll`: This can be nil. (Optional) The number of additional pixels to scroll back along the Y axis, in addition to the given distance.
  • `preventFling`: This can be nil. (Optional) Prevent fling (default: true).
  • `speed`: This can be nil. (Optional) Swipe speed in pixels per second (default: 800).
  • `gestureSourceType`: This can be nil. (Optional) Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type).
  • `repeatCount`: This can be nil. (Optional) The number of times to repeat the gesture (default: 0).
  • `repeatDelayMs`: This can be nil. (Optional) The number of milliseconds delay between each repeat. (default: 250).
  • `interactionMarkerName`: This can be nil. (Optional) The name of the interaction markers to generate, if not empty (default: "").

func (Input) SynthesizeTapGesture

func (doInput Input) SynthesizeTapGesture(x float64, y float64, duration *int64, tapCount *int64, gestureSourceType *input.GestureSourceType) (err error)

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

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

parameters:

  • `x`: X coordinate of the start of the gesture in CSS pixels.
  • `y`: Y coordinate of the start of the gesture in CSS pixels.
  • `duration`: This can be nil. (Optional) Duration between touchdown and touchup events in ms (default: 50).
  • `tapCount`: This can be nil. (Optional) Number of times to perform the tap (e.g. 2 for double tap, default: 1).
  • `gestureSourceType`: This can be nil. (Optional) Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type).

type Inspector

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

Inspector executes a cdproto command under Inspector domain.

func (Inspector) Disable

func (doInspector Inspector) Disable() (err error)

Disable disables inspector domain notifications.

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

func (Inspector) Enable

func (doInspector Inspector) Enable() (err error)

Enable enables inspector domain notifications.

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

type LayerTree

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

LayerTree executes a cdproto command under LayerTree domain.

func (LayerTree) CompositingReasons

func (doLayerTree LayerTree) CompositingReasons(layerID layertree.LayerID) (retCompositingReasonIds []string, err error)

CompositingReasons provides the reasons why the given layer was composited.

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

parameters:

  • `layerID`: The id of the layer for which we want to get the reasons it was composited.

returns:

  • `retCompositingReasonIds`: A list of strings specifying reason IDs for the given layer to become composited.

func (LayerTree) Disable

func (doLayerTree LayerTree) Disable() (err error)

Disable disables compositing tree inspection.

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

func (LayerTree) Enable

func (doLayerTree LayerTree) Enable() (err error)

Enable enables compositing tree inspection.

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

func (LayerTree) LoadSnapshot

func (doLayerTree LayerTree) LoadSnapshot(tiles []*layertree.PictureTile) (retSnapshotID layertree.SnapshotID, err error)

LoadSnapshot returns the snapshot identifier.

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

parameters:

  • `tiles`: An array of tiles composing the snapshot.

returns:

  • `retSnapshotID`: The id of the snapshot.

func (LayerTree) MakeSnapshot

func (doLayerTree LayerTree) MakeSnapshot(layerID layertree.LayerID) (retSnapshotID layertree.SnapshotID, err error)

MakeSnapshot returns the layer snapshot identifier.

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

parameters:

  • `layerID`: The id of the layer.

returns:

  • `retSnapshotID`: The id of the layer snapshot.

func (LayerTree) ProfileSnapshot

func (doLayerTree LayerTree) ProfileSnapshot(snapshotID layertree.SnapshotID, minRepeatCount *int64, minDuration *float64, clipRect *dom.Rect) (retTimings []layertree.PaintProfile, err error)

ProfileSnapshot [no description].

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

parameters:

  • `snapshotID`: The id of the layer snapshot.
  • `minRepeatCount`: This can be nil. (Optional) The maximum number of times to replay the snapshot (1, if not specified).
  • `minDuration`: This can be nil. (Optional) The minimum duration (in seconds) to replay the snapshot.
  • `clipRect`: This can be nil. (Optional) The clip rectangle to apply when replaying the snapshot.

returns:

  • `retTimings`: The array of paint profiles, one per run.

func (LayerTree) ReleaseSnapshot

func (doLayerTree LayerTree) ReleaseSnapshot(snapshotID layertree.SnapshotID) (err error)

ReleaseSnapshot releases layer snapshot captured by the back-end.

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

parameters:

  • `snapshotID`: The id of the layer snapshot.

func (LayerTree) ReplaySnapshot

func (doLayerTree LayerTree) ReplaySnapshot(snapshotID layertree.SnapshotID, fromStep *int64, toStep *int64, scale *float64) (retDataURL string, err error)

ReplaySnapshot replays the layer snapshot and returns the resulting bitmap.

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

parameters:

  • `snapshotID`: The id of the layer snapshot.
  • `fromStep`: This can be nil. (Optional) The first step to replay from (replay from the very start if not specified).
  • `toStep`: This can be nil. (Optional) The last step to replay to (replay till the end if not specified).
  • `scale`: This can be nil. (Optional) The scale to apply while replaying (defaults to 1).

returns:

  • `retDataURL`: A data: URL for resulting image.

func (LayerTree) SnapshotCommandLog

func (doLayerTree LayerTree) SnapshotCommandLog(snapshotID layertree.SnapshotID) (retCommandLog []easyjson.RawMessage, err error)

SnapshotCommandLog replays the layer snapshot and returns canvas log.

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

parameters:

  • `snapshotID`: The id of the layer snapshot.

returns:

  • `retCommandLog`: The array of canvas function calls.

type Log

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

Log executes a cdproto command under Log domain.

func (Log) Clear

func (doLog Log) Clear() (err error)

Clear clears the log.

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

func (Log) Disable

func (doLog Log) Disable() (err error)

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

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

func (Log) Enable

func (doLog Log) Enable() (err error)

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

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

func (Log) StartViolationsReport

func (doLog Log) StartViolationsReport(config []*log.ViolationSetting) (err error)

StartViolationsReport start violation reporting.

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

parameters:

  • `config`: Configuration for violations.

func (Log) StopViolationsReport

func (doLog Log) StopViolationsReport() (err error)

StopViolationsReport stop violation reporting.

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

type Media

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

Media executes a cdproto command under Media domain.

func (Media) Disable

func (doMedia Media) Disable() (err error)

Disable disables the Media domain.

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

func (Media) Enable

func (doMedia Media) Enable() (err error)

Enable enables the Media domain.

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

type Memory

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

Memory executes a cdproto command under Memory domain.

func (Memory) ForciblyPurgeJavaScriptMemory

func (doMemory Memory) ForciblyPurgeJavaScriptMemory() (err error)

ForciblyPurgeJavaScriptMemory simulate OomIntervention by purging V8 memory.

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

func (Memory) GetAllTimeSamplingProfile

func (doMemory Memory) GetAllTimeSamplingProfile() (retProfile *memory.SamplingProfile, err error)

GetAllTimeSamplingProfile retrieve native memory allocations profile collected since renderer process startup.

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

returns:

  • `retProfile`

func (Memory) GetBrowserSamplingProfile

func (doMemory Memory) GetBrowserSamplingProfile() (retProfile *memory.SamplingProfile, err error)

GetBrowserSamplingProfile retrieve native memory allocations profile collected since browser process startup.

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

returns:

  • `retProfile`

func (Memory) GetDOMCounters

func (doMemory Memory) GetDOMCounters() (retDocuments int64, retNodes int64, retJsEventListeners int64, err error)

GetDOMCounters [no description].

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

returns:

  • `retDocuments`
  • `retNodes`
  • `retJsEventListeners`

func (Memory) GetSamplingProfile

func (doMemory Memory) GetSamplingProfile() (retProfile *memory.SamplingProfile, err error)

GetSamplingProfile retrieve native memory allocations profile collected since last startSampling call.

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

returns:

  • `retProfile`

func (Memory) PrepareForLeakDetection

func (doMemory Memory) PrepareForLeakDetection() (err error)

PrepareForLeakDetection [no description].

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

func (Memory) SetPressureNotificationsSuppressed

func (doMemory Memory) SetPressureNotificationsSuppressed(suppressed bool) (err error)

SetPressureNotificationsSuppressed enable/disable suppressing memory pressure notifications in all processes.

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

parameters:

  • `suppressed`: If true, memory pressure notifications will be suppressed.

func (Memory) SimulatePressureNotification

func (doMemory Memory) SimulatePressureNotification(level memory.PressureLevel) (err error)

SimulatePressureNotification simulate a memory pressure notification in all processes.

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

parameters:

  • `level`: Memory pressure level of the notification.

func (Memory) StartSampling

func (doMemory Memory) StartSampling(samplingInterval *int64, suppressRandomness *bool) (err error)

StartSampling start collecting native memory profile.

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

parameters:

  • `samplingInterval`: This can be nil. (Optional) Average number of bytes between samples.
  • `suppressRandomness`: This can be nil. (Optional) Do not randomize intervals between samples.

func (Memory) StopSampling

func (doMemory Memory) StopSampling() (err error)

StopSampling stop collecting native memory profile.

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

type Network

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

Network executes a cdproto command under Network domain.

func (Network) ClearBrowserCache

func (doNetwork Network) ClearBrowserCache() (err error)

ClearBrowserCache clears browser cache.

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

func (Network) ClearBrowserCookies

func (doNetwork Network) ClearBrowserCookies() (err error)

ClearBrowserCookies clears browser cookies.

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

func (Network) DeleteCookies

func (doNetwork Network) DeleteCookies(name string, url *string, domain *string, path *string) (err error)

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

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

parameters:

  • `name`: Name of the cookies to remove.
  • `url`: This can be nil. (Optional) If specified, deletes all the cookies with the given name where domain and path match provided URL.
  • `domain`: This can be nil. (Optional) If specified, deletes only cookies with the exact domain.
  • `path`: This can be nil. (Optional) If specified, deletes only cookies with the exact path.

func (Network) Disable

func (doNetwork Network) Disable() (err error)

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

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

func (Network) EmulateNetworkConditions

func (doNetwork Network) EmulateNetworkConditions(offline bool, latency float64, downloadThroughput float64, uploadThroughput float64, connectionType *network.ConnectionType) (err error)

EmulateNetworkConditions activates emulation of network conditions.

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

parameters:

  • `offline`: True to emulate internet disconnection.
  • `latency`: Minimum latency from request sent to response headers received (ms).
  • `downloadThroughput`: Maximal aggregated download throughput (bytes/sec). -1 disables download throttling.
  • `uploadThroughput`: Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling.
  • `connectionType`: This can be nil. (Optional) Connection type if known.

func (Network) Enable

func (doNetwork Network) Enable(maxTotalBufferSize *int64, maxResourceBufferSize *int64, maxPostDataSize *int64) (err error)

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

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

parameters:

  • `maxTotalBufferSize`: This can be nil. (Optional) Buffer size in bytes to use when preserving network payloads (XHRs, etc).
  • `maxResourceBufferSize`: This can be nil. (Optional) Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc).
  • `maxPostDataSize`: This can be nil. (Optional) Longest post body size (in bytes) that would be included in requestWillBeSent notification

func (Network) GetAllCookies

func (doNetwork Network) GetAllCookies() (retCookies []*network.Cookie, err error)

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

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

returns:

  • `retCookies`: Array of cookie objects.

func (Network) GetCertificate

func (doNetwork Network) GetCertificate(origin string) (retTableNames []string, err error)

GetCertificate returns the DER-encoded certificate.

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

parameters:

  • `origin`: Origin to get certificate for.

returns:

  • `retTableNames`

func (Network) GetCookies

func (doNetwork Network) GetCookies(urls []string) (retCookies []*network.Cookie, err error)

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

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

parameters:

  • `urls`: This can be nil. (Optional) The list of URLs for which applicable cookies will be fetched

returns:

  • `retCookies`: Array of cookie objects.

func (Network) GetRequestPostData

func (doNetwork Network) GetRequestPostData(requestID network.RequestID) (retPostData string, err error)

GetRequestPostData returns post data sent with the request. Returns an error when no data was sent with the request.

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

parameters:

  • `requestID`: Identifier of the network request to get content for.

returns:

  • `retPostData`: Request body string, omitting files from multipart requests

func (Network) GetResponseBody

func (doNetwork Network) GetResponseBody(requestID network.RequestID) (retBody []byte, err error)

GetResponseBody returns content served for the given request.

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

parameters:

  • `requestID`: Identifier of the network request to get content for.

returns:

  • `retBody`: Response body.

func (Network) GetResponseBodyForInterception

func (doNetwork Network) GetResponseBodyForInterception(interceptionID network.InterceptionID) (retBody []byte, err error)

GetResponseBodyForInterception returns content served for the given currently intercepted request.

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

parameters:

  • `interceptionID`: Identifier for the intercepted request to get body for.

returns:

  • `retBody`: Response body.

func (Network) ReplayXHR

func (doNetwork Network) ReplayXHR(requestID network.RequestID) (err error)

ReplayXHR this method sends a new XMLHttpRequest which is identical to the original one. The following parameters should be identical: method, url, async, request body, extra headers, withCredentials attribute, user, password.

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

parameters:

  • `requestID`: Identifier of XHR to replay.

func (Network) SearchInResponseBody

func (doNetwork Network) SearchInResponseBody(requestID network.RequestID, query string, caseSensitive *bool, isRegex *bool) (retResult []*debugger.SearchMatch, err error)

SearchInResponseBody searches for given string in response content.

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

parameters:

  • `requestID`: Identifier of the network response to search.
  • `query`: String to search for.
  • `caseSensitive`: This can be nil. (Optional) If true, search is case sensitive.
  • `isRegex`: This can be nil. (Optional) If true, treats string parameter as regex.

returns:

  • `retResult`: List of search matches.

func (Network) SetBlockedURLS

func (doNetwork Network) SetBlockedURLS(urls []string) (err error)

SetBlockedURLS blocks URLs from loading.

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

parameters:

  • `urls`: URL patterns to block. Wildcards ('*') are allowed.

func (Network) SetBypassServiceWorker

func (doNetwork Network) SetBypassServiceWorker(bypass bool) (err error)

SetBypassServiceWorker toggles ignoring of service worker for each request.

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

parameters:

  • `bypass`: Bypass service worker and load from network.

func (Network) SetCacheDisabled

func (doNetwork Network) SetCacheDisabled(cacheDisabled bool) (err error)

SetCacheDisabled toggles ignoring cache for each request. If true, cache will not be used.

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

parameters:

  • `cacheDisabled`: Cache disabled state.

func (Network) SetCookie

func (doNetwork Network) SetCookie(name string, value string, url *string, domain *string, path *string, secure *bool, httpOnly *bool, sameSite *network.CookieSameSite, expires *cdp.TimeSinceEpoch, priority *network.CookiePriority) (retSuccess bool, err error)

SetCookie sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.

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

parameters:

  • `name`: Cookie name.
  • `value`: Cookie value.
  • `url`: This can be nil. (Optional) The request-URI to associate with the setting of the cookie. This value can affect the default domain and path values of the created cookie.
  • `domain`: This can be nil. (Optional) Cookie domain.
  • `path`: This can be nil. (Optional) Cookie path.
  • `secure`: This can be nil. (Optional) True if cookie is secure.
  • `httpOnly`: This can be nil. (Optional) True if cookie is http-only.
  • `sameSite`: This can be nil. (Optional) Cookie SameSite type.
  • `expires`: This can be nil. (Optional) Cookie expiration date, session cookie if not set
  • `priority`: This can be nil. (Optional) Cookie Priority type.

returns:

  • `retSuccess`: True if successfully set cookie.

func (Network) SetCookies

func (doNetwork Network) SetCookies(cookies []*network.CookieParam) (err error)

SetCookies sets given cookies.

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

parameters:

  • `cookies`: Cookies to be set.

func (Network) SetDataSizeLimitsForTest

func (doNetwork Network) SetDataSizeLimitsForTest(maxTotalSize int64, maxResourceSize int64) (err error)

SetDataSizeLimitsForTest for testing.

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

parameters:

  • `maxTotalSize`: Maximum total buffer size.
  • `maxResourceSize`: Maximum per-resource size.

func (Network) SetExtraHTTPHeaders

func (doNetwork Network) SetExtraHTTPHeaders(headers network.Headers) (err error)

SetExtraHTTPHeaders specifies whether to always send extra HTTP headers with the requests from this page.

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

parameters:

  • `headers`: Map with extra HTTP headers.

func (Network) TakeResponseBodyForInterceptionAsStream

func (doNetwork Network) TakeResponseBodyForInterceptionAsStream(interceptionID network.InterceptionID) (retStream io.StreamHandle, err error)

TakeResponseBodyForInterceptionAsStream returns a handle to the stream representing the response body. Note that after this command, the intercepted request can't be continued as is -- you either need to cancel it or to provide the response body. The stream only supports sequential read, IO.read will fail if the position is specified.

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

parameters:

  • `interceptionID`

returns:

  • `retStream`

type Overlay

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

Overlay executes a cdproto command under Overlay domain.

func (Overlay) Disable

func (doOverlay Overlay) Disable() (err error)

Disable disables domain notifications.

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

func (Overlay) Enable

func (doOverlay Overlay) Enable() (err error)

Enable enables domain notifications.

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

func (Overlay) GetHighlightObjectForTest

func (doOverlay Overlay) GetHighlightObjectForTest(nodeID cdp.NodeID, includeDistance *bool, includeStyle *bool) (retHighlight easyjson.RawMessage, err error)

GetHighlightObjectForTest for testing.

See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#method-getHighlightObjectForTest

parameters:

  • `nodeID`: Id of the node to get highlight object for.
  • `includeDistance`: This can be nil. (Optional) Whether to include distance info.
  • `includeStyle`: This can be nil. (Optional) Whether to include style info.

returns:

  • `retHighlight`: Highlight data for the node.

func (Overlay) HideHighlight

func (doOverlay Overlay) HideHighlight() (err error)

HideHighlight hides any highlight.

See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#method-hideHighlight

func (Overlay) HighlightFrame

func (doOverlay Overlay) HighlightFrame(frameID cdp.FrameID, contentColor *cdp.RGBA, contentOutlineColor *cdp.RGBA) (err error)

HighlightFrame highlights owner element of the frame with given id.

See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#method-highlightFrame

parameters:

  • `frameID`: Identifier of the frame to highlight.
  • `contentColor`: This can be nil. (Optional) The content box highlight fill color (default: transparent).
  • `contentOutlineColor`: This can be nil. (Optional) The content box highlight outline color (default: transparent).

func (Overlay) HighlightNode

func (doOverlay Overlay) HighlightNode(highlightConfig *overlay.HighlightConfig, nodeID *cdp.NodeID, backendNodeID *cdp.BackendNodeID, objectID *runtime.RemoteObjectID, selector *string) (err error)

HighlightNode highlights DOM node with given id or with the given JavaScript object wrapper. Either nodeId or objectId must be specified.

See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#method-highlightNode

parameters:

  • `highlightConfig`: A descriptor for the highlight appearance.
  • `nodeID`: This can be nil. (Optional) Identifier of the node to highlight.
  • `backendNodeID`: This can be nil. (Optional) Identifier of the backend node to highlight.
  • `objectID`: This can be nil. (Optional) JavaScript object id of the node to be highlighted.
  • `selector`: This can be nil. (Optional) Selectors to highlight relevant nodes.

func (Overlay) HighlightQuad

func (doOverlay Overlay) HighlightQuad(quad dom.Quad, color *cdp.RGBA, outlineColor *cdp.RGBA) (err error)

HighlightQuad highlights given quad. Coordinates are absolute with respect to the main frame viewport.

See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#method-highlightQuad

parameters:

  • `quad`: Quad to highlight
  • `color`: This can be nil. (Optional) The highlight fill color (default: transparent).
  • `outlineColor`: This can be nil. (Optional) The highlight outline color (default: transparent).

func (Overlay) HighlightRect

func (doOverlay Overlay) HighlightRect(x int64, y int64, width int64, height int64, color *cdp.RGBA, outlineColor *cdp.RGBA) (err error)

HighlightRect highlights given rectangle. Coordinates are absolute with respect to the main frame viewport.

See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#method-highlightRect

parameters:

  • `x`: X coordinate
  • `y`: Y coordinate
  • `width`: Rectangle width
  • `height`: Rectangle height
  • `color`: This can be nil. (Optional) The highlight fill color (default: transparent).
  • `outlineColor`: This can be nil. (Optional) The highlight outline color (default: transparent).

func (Overlay) SetInspectMode

func (doOverlay Overlay) SetInspectMode(mode overlay.InspectMode, highlightConfig *overlay.HighlightConfig) (err error)

SetInspectMode enters the 'inspect' mode. In this mode, elements that user is hovering over are highlighted. Backend then generates 'inspectNodeRequested' event upon element selection.

See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#method-setInspectMode

parameters:

  • `mode`: Set an inspection mode.
  • `highlightConfig`: This can be nil. (Optional) A descriptor for the highlight appearance of hovered-over nodes. May be omitted if enabled == false.

func (Overlay) SetPausedInDebuggerMessage

func (doOverlay Overlay) SetPausedInDebuggerMessage(message *string) (err error)

SetPausedInDebuggerMessage [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#method-setPausedInDebuggerMessage

parameters:

  • `message`: This can be nil. (Optional) The message to display, also triggers resume and step over controls.

func (Overlay) SetShowAdHighlights

func (doOverlay Overlay) SetShowAdHighlights(show bool) (err error)

SetShowAdHighlights highlights owner element of all frames detected to be ads.

See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#method-setShowAdHighlights

parameters:

  • `show`: True for showing ad highlights

func (Overlay) SetShowDebugBorders

func (doOverlay Overlay) SetShowDebugBorders(show bool) (err error)

SetShowDebugBorders requests that backend shows debug borders on layers.

See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#method-setShowDebugBorders

parameters:

  • `show`: True for showing debug borders

func (Overlay) SetShowFPSCounter

func (doOverlay Overlay) SetShowFPSCounter(show bool) (err error)

SetShowFPSCounter requests that backend shows the FPS counter.

See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#method-setShowFPSCounter

parameters:

  • `show`: True for showing the FPS counter

func (Overlay) SetShowHitTestBorders

func (doOverlay Overlay) SetShowHitTestBorders(show bool) (err error)

SetShowHitTestBorders requests that backend shows hit-test borders on layers.

See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#method-setShowHitTestBorders

parameters:

  • `show`: True for showing hit-test borders

func (Overlay) SetShowLayoutShiftRegions

func (doOverlay Overlay) SetShowLayoutShiftRegions(result bool) (err error)

SetShowLayoutShiftRegions requests that backend shows layout shift regions.

See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#method-setShowLayoutShiftRegions

parameters:

  • `result`: True for showing layout shift regions

func (Overlay) SetShowPaintRects

func (doOverlay Overlay) SetShowPaintRects(result bool) (err error)

SetShowPaintRects requests that backend shows paint rectangles.

See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#method-setShowPaintRects

parameters:

  • `result`: True for showing paint rectangles

func (Overlay) SetShowScrollBottleneckRects

func (doOverlay Overlay) SetShowScrollBottleneckRects(show bool) (err error)

SetShowScrollBottleneckRects requests that backend shows scroll bottleneck rects.

See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#method-setShowScrollBottleneckRects

parameters:

  • `show`: True for showing scroll bottleneck rects

func (Overlay) SetShowViewportSizeOnResize

func (doOverlay Overlay) SetShowViewportSizeOnResize(show bool) (err error)

SetShowViewportSizeOnResize paints viewport size upon main frame resize.

See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#method-setShowViewportSizeOnResize

parameters:

  • `show`: Whether to paint size or not.

type Page

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

Page executes a cdproto command under Page domain.

func (Page) AddCompilationCache

func (doPage Page) AddCompilationCache(url string, data string) (err error)

AddCompilationCache seeds compilation cache for given url. Compilation cache does not survive cross-process navigation.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-addCompilationCache

parameters:

  • `url`
  • `data`: Base64-encoded data

func (Page) AddScriptToEvaluateOnNewDocument

func (doPage Page) AddScriptToEvaluateOnNewDocument(source string, worldName *string) (retIdentifier page.ScriptIdentifier, err error)

AddScriptToEvaluateOnNewDocument evaluates given script in every frame upon creation (before loading frame's scripts).

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-addScriptToEvaluateOnNewDocument

parameters:

  • `source`
  • `worldName`: This can be nil. (Optional) If specified, creates an isolated world with the given name and evaluates given script in it. This world name will be used as the ExecutionContextDescription::name when the corresponding event is emitted.

returns:

  • `retIdentifier`: Identifier of the added script.

func (Page) BringToFront

func (doPage Page) BringToFront() (err error)

BringToFront brings page to front (activates tab).

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-bringToFront

func (Page) CaptureScreenshot

func (doPage Page) CaptureScreenshot(format *page.CaptureScreenshotFormat, quality *int64, clip *page.Viewport, fromSurface *bool) (retData []byte, err error)

CaptureScreenshot capture page screenshot.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-captureScreenshot

parameters:

  • `format`: This can be nil. (Optional) Image compression format (defaults to png).
  • `quality`: This can be nil. (Optional) Compression quality from range [0..100] (jpeg only).
  • `clip`: This can be nil. (Optional) Capture the screenshot of a given region only.
  • `fromSurface`: This can be nil. (Optional) Capture the screenshot from the surface, rather than the view. Defaults to true.

returns:

  • `retData`: Base64-encoded image data.

func (Page) CaptureSnapshot

func (doPage Page) CaptureSnapshot(format *page.CaptureSnapshotFormat) (retData string, err error)

CaptureSnapshot returns a snapshot of the page as a string. For MHTML format, the serialization includes iframes, shadow DOM, external resources, and element-inline styles.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-captureSnapshot

parameters:

  • `format`: This can be nil. (Optional) Format (defaults to mhtml).

returns:

  • `retData`: Serialized page data.

func (Page) ClearCompilationCache

func (doPage Page) ClearCompilationCache() (err error)

ClearCompilationCache clears seeded compilation cache.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-clearCompilationCache

func (Page) Close

func (doPage Page) Close() (err error)

Close tries to close page, running its beforeunload hooks, if any.

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

func (Page) Crash

func (doPage Page) Crash() (err error)

Crash crashes renderer on the IO thread, generates minidumps.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-crash

func (Page) CreateIsolatedWorld

func (doPage Page) CreateIsolatedWorld(frameID cdp.FrameID, worldName *string, grantUniveralAccess *bool) (retExecutionContextID runtime.ExecutionContextID, err error)

CreateIsolatedWorld creates an isolated world for the given frame.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-createIsolatedWorld

parameters:

  • `frameID`: Id of the frame in which the isolated world should be created.
  • `worldName`: This can be nil. (Optional) An optional name which is reported in the Execution Context.
  • `grantUniveralAccess`: This can be nil. (Optional) Whether or not universal access should be granted to the isolated world. This is a powerful option, use with caution.

returns:

  • `retExecutionContextID`: Execution context of the isolated world.

func (Page) Disable

func (doPage Page) Disable() (err error)

Disable disables page domain notifications.

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

func (Page) Enable

func (doPage Page) Enable() (err error)

Enable enables page domain notifications.

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

func (Page) GenerateTestReport

func (doPage Page) GenerateTestReport(message string, group *string) (err error)

GenerateTestReport generates a report for testing.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-generateTestReport

parameters:

  • `message`: Message to be displayed in the report.
  • `group`: This can be nil. (Optional) Specifies the endpoint group to deliver the report to.

func (Page) GetAppManifest

func (doPage Page) GetAppManifest() (retURL string, retErrors []*page.AppManifestError, retData string, retParsed *page.AppManifestParsedProperties, err error)

GetAppManifest [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-getAppManifest

returns:

  • `retURL`: Manifest location.
  • `retErrors`
  • `retData`: Manifest content.
  • `retParsed`: Parsed manifest properties

func (Page) GetFrameTree

func (doPage Page) GetFrameTree() (retFrameTree *page.FrameTree, err error)

GetFrameTree returns present frame tree structure.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-getFrameTree

returns:

  • `retFrameTree`: Present frame tree structure.

func (Page) GetInstallabilityErrors

func (doPage Page) GetInstallabilityErrors() (retInstallabilityErrors []*page.InstallabilityError, err error)

GetInstallabilityErrors [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-getInstallabilityErrors

returns:

  • `retInstallabilityErrors`

func (Page) GetLayoutMetrics

func (doPage Page) GetLayoutMetrics() (retLayoutViewport *page.LayoutViewport, retVisualViewport *page.VisualViewport, retContentSize *dom.Rect, err error)

GetLayoutMetrics returns metrics relating to the layouting of the page, such as viewport bounds/scale.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-getLayoutMetrics

returns:

  • `retLayoutViewport`: Metrics relating to the layout viewport.
  • `retVisualViewport`: Metrics relating to the visual viewport.
  • `retContentSize`: Size of scrollable area.

func (Page) GetManifestIcons

func (doPage Page) GetManifestIcons() (retPrimaryIcon []byte, err error)

GetManifestIcons [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-getManifestIcons

returns:

  • `retPrimaryIcon`

func (Page) GetNavigationHistory

func (doPage Page) GetNavigationHistory() (retCurrentIndex int64, retEntries []*page.NavigationEntry, err error)

GetNavigationHistory returns navigation history for the current page.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-getNavigationHistory

returns:

  • `retCurrentIndex`: Index of the current navigation history entry.
  • `retEntries`: Array of navigation history entries.

func (Page) GetResourceContent

func (doPage Page) GetResourceContent(frameID cdp.FrameID, url string) (retContent []byte, err error)

GetResourceContent returns content of the given resource.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-getResourceContent

parameters:

  • `frameID`: Frame id to get resource for.
  • `url`: URL of the resource to get content for.

returns:

  • `retContent`: Resource content.

func (Page) GetResourceTree

func (doPage Page) GetResourceTree() (retFrameTree *page.FrameResourceTree, err error)

GetResourceTree returns present frame / resource tree structure.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-getResourceTree

returns:

  • `retFrameTree`: Present frame / resource tree structure.

func (Page) HandleJavaScriptDialog

func (doPage Page) HandleJavaScriptDialog(accept bool, promptText *string) (err error)

HandleJavaScriptDialog accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-handleJavaScriptDialog

parameters:

  • `accept`: Whether to accept or dismiss the dialog.
  • `promptText`: This can be nil. (Optional) The text to enter into the dialog prompt before accepting. Used only if this is a prompt dialog.

func (Page) Navigate

func (doPage Page) Navigate(url string, referrer *string, transitionType *page.TransitionType, frameID *cdp.FrameID) (retFrameID cdp.FrameID, retLoaderID cdp.LoaderID, retErrorText string, err error)

Navigate navigates current page to the given URL.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-navigate

parameters:

  • `url`: URL to navigate the page to.
  • `referrer`: This can be nil. (Optional) Referrer URL.
  • `transitionType`: This can be nil. (Optional) Intended transition type.
  • `frameID`: This can be nil. (Optional) Frame id to navigate, if not specified navigates the top frame.

returns:

  • `retFrameID`: Frame id that has navigated (or failed to navigate)
  • `retLoaderID`: Loader identifier.
  • `retErrorText`: User friendly error message, present if and only if navigation has failed.

func (Page) NavigateToHistoryEntry

func (doPage Page) NavigateToHistoryEntry(entryID int64) (err error)

NavigateToHistoryEntry navigates current page to the given history entry.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-navigateToHistoryEntry

parameters:

  • `entryID`: Unique id of the entry to navigate to.

func (Page) PrintToPDF

func (doPage Page) PrintToPDF(landscape *bool, displayHeaderFooter *bool, printBackground *bool, scale *float64, paperWidth *float64, paperHeight *float64, marginTop *float64, marginBottom *float64, marginLeft *float64, marginRight *float64, pageRanges *string, ignoreInvalidPageRanges *bool, headerTemplate *string, footerTemplate *string, preferCSSPageSize *bool, transferMode *page.PrintToPDFTransferMode) (retData []byte, retStream io.StreamHandle, err error)

PrintToPDF print page as PDF.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-printToPDF

parameters:

  • `landscape`: This can be nil. (Optional) Paper orientation. Defaults to false.
  • `displayHeaderFooter`: This can be nil. (Optional) Display header and footer. Defaults to false.
  • `printBackground`: This can be nil. (Optional) Print background graphics. Defaults to false.
  • `scale`: This can be nil. (Optional) Scale of the webpage rendering. Defaults to 1.
  • `paperWidth`: This can be nil. (Optional) Paper width in inches. Defaults to 8.5 inches.
  • `paperHeight`: This can be nil. (Optional) Paper height in inches. Defaults to 11 inches.
  • `marginTop`: This can be nil. (Optional) Top margin in inches. Defaults to 1cm (~0.4 inches).
  • `marginBottom`: This can be nil. (Optional) Bottom margin in inches. Defaults to 1cm (~0.4 inches).
  • `marginLeft`: This can be nil. (Optional) Left margin in inches. Defaults to 1cm (~0.4 inches).
  • `marginRight`: This can be nil. (Optional) Right margin in inches. Defaults to 1cm (~0.4 inches).
  • `pageRanges`: This can be nil. (Optional) Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.
  • `ignoreInvalidPageRanges`: This can be nil. (Optional) Whether to silently ignore invalid but successfully parsed page ranges, such as '3-2'. Defaults to false.
  • `headerTemplate`: This can be nil. (Optional) HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them: - date: formatted print date - title: document title - url: document location - pageNumber: current page number - totalPages: total pages in the document For example, <span class=title></span> would generate span containing the title.
  • `footerTemplate`: This can be nil. (Optional) HTML template for the print footer. Should use the same format as the headerTemplate.
  • `preferCSSPageSize`: This can be nil. (Optional) Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size.
  • `transferMode`: This can be nil. (Optional) return as stream

returns:

  • `retData`: Base64-encoded pdf data. Empty if |returnAsStream| is specified.
  • `retStream`: A handle of the stream that holds resulting PDF data.

func (Page) Reload

func (doPage Page) Reload(ignoreCache *bool, scriptToEvaluateOnLoad *string) (err error)

Reload reloads given page optionally ignoring the cache.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-reload

parameters:

  • `ignoreCache`: This can be nil. (Optional) If true, browser cache is ignored (as if the user pressed Shift+refresh).
  • `scriptToEvaluateOnLoad`: This can be nil. (Optional) If set, the script will be injected into all frames of the inspected page after reload. Argument will be ignored if reloading dataURL origin.

func (Page) RemoveScriptToEvaluateOnNewDocument

func (doPage Page) RemoveScriptToEvaluateOnNewDocument(identifier page.ScriptIdentifier) (err error)

RemoveScriptToEvaluateOnNewDocument removes given script from the list.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-removeScriptToEvaluateOnNewDocument

parameters:

  • `identifier`

func (Page) ResetNavigationHistory

func (doPage Page) ResetNavigationHistory() (err error)

ResetNavigationHistory resets navigation history for the current page.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-resetNavigationHistory

func (Page) ScreencastFrameAck

func (doPage Page) ScreencastFrameAck(sessionID int64) (err error)

ScreencastFrameAck acknowledges that a screencast frame has been received by the frontend.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-screencastFrameAck

parameters:

  • `sessionID`: Frame number.

func (Page) SearchInResource

func (doPage Page) SearchInResource(frameID cdp.FrameID, url string, query string, caseSensitive *bool, isRegex *bool) (retResult []*debugger.SearchMatch, err error)

SearchInResource searches for given string in resource content.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-searchInResource

parameters:

  • `frameID`: Frame id for resource to search in.
  • `url`: URL of the resource to search in.
  • `query`: String to search for.
  • `caseSensitive`: This can be nil. (Optional) If true, search is case sensitive.
  • `isRegex`: This can be nil. (Optional) If true, treats string parameter as regex.

returns:

  • `retResult`: List of search matches.

func (Page) SetAdBlockingEnabled

func (doPage Page) SetAdBlockingEnabled(enabled bool) (err error)

SetAdBlockingEnabled enable Chrome's experimental ad filter on all sites.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-setAdBlockingEnabled

parameters:

  • `enabled`: Whether to block ads.

func (Page) SetBypassCSP

func (doPage Page) SetBypassCSP(enabled bool) (err error)

SetBypassCSP enable page Content Security Policy by-passing.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-setBypassCSP

parameters:

  • `enabled`: Whether to bypass page CSP.

func (Page) SetDocumentContent

func (doPage Page) SetDocumentContent(frameID cdp.FrameID, html string) (err error)

SetDocumentContent sets given markup as the document's HTML.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-setDocumentContent

parameters:

  • `frameID`: Frame id to set HTML for.
  • `html`: HTML content to set.

func (Page) SetDownloadBehavior

func (doPage Page) SetDownloadBehavior(behavior page.SetDownloadBehaviorBehavior, downloadPath *string) (err error)

SetDownloadBehavior set the behavior when downloading a file.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-setDownloadBehavior

parameters:

  • `behavior`: Whether to allow all or deny all download requests, or use default Chrome behavior if available (otherwise deny).
  • `downloadPath`: This can be nil. (Optional) The default path to save downloaded files to. This is required if behavior is set to 'allow'

func (Page) SetFontFamilies

func (doPage Page) SetFontFamilies(fontFamilies *page.FontFamilies) (err error)

SetFontFamilies set generic font families.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-setFontFamilies

parameters:

  • `fontFamilies`: Specifies font families to set. If a font family is not specified, it won't be changed.

func (Page) SetFontSizes

func (doPage Page) SetFontSizes(fontSizes *page.FontSizes) (err error)

SetFontSizes set default font sizes.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-setFontSizes

parameters:

  • `fontSizes`: Specifies font sizes to set. If a font size is not specified, it won't be changed.

func (Page) SetInterceptFileChooserDialog

func (doPage Page) SetInterceptFileChooserDialog(enabled bool) (err error)

SetInterceptFileChooserDialog intercept file chooser requests and transfer control to protocol clients. When file chooser interception is enabled, native file chooser dialog is not shown. Instead, a protocol event Page.fileChooserOpened is emitted.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-setInterceptFileChooserDialog

parameters:

  • `enabled`

func (Page) SetLifecycleEventsEnabled

func (doPage Page) SetLifecycleEventsEnabled(enabled bool) (err error)

SetLifecycleEventsEnabled controls whether page will emit lifecycle events.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-setLifecycleEventsEnabled

parameters:

  • `enabled`: If true, starts emitting lifecycle events.

func (Page) SetProduceCompilationCache

func (doPage Page) SetProduceCompilationCache(enabled bool) (err error)

SetProduceCompilationCache forces compilation cache to be generated for every subresource script.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-setProduceCompilationCache

parameters:

  • `enabled`

func (Page) SetWebLifecycleState

func (doPage Page) SetWebLifecycleState(state page.SetWebLifecycleStateState) (err error)

SetWebLifecycleState tries to update the web lifecycle state of the page. It will transition the page to the given state according to: https://github.com/WICG/web-lifecycle/.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-setWebLifecycleState

parameters:

  • `state`: Target lifecycle state

func (Page) StartScreencast

func (doPage Page) StartScreencast(format *page.ScreencastFormat, quality *int64, maxWidth *int64, maxHeight *int64, everyNthFrame *int64) (err error)

StartScreencast starts sending each frame using the screencastFrame event.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-startScreencast

parameters:

  • `format`: This can be nil. (Optional) Image compression format.
  • `quality`: This can be nil. (Optional) Compression quality from range [0..100].
  • `maxWidth`: This can be nil. (Optional) Maximum screenshot width.
  • `maxHeight`: This can be nil. (Optional) Maximum screenshot height.
  • `everyNthFrame`: This can be nil. (Optional) Send every n-th frame.

func (Page) StopLoading

func (doPage Page) StopLoading() (err error)

StopLoading force the page stop all navigations and pending resource fetches.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-stopLoading

func (Page) StopScreencast

func (doPage Page) StopScreencast() (err error)

StopScreencast stops sending each frame in the screencastFrame.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-stopScreencast

func (Page) WaitForDebugger

func (doPage Page) WaitForDebugger() (err error)

WaitForDebugger pauses page execution. Can be resumed using generic Runtime.runIfWaitingForDebugger.

See: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-waitForDebugger

type Performance

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

Performance executes a cdproto command under Performance domain.

func (Performance) Disable

func (doPerformance Performance) Disable() (err error)

Disable disable collecting and reporting metrics.

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

func (Performance) Enable

func (doPerformance Performance) Enable() (err error)

Enable enable collecting and reporting metrics.

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

func (Performance) GetMetrics

func (doPerformance Performance) GetMetrics() (retMetrics []*performance.Metric, err error)

GetMetrics retrieve current values of run-time metrics.

See: https://chromedevtools.github.io/devtools-protocol/tot/Performance#method-getMetrics

returns:

  • `retMetrics`: Current values for run-time metrics.

func (Performance) SetTimeDomain

func (doPerformance Performance) SetTimeDomain(timeDomain performance.SetTimeDomainTimeDomain) (err error)

SetTimeDomain sets time domain to use for collecting and reporting duration metrics. Note that this must be called before enabling metrics collection. Calling this method while metrics collection is enabled returns an error.

See: https://chromedevtools.github.io/devtools-protocol/tot/Performance#method-setTimeDomain

parameters:

  • `timeDomain`: Time domain

type Profiler

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

Profiler executes a cdproto command under Profiler domain.

func (Profiler) Disable

func (doProfiler Profiler) Disable() (err error)

Disable [no description].

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

func (Profiler) DisableRuntimeCallStats

func (doProfiler Profiler) DisableRuntimeCallStats() (err error)

DisableRuntimeCallStats disable run time call stats collection.

See: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#method-disableRuntimeCallStats

func (Profiler) Enable

func (doProfiler Profiler) Enable() (err error)

Enable [no description].

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

func (Profiler) EnableRuntimeCallStats

func (doProfiler Profiler) EnableRuntimeCallStats() (err error)

EnableRuntimeCallStats enable run time call stats collection.

See: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#method-enableRuntimeCallStats

func (Profiler) GetBestEffortCoverage

func (doProfiler Profiler) GetBestEffortCoverage() (retResult []*profiler.ScriptCoverage, err error)

GetBestEffortCoverage collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection.

See: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#method-getBestEffortCoverage

returns:

  • `retResult`: Coverage data for the current isolate.

func (Profiler) GetRuntimeCallStats

func (doProfiler Profiler) GetRuntimeCallStats() (retResult []*profiler.CounterInfo, err error)

GetRuntimeCallStats retrieve run time call stats.

See: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#method-getRuntimeCallStats

returns:

  • `retResult`: Collected counter information.

func (Profiler) SetSamplingInterval

func (doProfiler Profiler) SetSamplingInterval(interval int64) (err error)

SetSamplingInterval changes CPU profiler sampling interval. Must be called before CPU profiles recording started.

See: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#method-setSamplingInterval

parameters:

  • `interval`: New sampling interval in microseconds.

func (Profiler) Start

func (doProfiler Profiler) Start() (err error)

Start [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#method-start

func (Profiler) StartPreciseCoverage

func (doProfiler Profiler) StartPreciseCoverage(callCount *bool, detailed *bool) (retTimestamp float64, err error)

StartPreciseCoverage enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters.

See: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#method-startPreciseCoverage

parameters:

  • `callCount`: This can be nil. (Optional) Collect accurate call counts beyond simple 'covered' or 'not covered'.
  • `detailed`: This can be nil. (Optional) Collect block-based coverage.

returns:

  • `retTimestamp`: Monotonically increasing time (in seconds) when the coverage update was taken in the backend.

func (Profiler) StartTypeProfile

func (doProfiler Profiler) StartTypeProfile() (err error)

StartTypeProfile enable type profile.

See: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#method-startTypeProfile

func (Profiler) Stop

func (doProfiler Profiler) Stop() (retProfile *profiler.Profile, err error)

Stop [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#method-stop

returns:

  • `retProfile`: Recorded profile.

func (Profiler) StopPreciseCoverage

func (doProfiler Profiler) StopPreciseCoverage() (err error)

StopPreciseCoverage disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code.

See: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#method-stopPreciseCoverage

func (Profiler) StopTypeProfile

func (doProfiler Profiler) StopTypeProfile() (err error)

StopTypeProfile disable type profile. Disabling releases type profile data collected so far.

See: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#method-stopTypeProfile

func (Profiler) TakePreciseCoverage

func (doProfiler Profiler) TakePreciseCoverage() (retResult []*profiler.ScriptCoverage, retTimestamp float64, err error)

TakePreciseCoverage collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started.

See: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#method-takePreciseCoverage

returns:

  • `retResult`: Coverage data for the current isolate.
  • `retTimestamp`: Monotonically increasing time (in seconds) when the coverage update was taken in the backend.

func (Profiler) TakeTypeProfile

func (doProfiler Profiler) TakeTypeProfile() (retResult []*profiler.ScriptTypeProfile, err error)

TakeTypeProfile collect type profile.

See: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#method-takeTypeProfile

returns:

  • `retResult`: Type profile for all scripts since startTypeProfile() was turned on.

type Runtime

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

Runtime executes a cdproto command under Runtime domain.

func (Runtime) AddBinding

func (doRuntime Runtime) AddBinding(name string, executionContextID *runtime.ExecutionContextID) (err error)

AddBinding if executionContextId is empty, adds binding with the given name on the global objects of all inspected contexts, including those created later, bindings survive reloads. If executionContextId is specified, adds binding only on global object of given execution context. Binding function takes exactly one argument, this argument should be string, in case of any other input, function throws an exception. Each binding function call produces Runtime.bindingCalled notification.

See: https://chromedevtools.github.io/devtools-protocol/tot/Runtime#method-addBinding

parameters:

  • `name`
  • `executionContextID`

func (Runtime) AwaitPromise

func (doRuntime Runtime) AwaitPromise(promiseObjectID runtime.RemoteObjectID, returnByValue *bool, generatePreview *bool) (retResult *runtime.RemoteObject, retExceptionDetails *runtime.ExceptionDetails, err error)

AwaitPromise add handler to promise with given promise object id.

See: https://chromedevtools.github.io/devtools-protocol/tot/Runtime#method-awaitPromise

parameters:

  • `promiseObjectID`: Identifier of the promise.
  • `returnByValue`: This can be nil. (Optional) Whether the result is expected to be a JSON object that should be sent by value.
  • `generatePreview`: This can be nil. (Optional) Whether preview should be generated for the result.

returns:

  • `retResult`: Promise result. Will contain rejected value if promise was rejected.
  • `retExceptionDetails`: Exception details if stack strace is available.

func (Runtime) CallFunctionOn

func (doRuntime Runtime) CallFunctionOn(functionDeclaration string, objectID *runtime.RemoteObjectID, arguments []*runtime.CallArgument, silent *bool, returnByValue *bool, generatePreview *bool, userGesture *bool, awaitPromise *bool, executionContextID *runtime.ExecutionContextID, objectGroup *string) (retResult *runtime.RemoteObject, retExceptionDetails *runtime.ExceptionDetails, err error)

CallFunctionOn calls function with given declaration on the given object. Object group of the result is inherited from the target object.

See: https://chromedevtools.github.io/devtools-protocol/tot/Runtime#method-callFunctionOn

parameters:

  • `functionDeclaration`: Declaration of the function to call.
  • `objectID`: This can be nil. (Optional) Identifier of the object to call function on. Either objectId or executionContextId should be specified.
  • `arguments`: This can be nil. (Optional) Call arguments. All call arguments must belong to the same JavaScript world as the target object.
  • `silent`: This can be nil. (Optional) In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state.
  • `returnByValue`: This can be nil. (Optional) Whether the result is expected to be a JSON object which should be sent by value.
  • `generatePreview`: This can be nil. (Optional) Whether preview should be generated for the result.
  • `userGesture`: This can be nil. (Optional) Whether execution should be treated as initiated by user in the UI.
  • `awaitPromise`: This can be nil. (Optional) Whether execution should await for resulting value and return once awaited promise is resolved.
  • `executionContextID`: This can be nil. (Optional) Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified.
  • `objectGroup`: This can be nil. (Optional) Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object.

returns:

  • `retResult`: Call result.
  • `retExceptionDetails`: Exception details.

func (Runtime) CompileScript

func (doRuntime Runtime) CompileScript(expression string, sourceURL string, persistScript bool, executionContextID *runtime.ExecutionContextID) (retScriptID runtime.ScriptID, retExceptionDetails *runtime.ExceptionDetails, err error)

CompileScript compiles expression.

See: https://chromedevtools.github.io/devtools-protocol/tot/Runtime#method-compileScript

parameters:

  • `expression`: Expression to compile.
  • `sourceURL`: Source url to be set for the script.
  • `persistScript`: Specifies whether the compiled script should be persisted.
  • `executionContextID`: This can be nil. (Optional) Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page.

returns:

  • `retScriptID`: Id of the script.
  • `retExceptionDetails`: Exception details.

func (Runtime) Disable

func (doRuntime Runtime) Disable() (err error)

Disable disables reporting of execution contexts creation.

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

func (Runtime) DiscardConsoleEntries

func (doRuntime Runtime) DiscardConsoleEntries() (err error)

DiscardConsoleEntries discards collected exceptions and console API calls.

See: https://chromedevtools.github.io/devtools-protocol/tot/Runtime#method-discardConsoleEntries

func (Runtime) Enable

func (doRuntime Runtime) Enable() (err error)

Enable enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context.

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

func (Runtime) Evaluate

func (doRuntime Runtime) Evaluate(expression string, objectGroup *string, includeCommandLineAPI *bool, silent *bool, contextID *runtime.ExecutionContextID, returnByValue *bool, generatePreview *bool, userGesture *bool, awaitPromise *bool, throwOnSideEffect *bool, timeout *runtime.TimeDelta, disableBreaks *bool, replMode *bool) (retResult *runtime.RemoteObject, retExceptionDetails *runtime.ExceptionDetails, err error)

Evaluate evaluates expression on global object.

See: https://chromedevtools.github.io/devtools-protocol/tot/Runtime#method-evaluate

parameters:

  • `expression`: Expression to evaluate.
  • `objectGroup`: This can be nil. (Optional) Symbolic group name that can be used to release multiple objects.
  • `includeCommandLineAPI`: This can be nil. (Optional) Determines whether Command Line API should be available during the evaluation.
  • `silent`: This can be nil. (Optional) In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state.
  • `contextID`: This can be nil. (Optional) Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page.
  • `returnByValue`: This can be nil. (Optional) Whether the result is expected to be a JSON object that should be sent by value.
  • `generatePreview`: This can be nil. (Optional) Whether preview should be generated for the result.
  • `userGesture`: This can be nil. (Optional) Whether execution should be treated as initiated by user in the UI.
  • `awaitPromise`: This can be nil. (Optional) Whether execution should await for resulting value and return once awaited promise is resolved.
  • `throwOnSideEffect`: This can be nil. (Optional) Whether to throw an exception if side effect cannot be ruled out during evaluation. This implies disableBreaks below.
  • `timeout`: This can be nil. (Optional) Terminate execution after timing out (number of milliseconds).
  • `disableBreaks`: This can be nil. (Optional) Disable breakpoints during execution.
  • `replMode`: This can be nil. (Optional) Reserved flag for future REPL mode support. Setting this flag has currently no effect.

returns:

  • `retResult`: Evaluation result.
  • `retExceptionDetails`: Exception details.

func (Runtime) GetHeapUsage

func (doRuntime Runtime) GetHeapUsage() (retUsedSize float64, retTotalSize float64, err error)

GetHeapUsage returns the JavaScript heap usage. It is the total usage of the corresponding isolate not scoped to a particular Runtime.

See: https://chromedevtools.github.io/devtools-protocol/tot/Runtime#method-getHeapUsage

returns:

  • `retUsedSize`: Used heap size in bytes.
  • `retTotalSize`: Allocated heap size in bytes.

func (Runtime) GetIsolateID

func (doRuntime Runtime) GetIsolateID() (retID string, err error)

GetIsolateID returns the isolate id.

See: https://chromedevtools.github.io/devtools-protocol/tot/Runtime#method-getIsolateId

returns:

  • `retID`: The isolate id.

func (Runtime) GetProperties

func (doRuntime Runtime) GetProperties(objectID runtime.RemoteObjectID, ownProperties *bool, accessorPropertiesOnly *bool, generatePreview *bool) (retResult []*runtime.PropertyDescriptor, retInternalProperties []*runtime.InternalPropertyDescriptor, retPrivateProperties []*runtime.PrivatePropertyDescriptor, retExceptionDetails *runtime.ExceptionDetails, err error)

GetProperties returns properties of a given object. Object group of the result is inherited from the target object.

See: https://chromedevtools.github.io/devtools-protocol/tot/Runtime#method-getProperties

parameters:

  • `objectID`: Identifier of the object to return properties for.
  • `ownProperties`: This can be nil. (Optional) If true, returns properties belonging only to the element itself, not to its prototype chain.
  • `accessorPropertiesOnly`: This can be nil. (Optional) If true, returns accessor properties (with getter/setter) only; internal properties are not returned either.
  • `generatePreview`: This can be nil. (Optional) Whether preview should be generated for the results.

returns:

  • `retResult`: Object properties.
  • `retInternalProperties`: Internal object properties (only of the element itself).
  • `retPrivateProperties`: Object private properties.
  • `retExceptionDetails`: Exception details.

func (Runtime) GlobalLexicalScopeNames

func (doRuntime Runtime) GlobalLexicalScopeNames(executionContextID *runtime.ExecutionContextID) (retNames []string, err error)

GlobalLexicalScopeNames returns all let, const and class variables from global scope.

See: https://chromedevtools.github.io/devtools-protocol/tot/Runtime#method-globalLexicalScopeNames

parameters:

  • `executionContextID`: This can be nil. (Optional) Specifies in which execution context to lookup global scope variables.

returns:

  • `retNames`

func (Runtime) QueryObjects

func (doRuntime Runtime) QueryObjects(prototypeObjectID runtime.RemoteObjectID, objectGroup *string) (retObjects *runtime.RemoteObject, err error)

QueryObjects [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/Runtime#method-queryObjects

parameters:

  • `prototypeObjectID`: Identifier of the prototype to return objects for.
  • `objectGroup`: This can be nil. (Optional) Symbolic group name that can be used to release the results.

returns:

  • `retObjects`: Array with objects.

func (Runtime) ReleaseObject

func (doRuntime Runtime) ReleaseObject(objectID runtime.RemoteObjectID) (err error)

ReleaseObject releases remote object with given id.

See: https://chromedevtools.github.io/devtools-protocol/tot/Runtime#method-releaseObject

parameters:

  • `objectID`: Identifier of the object to release.

func (Runtime) ReleaseObjectGroup

func (doRuntime Runtime) ReleaseObjectGroup(objectGroup string) (err error)

ReleaseObjectGroup releases all remote objects that belong to a given group.

See: https://chromedevtools.github.io/devtools-protocol/tot/Runtime#method-releaseObjectGroup

parameters:

  • `objectGroup`: Symbolic object group name.

func (Runtime) RemoveBinding

func (doRuntime Runtime) RemoveBinding(name string) (err error)

RemoveBinding this method does not remove binding function from global object but unsubscribes current runtime agent from Runtime.bindingCalled notifications.

See: https://chromedevtools.github.io/devtools-protocol/tot/Runtime#method-removeBinding

parameters:

  • `name`

func (Runtime) RunIfWaitingForDebugger

func (doRuntime Runtime) RunIfWaitingForDebugger() (err error)

RunIfWaitingForDebugger tells inspected instance to run if it was waiting for debugger to attach.

See: https://chromedevtools.github.io/devtools-protocol/tot/Runtime#method-runIfWaitingForDebugger

func (Runtime) RunScript

func (doRuntime Runtime) RunScript(scriptID runtime.ScriptID, executionContextID *runtime.ExecutionContextID, objectGroup *string, silent *bool, includeCommandLineAPI *bool, returnByValue *bool, generatePreview *bool, awaitPromise *bool) (retResult *runtime.RemoteObject, retExceptionDetails *runtime.ExceptionDetails, err error)

RunScript runs script with given id in a given context.

See: https://chromedevtools.github.io/devtools-protocol/tot/Runtime#method-runScript

parameters:

  • `scriptID`: Id of the script to run.
  • `executionContextID`: This can be nil. (Optional) Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page.
  • `objectGroup`: This can be nil. (Optional) Symbolic group name that can be used to release multiple objects.
  • `silent`: This can be nil. (Optional) In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state.
  • `includeCommandLineAPI`: This can be nil. (Optional) Determines whether Command Line API should be available during the evaluation.
  • `returnByValue`: This can be nil. (Optional) Whether the result is expected to be a JSON object which should be sent by value.
  • `generatePreview`: This can be nil. (Optional) Whether preview should be generated for the result.
  • `awaitPromise`: This can be nil. (Optional) Whether execution should await for resulting value and return once awaited promise is resolved.

returns:

  • `retResult`: Run result.
  • `retExceptionDetails`: Exception details.

func (Runtime) SetCustomObjectFormatterEnabled

func (doRuntime Runtime) SetCustomObjectFormatterEnabled(enabled bool) (err error)

SetCustomObjectFormatterEnabled [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/Runtime#method-setCustomObjectFormatterEnabled

parameters:

  • `enabled`

func (Runtime) SetMaxCallStackSizeToCapture

func (doRuntime Runtime) SetMaxCallStackSizeToCapture(size int64) (err error)

SetMaxCallStackSizeToCapture [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/Runtime#method-setMaxCallStackSizeToCapture

parameters:

  • `size`

func (Runtime) TerminateExecution

func (doRuntime Runtime) TerminateExecution() (err error)

TerminateExecution terminate current or next JavaScript execution. Will cancel the termination when the outer-most script execution ends.

See: https://chromedevtools.github.io/devtools-protocol/tot/Runtime#method-terminateExecution

type Security

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

Security executes a cdproto command under Security domain.

func (Security) Disable

func (doSecurity Security) Disable() (err error)

Disable disables tracking security state changes.

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

func (Security) Enable

func (doSecurity Security) Enable() (err error)

Enable enables tracking security state changes.

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

func (Security) SetIgnoreCertificateErrors

func (doSecurity Security) SetIgnoreCertificateErrors(ignore bool) (err error)

SetIgnoreCertificateErrors enable/disable whether all certificate errors should be ignored.

See: https://chromedevtools.github.io/devtools-protocol/tot/Security#method-setIgnoreCertificateErrors

parameters:

  • `ignore`: If true, all certificate errors will be ignored.

type ServiceWorker

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

ServiceWorker executes a cdproto command under ServiceWorker domain.

func (ServiceWorker) DeliverPushMessage

func (doServiceWorker ServiceWorker) DeliverPushMessage(origin string, registrationID serviceworker.RegistrationID, data string) (err error)

DeliverPushMessage [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-deliverPushMessage

parameters:

  • `origin`
  • `registrationID`
  • `data`

func (ServiceWorker) Disable

func (doServiceWorker ServiceWorker) Disable() (err error)

Disable [no description].

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

func (ServiceWorker) DispatchPeriodicSyncEvent

func (doServiceWorker ServiceWorker) DispatchPeriodicSyncEvent(origin string, registrationID serviceworker.RegistrationID, tag string) (err error)

DispatchPeriodicSyncEvent [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-dispatchPeriodicSyncEvent

parameters:

  • `origin`
  • `registrationID`
  • `tag`

func (ServiceWorker) DispatchSyncEvent

func (doServiceWorker ServiceWorker) DispatchSyncEvent(origin string, registrationID serviceworker.RegistrationID, tag string, lastChance bool) (err error)

DispatchSyncEvent [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-dispatchSyncEvent

parameters:

  • `origin`
  • `registrationID`
  • `tag`
  • `lastChance`

func (ServiceWorker) Enable

func (doServiceWorker ServiceWorker) Enable() (err error)

Enable [no description].

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

func (ServiceWorker) InspectWorker

func (doServiceWorker ServiceWorker) InspectWorker(versionID string) (err error)

InspectWorker [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-inspectWorker

parameters:

  • `versionID`

func (ServiceWorker) SetForceUpdateOnPageLoad

func (doServiceWorker ServiceWorker) SetForceUpdateOnPageLoad(forceUpdateOnPageLoad bool) (err error)

SetForceUpdateOnPageLoad [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-setForceUpdateOnPageLoad

parameters:

  • `forceUpdateOnPageLoad`

func (ServiceWorker) SkipWaiting

func (doServiceWorker ServiceWorker) SkipWaiting(scopeURL string) (err error)

SkipWaiting [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-skipWaiting

parameters:

  • `scopeURL`

func (ServiceWorker) StartWorker

func (doServiceWorker ServiceWorker) StartWorker(scopeURL string) (err error)

StartWorker [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-startWorker

parameters:

  • `scopeURL`

func (ServiceWorker) StopAllWorkers

func (doServiceWorker ServiceWorker) StopAllWorkers() (err error)

StopAllWorkers [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-stopAllWorkers

func (ServiceWorker) StopWorker

func (doServiceWorker ServiceWorker) StopWorker(versionID string) (err error)

StopWorker [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-stopWorker

parameters:

  • `versionID`

func (ServiceWorker) Unregister

func (doServiceWorker ServiceWorker) Unregister(scopeURL string) (err error)

Unregister [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-unregister

parameters:

  • `scopeURL`

func (ServiceWorker) UpdateRegistration

func (doServiceWorker ServiceWorker) UpdateRegistration(scopeURL string) (err error)

UpdateRegistration [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#method-updateRegistration

parameters:

  • `scopeURL`

type Storage

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

Storage executes a cdproto command under Storage domain.

func (Storage) ClearCookies

func (doStorage Storage) ClearCookies(browserContextID *cdp.BrowserContextID) (err error)

ClearCookies clears cookies.

See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-clearCookies

parameters:

  • `browserContextID`: This can be nil. (Optional) Browser context to use when called on the browser endpoint.

func (Storage) ClearDataForOrigin

func (doStorage Storage) ClearDataForOrigin(origin string, storageTypes string) (err error)

ClearDataForOrigin clears storage for origin.

See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-clearDataForOrigin

parameters:

  • `origin`: Security origin.
  • `storageTypes`: Comma separated list of StorageType to clear.

func (Storage) GetCookies

func (doStorage Storage) GetCookies(browserContextID *cdp.BrowserContextID) (retCookies []*network.Cookie, err error)

GetCookies returns all browser cookies.

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

parameters:

  • `browserContextID`: This can be nil. (Optional) Browser context to use when called on the browser endpoint.

returns:

  • `retCookies`: Array of cookie objects.

func (Storage) GetUsageAndQuota

func (doStorage Storage) GetUsageAndQuota(origin string) (retUsage float64, retQuota float64, retUsageBreakdown []*storage.UsageForType, err error)

GetUsageAndQuota returns usage and quota in bytes.

See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-getUsageAndQuota

parameters:

  • `origin`: Security origin.

returns:

  • `retUsage`: Storage usage (bytes).
  • `retQuota`: Storage quota (bytes).
  • `retUsageBreakdown`: Storage usage per type (bytes).

func (Storage) SetCookies

func (doStorage Storage) SetCookies(cookies []*network.CookieParam, browserContextID *cdp.BrowserContextID) (err error)

SetCookies sets given cookies.

See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-setCookies

parameters:

  • `cookies`: Cookies to be set.
  • `browserContextID`: This can be nil. (Optional) Browser context to use when called on the browser endpoint.

func (Storage) TrackCacheStorageForOrigin

func (doStorage Storage) TrackCacheStorageForOrigin(origin string) (err error)

TrackCacheStorageForOrigin registers origin to be notified when an update occurs to its cache storage list.

See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-trackCacheStorageForOrigin

parameters:

  • `origin`: Security origin.

func (Storage) TrackIndexedDBForOrigin

func (doStorage Storage) TrackIndexedDBForOrigin(origin string) (err error)

TrackIndexedDBForOrigin registers origin to be notified when an update occurs to its IndexedDB.

See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-trackIndexedDBForOrigin

parameters:

  • `origin`: Security origin.

func (Storage) UntrackCacheStorageForOrigin

func (doStorage Storage) UntrackCacheStorageForOrigin(origin string) (err error)

UntrackCacheStorageForOrigin unregisters origin from receiving notifications for cache storage.

See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-untrackCacheStorageForOrigin

parameters:

  • `origin`: Security origin.

func (Storage) UntrackIndexedDBForOrigin

func (doStorage Storage) UntrackIndexedDBForOrigin(origin string) (err error)

UntrackIndexedDBForOrigin unregisters origin from receiving notifications for IndexedDB.

See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-untrackIndexedDBForOrigin

parameters:

  • `origin`: Security origin.

type SystemInfo

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

SystemInfo executes a cdproto command under SystemInfo domain.

func (SystemInfo) GetInfo

func (doSystemInfo SystemInfo) GetInfo() (retGpu *systeminfo.GPUInfo, retModelName string, retModelVersion string, retCommandLine string, err error)

GetInfo returns information about the system.

See: https://chromedevtools.github.io/devtools-protocol/tot/SystemInfo#method-getInfo

returns:

  • `retGpu`: Information about the GPUs on the system.
  • `retModelName`: A platform-dependent description of the model of the machine. On Mac OS, this is, for example, 'MacBookPro'. Will be the empty string if not supported.
  • `retModelVersion`: A platform-dependent description of the version of the machine. On Mac OS, this is, for example, '10.1'. Will be the empty string if not supported.
  • `retCommandLine`: The command line string used to launch the browser. Will be the empty string if not supported.

func (SystemInfo) GetProcessInfo

func (doSystemInfo SystemInfo) GetProcessInfo() (retProcessInfo []*systeminfo.ProcessInfo, err error)

GetProcessInfo returns information about all running processes.

See: https://chromedevtools.github.io/devtools-protocol/tot/SystemInfo#method-getProcessInfo

returns:

  • `retProcessInfo`: An array of process info blocks.

type Target

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

Target executes a cdproto command under Target domain.

func (Target) ActivateTarget

func (doTarget Target) ActivateTarget(targetID target.ID) (err error)

ActivateTarget activates (focuses) the target.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-activateTarget

parameters:

  • `targetID`

func (Target) AttachToBrowserTarget

func (doTarget Target) AttachToBrowserTarget() (retSessionID target.SessionID, err error)

AttachToBrowserTarget attaches to the browser target, only uses flat sessionId mode.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-attachToBrowserTarget

returns:

  • `retSessionID`: Id assigned to the session.

func (Target) AttachToTarget

func (doTarget Target) AttachToTarget(targetID target.ID, flatten *bool) (retSessionID target.SessionID, err error)

AttachToTarget attaches to the target with given id.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-attachToTarget

parameters:

  • `targetID`
  • `flatten`: This can be nil. (Optional) Enables "flat" access to the session via specifying sessionId attribute in the commands. We plan to make this the default, deprecate non-flattened mode, and eventually retire it. See crbug.com/991325.

returns:

  • `retSessionID`: Id assigned to the session.

func (Target) CloseTarget

func (doTarget Target) CloseTarget(targetID target.ID) (retSuccess bool, err error)

CloseTarget closes the target. If the target is a page that gets closed too.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-closeTarget

parameters:

  • `targetID`

returns:

  • `retSuccess`

func (Target) CreateBrowserContext

func (doTarget Target) CreateBrowserContext() (retBrowserContextID cdp.BrowserContextID, err error)

CreateBrowserContext creates a new empty BrowserContext. Similar to an incognito profile but you can have more than one.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-createBrowserContext

returns:

  • `retBrowserContextID`: The id of the context created.

func (Target) CreateTarget

func (doTarget Target) CreateTarget(url string, width *int64, height *int64, browserContextID *cdp.BrowserContextID, enableBeginFrameControl *bool, newWindow *bool, background *bool) (retTargetID target.ID, err error)

CreateTarget creates a new page.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-createTarget

parameters:

  • `url`: The initial URL the page will be navigated to.
  • `width`: This can be nil. (Optional) Frame width in DIP (headless chrome only).
  • `height`: This can be nil. (Optional) Frame height in DIP (headless chrome only).
  • `browserContextID`: This can be nil. (Optional) The browser context to create the page in.
  • `enableBeginFrameControl`: This can be nil. (Optional) Whether BeginFrames for this target will be controlled via DevTools (headless chrome only, not supported on MacOS yet, false by default).
  • `newWindow`: This can be nil. (Optional) Whether to create a new Window or Tab (chrome-only, false by default).
  • `background`: This can be nil. (Optional) Whether to create the target in background or foreground (chrome-only, false by default).

returns:

  • `retTargetID`: The id of the page opened.

func (Target) DetachFromTarget

func (doTarget Target) DetachFromTarget(sessionID *target.SessionID) (err error)

DetachFromTarget detaches session with given id.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-detachFromTarget

parameters:

  • `sessionID`: This can be nil. (Optional) Session to detach.

func (Target) DisposeBrowserContext

func (doTarget Target) DisposeBrowserContext(browserContextID cdp.BrowserContextID) (err error)

DisposeBrowserContext deletes a BrowserContext. All the belonging pages will be closed without calling their beforeunload hooks.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-disposeBrowserContext

parameters:

  • `browserContextID`

func (Target) ExposeDevToolsProtocol

func (doTarget Target) ExposeDevToolsProtocol(targetID target.ID, bindingName *string) (err error)

ExposeDevToolsProtocol inject object to the target's main frame that provides a communication channel with browser target. Injected object will be available as window[bindingName]. The object has the follwing API: - binding.send(json) - a method to send messages over the remote debugging protocol - binding.onmessage = json => handleMessage(json) - a callback that will be called for the protocol notifications and command responses.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-exposeDevToolsProtocol

parameters:

  • `targetID`
  • `bindingName`: This can be nil. (Optional) Binding name, 'cdp' if not specified.

func (Target) GetBrowserContexts

func (doTarget Target) GetBrowserContexts() (retBrowserContextIds []cdp.BrowserContextID, err error)

GetBrowserContexts returns all browser contexts created with Target.createBrowserContext method.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-getBrowserContexts

returns:

  • `retBrowserContextIds`: An array of browser context ids.

func (Target) GetTargetInfo

func (doTarget Target) GetTargetInfo(targetID *target.ID) (retTargetInfo *target.Info, err error)

GetTargetInfo returns information about a target.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-getTargetInfo

parameters:

  • `targetID`

returns:

  • `retTargetInfo`

func (Target) GetTargets

func (doTarget Target) GetTargets() (retTargetInfos []*target.Info, err error)

GetTargets retrieves a list of available targets.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-getTargets

returns:

  • `retTargetInfos`: The list of targets.

func (Target) SetAutoAttach

func (doTarget Target) SetAutoAttach(autoAttach bool, waitForDebuggerOnStart bool, flatten *bool, windowOpen *bool) (err error)

SetAutoAttach controls whether to automatically attach to new targets which are considered to be related to this one. When turned on, attaches to all existing related targets as well. When turned off, automatically detaches from all currently attached targets.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-setAutoAttach

parameters:

  • `autoAttach`: Whether to auto-attach to related targets.
  • `waitForDebuggerOnStart`: Whether to pause new targets when attaching to them. Use Runtime.runIfWaitingForDebugger to run paused targets.
  • `flatten`: This can be nil. (Optional) Enables "flat" access to the session via specifying sessionId attribute in the commands. We plan to make this the default, deprecate non-flattened mode, and eventually retire it. See crbug.com/991325.
  • `windowOpen`: This can be nil. (Optional) Auto-attach to the targets created via window.open from current target.

func (Target) SetDiscoverTargets

func (doTarget Target) SetDiscoverTargets(discover bool) (err error)

SetDiscoverTargets controls whether to discover available targets and notify via targetCreated/targetInfoChanged/targetDestroyed events.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-setDiscoverTargets

parameters:

  • `discover`: Whether to discover available targets.

func (Target) SetRemoteLocations

func (doTarget Target) SetRemoteLocations(locations []*target.RemoteLocation) (err error)

SetRemoteLocations enables target discovery for the specified locations, when setDiscoverTargets was set to true.

See: https://chromedevtools.github.io/devtools-protocol/tot/Target#method-setRemoteLocations

parameters:

  • `locations`: List of remote locations.

type Tethering

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

Tethering executes a cdproto command under Tethering domain.

func (Tethering) Bind

func (doTethering Tethering) Bind(port int64) (err error)

Bind request browser port binding.

See: https://chromedevtools.github.io/devtools-protocol/tot/Tethering#method-bind

parameters:

  • `port`: Port number to bind.

func (Tethering) Unbind

func (doTethering Tethering) Unbind(port int64) (err error)

Unbind request browser port unbinding.

See: https://chromedevtools.github.io/devtools-protocol/tot/Tethering#method-unbind

parameters:

  • `port`: Port number to unbind.

type Tracing

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

Tracing executes a cdproto command under Tracing domain.

func (Tracing) End

func (doTracing Tracing) End() (err error)

End stop trace events collection.

See: https://chromedevtools.github.io/devtools-protocol/tot/Tracing#method-end

func (Tracing) GetCategories

func (doTracing Tracing) GetCategories() (retCategories []string, err error)

GetCategories gets supported tracing categories.

See: https://chromedevtools.github.io/devtools-protocol/tot/Tracing#method-getCategories

returns:

  • `retCategories`: A list of supported tracing categories.

func (Tracing) RecordClockSyncMarker

func (doTracing Tracing) RecordClockSyncMarker(syncID string) (err error)

RecordClockSyncMarker record a clock sync marker in the trace.

See: https://chromedevtools.github.io/devtools-protocol/tot/Tracing#method-recordClockSyncMarker

parameters:

  • `syncID`: The ID of this clock sync marker

func (Tracing) RequestMemoryDump

func (doTracing Tracing) RequestMemoryDump(deterministic *bool) (retDumpGUID string, retSuccess bool, err error)

RequestMemoryDump request a global memory dump.

See: https://chromedevtools.github.io/devtools-protocol/tot/Tracing#method-requestMemoryDump

parameters:

  • `deterministic`: This can be nil. (Optional) Enables more deterministic results by forcing garbage collection

returns:

  • `retDumpGUID`: GUID of the resulting global memory dump.
  • `retSuccess`: True iff the global memory dump succeeded.

func (Tracing) Start

func (doTracing Tracing) Start(bufferUsageReportingInterval *float64, transferMode *tracing.TransferMode, streamFormat *tracing.StreamFormat, streamCompression *tracing.StreamCompression, traceConfig *tracing.TraceConfig) (err error)

Start start trace events collection.

See: https://chromedevtools.github.io/devtools-protocol/tot/Tracing#method-start

parameters:

  • `bufferUsageReportingInterval`: This can be nil. (Optional) If set, the agent will issue bufferUsage events at this interval, specified in milliseconds
  • `transferMode`: This can be nil. (Optional) Whether to report trace events as series of dataCollected events or to save trace to a stream (defaults to ReportEvents).
  • `streamFormat`: This can be nil. (Optional) Trace data format to use. This only applies when using ReturnAsStream transfer mode (defaults to json).
  • `streamCompression`: This can be nil. (Optional) Compression format to use. This only applies when using ReturnAsStream transfer mode (defaults to none)
  • `traceConfig`

type WebAudio

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

WebAudio executes a cdproto command under WebAudio domain.

func (WebAudio) Disable

func (doWebAudio WebAudio) Disable() (err error)

Disable disables the WebAudio domain.

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

func (WebAudio) Enable

func (doWebAudio WebAudio) Enable() (err error)

Enable enables the WebAudio domain and starts sending context lifetime events.

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

func (WebAudio) GetRealtimeData

func (doWebAudio WebAudio) GetRealtimeData(contextID webaudio.GraphObjectID) (retRealtimeData *webaudio.ContextRealtimeData, err error)

GetRealtimeData fetch the realtime data from the registered contexts.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#method-getRealtimeData

parameters:

  • `contextID`

returns:

  • `retRealtimeData`

type WebAuthn

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

WebAuthn executes a cdproto command under WebAuthn domain.

func (WebAuthn) AddCredential

func (doWebAuthn WebAuthn) AddCredential(authenticatorID webauthn.AuthenticatorID, credential *webauthn.Credential) (err error)

AddCredential adds the credential to the specified authenticator.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-addCredential

parameters:

  • `authenticatorID`
  • `credential`

func (WebAuthn) AddVirtualAuthenticator

func (doWebAuthn WebAuthn) AddVirtualAuthenticator(options *webauthn.VirtualAuthenticatorOptions) (retAuthenticatorID webauthn.AuthenticatorID, err error)

AddVirtualAuthenticator creates and adds a virtual authenticator.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-addVirtualAuthenticator

parameters:

  • `options`

returns:

  • `retAuthenticatorID`

func (WebAuthn) ClearCredentials

func (doWebAuthn WebAuthn) ClearCredentials(authenticatorID webauthn.AuthenticatorID) (err error)

ClearCredentials clears all the credentials from the specified device.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-clearCredentials

parameters:

  • `authenticatorID`

func (WebAuthn) Disable

func (doWebAuthn WebAuthn) Disable() (err error)

Disable disable the WebAuthn domain.

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

func (WebAuthn) Enable

func (doWebAuthn WebAuthn) Enable() (err error)

Enable enable the WebAuthn domain and start intercepting credential storage and retrieval with a virtual authenticator.

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

func (WebAuthn) GetCredential

func (doWebAuthn WebAuthn) GetCredential(authenticatorID webauthn.AuthenticatorID, credentialID string) (retCredential *webauthn.Credential, err error)

GetCredential returns a single credential stored in the given virtual authenticator that matches the credential ID.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-getCredential

parameters:

  • `authenticatorID`
  • `credentialID`

returns:

  • `retCredential`

func (WebAuthn) GetCredentials

func (doWebAuthn WebAuthn) GetCredentials(authenticatorID webauthn.AuthenticatorID) (retCredentials []*webauthn.Credential, err error)

GetCredentials returns all the credentials stored in the given virtual authenticator.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-getCredentials

parameters:

  • `authenticatorID`

returns:

  • `retCredentials`

func (WebAuthn) RemoveCredential

func (doWebAuthn WebAuthn) RemoveCredential(authenticatorID webauthn.AuthenticatorID, credentialID string) (err error)

RemoveCredential removes a credential from the authenticator.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-removeCredential

parameters:

  • `authenticatorID`
  • `credentialID`

func (WebAuthn) RemoveVirtualAuthenticator

func (doWebAuthn WebAuthn) RemoveVirtualAuthenticator(authenticatorID webauthn.AuthenticatorID) (err error)

RemoveVirtualAuthenticator removes the given authenticator.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-removeVirtualAuthenticator

parameters:

  • `authenticatorID`

func (WebAuthn) SetUserVerified

func (doWebAuthn WebAuthn) SetUserVerified(authenticatorID webauthn.AuthenticatorID, isUserVerified bool) (err error)

SetUserVerified sets whether User Verification succeeds or fails for an authenticator. The default is true.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#method-setUserVerified

parameters:

  • `authenticatorID`
  • `isUserVerified`

Jump to

Keyboard shortcuts

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