import "github.com/chromedp/cdproto/browser"
Package browser provides the Chrome DevTools Protocol commands, types, and events for the Browser domain.
The Browser domain defines methods and events for browser managing.
Generated by the cdproto-gen command.
browser.go easyjson.go types.go
const ( CommandSetPermission = "Browser.setPermission" CommandGrantPermissions = "Browser.grantPermissions" CommandResetPermissions = "Browser.resetPermissions" CommandSetDownloadBehavior = "Browser.setDownloadBehavior" CommandClose = "Browser.close" CommandCrash = "Browser.crash" CommandCrashGpuProcess = "Browser.crashGpuProcess" CommandGetVersion = "Browser.getVersion" CommandGetBrowserCommandLine = "Browser.getBrowserCommandLine" CommandGetHistograms = "Browser.getHistograms" CommandGetHistogram = "Browser.getHistogram" CommandGetWindowBounds = "Browser.getWindowBounds" CommandGetWindowForTarget = "Browser.getWindowForTarget" CommandSetWindowBounds = "Browser.setWindowBounds" CommandSetDockTile = "Browser.setDockTile" CommandExecuteBrowserCommand = "Browser.executeBrowserCommand" )
Command names.
type Bounds struct { Left int64 `json:"left,omitempty"` // The offset from the left edge of the screen to the window in pixels. Top int64 `json:"top,omitempty"` // The offset from the top edge of the screen to the window in pixels. Width int64 `json:"width,omitempty"` // The window width in pixels. Height int64 `json:"height,omitempty"` // The window height in pixels. WindowState WindowState `json:"windowState,omitempty"` // The window state. Default to normal. }
Bounds browser window bounds information.
See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#type-Bounds
MarshalEasyJSON supports easyjson.Marshaler interface
MarshalJSON supports json.Marshaler interface
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
UnmarshalJSON supports json.Unmarshaler interface
type Bucket struct { Low int64 `json:"low"` // Minimum value (inclusive). High int64 `json:"high"` // Maximum value (exclusive). Count int64 `json:"count"` // Number of samples. }
Bucket chrome histogram bucket.
See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#type-Bucket
MarshalEasyJSON supports easyjson.Marshaler interface
MarshalJSON supports json.Marshaler interface
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
UnmarshalJSON supports json.Unmarshaler interface
type CloseParams struct{}
CloseParams close browser gracefully.
func Close() *CloseParams
Close close browser gracefully.
See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-close
func (p *CloseParams) Do(ctx context.Context) (err error)
Do executes Browser.close against the provided context.
func (v CloseParams) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v CloseParams) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *CloseParams) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *CloseParams) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
CommandID browser command ids used by executeBrowserCommand.
See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#type-BrowserCommandId
const ( CommandIDOpenTabSearch CommandID = "openTabSearch" CommandIDCloseTabSearch CommandID = "closeTabSearch" )
CommandID values.
MarshalEasyJSON satisfies easyjson.Marshaler.
MarshalJSON satisfies json.Marshaler.
String returns the CommandID as string value.
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
UnmarshalJSON satisfies json.Unmarshaler.
type CrashGpuProcessParams struct{}
CrashGpuProcessParams crashes GPU process.
func CrashGpuProcess() *CrashGpuProcessParams
CrashGpuProcess crashes GPU process.
See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-crashGpuProcess
func (p *CrashGpuProcessParams) Do(ctx context.Context) (err error)
Do executes Browser.crashGpuProcess against the provided context.
func (v CrashGpuProcessParams) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v CrashGpuProcessParams) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *CrashGpuProcessParams) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *CrashGpuProcessParams) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CrashParams struct{}
CrashParams crashes browser on the main thread.
func Crash() *CrashParams
Crash crashes browser on the main thread.
See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-crash
func (p *CrashParams) Do(ctx context.Context) (err error)
Do executes Browser.crash against the provided context.
func (v CrashParams) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v CrashParams) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *CrashParams) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *CrashParams) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
ExecuteBrowserCommandParams invoke custom browser commands used by telemetry.
func ExecuteBrowserCommand(commandID CommandID) *ExecuteBrowserCommandParams
ExecuteBrowserCommand invoke custom browser commands used by telemetry.
See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-executeBrowserCommand
parameters:
commandID
func (p *ExecuteBrowserCommandParams) Do(ctx context.Context) (err error)
Do executes Browser.executeBrowserCommand against the provided context.
func (v ExecuteBrowserCommandParams) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v ExecuteBrowserCommandParams) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *ExecuteBrowserCommandParams) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *ExecuteBrowserCommandParams) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type GetBrowserCommandLineParams struct{}
GetBrowserCommandLineParams returns the command line switches for the browser process if, and only if --enable-automation is on the commandline.
func GetBrowserCommandLine() *GetBrowserCommandLineParams
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
Do executes Browser.getBrowserCommandLine against the provided context.
returns:
arguments - Commandline parameters
func (v GetBrowserCommandLineParams) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetBrowserCommandLineParams) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *GetBrowserCommandLineParams) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetBrowserCommandLineParams) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type GetBrowserCommandLineReturns struct { Arguments []string `json:"arguments,omitempty"` // Commandline parameters }
GetBrowserCommandLineReturns return values.
func (v GetBrowserCommandLineReturns) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetBrowserCommandLineReturns) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *GetBrowserCommandLineReturns) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetBrowserCommandLineReturns) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type GetHistogramParams struct { Name string `json:"name"` // Requested histogram name. Delta bool `json:"delta,omitempty"` // If true, retrieve delta since last call. }
GetHistogramParams get a Chrome histogram by name.
func GetHistogram(name string) *GetHistogramParams
GetHistogram get a Chrome histogram by name.
See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-getHistogram
parameters:
name - Requested histogram name.
Do executes Browser.getHistogram against the provided context.
returns:
histogram - Histogram.
func (v GetHistogramParams) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetHistogramParams) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *GetHistogramParams) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetHistogramParams) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (p GetHistogramParams) WithDelta(delta bool) *GetHistogramParams
WithDelta if true, retrieve delta since last call.
type GetHistogramReturns struct { Histogram *Histogram `json:"histogram,omitempty"` // Histogram. }
GetHistogramReturns return values.
func (v GetHistogramReturns) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetHistogramReturns) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *GetHistogramReturns) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetHistogramReturns) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type GetHistogramsParams struct { Query string `json:"query,omitempty"` // 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 bool `json:"delta,omitempty"` // If true, retrieve delta since last call. }
GetHistogramsParams get Chrome histograms.
func GetHistograms() *GetHistogramsParams
GetHistograms get Chrome histograms.
See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-getHistograms
parameters:
Do executes Browser.getHistograms against the provided context.
returns:
histograms - Histograms.
func (v GetHistogramsParams) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetHistogramsParams) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *GetHistogramsParams) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetHistogramsParams) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (p GetHistogramsParams) WithDelta(delta bool) *GetHistogramsParams
WithDelta if true, retrieve delta since last call.
func (p GetHistogramsParams) WithQuery(query string) *GetHistogramsParams
WithQuery 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.
type GetHistogramsReturns struct { Histograms []*Histogram `json:"histograms,omitempty"` // Histograms. }
GetHistogramsReturns return values.
func (v GetHistogramsReturns) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetHistogramsReturns) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *GetHistogramsReturns) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetHistogramsReturns) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type GetVersionParams struct{}
GetVersionParams returns version information.
func GetVersion() *GetVersionParams
GetVersion returns version information.
See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-getVersion
func (p *GetVersionParams) Do(ctx context.Context) (protocolVersion string, product string, revision string, userAgent string, jsVersion string, err error)
Do executes Browser.getVersion against the provided context.
returns:
protocolVersion - Protocol version. product - Product name. revision - Product revision. userAgent - User-Agent. jsVersion - V8 version.
func (v GetVersionParams) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetVersionParams) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *GetVersionParams) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetVersionParams) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type GetVersionReturns struct { ProtocolVersion string `json:"protocolVersion,omitempty"` // Protocol version. Product string `json:"product,omitempty"` // Product name. Revision string `json:"revision,omitempty"` // Product revision. UserAgent string `json:"userAgent,omitempty"` // User-Agent. JsVersion string `json:"jsVersion,omitempty"` // V8 version. }
GetVersionReturns return values.
func (v GetVersionReturns) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetVersionReturns) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *GetVersionReturns) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetVersionReturns) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
GetWindowBoundsParams get position and size of the browser window.
func GetWindowBounds(windowID WindowID) *GetWindowBoundsParams
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.
Do executes Browser.getWindowBounds against the provided context.
returns:
bounds - Bounds information of the window. When window state is 'minimized', the restored window position and size are returned.
func (v GetWindowBoundsParams) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetWindowBoundsParams) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *GetWindowBoundsParams) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetWindowBoundsParams) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type GetWindowBoundsReturns struct { Bounds *Bounds `json:"bounds,omitempty"` // Bounds information of the window. When window state is 'minimized', the restored window position and size are returned. }
GetWindowBoundsReturns return values.
func (v GetWindowBoundsReturns) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetWindowBoundsReturns) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *GetWindowBoundsReturns) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetWindowBoundsReturns) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type GetWindowForTargetParams struct { TargetID target.ID `json:"targetId,omitempty"` // Devtools agent host id. If called as a part of the session, associated targetId is used. }
GetWindowForTargetParams get the browser window that contains the devtools target.
func GetWindowForTarget() *GetWindowForTargetParams
GetWindowForTarget get the browser window that contains the devtools target.
See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-getWindowForTarget
parameters:
func (p *GetWindowForTargetParams) Do(ctx context.Context) (windowID WindowID, bounds *Bounds, err error)
Do executes Browser.getWindowForTarget against the provided context.
returns:
windowID - Browser window id. bounds - Bounds information of the window. When window state is 'minimized', the restored window position and size are returned.
func (v GetWindowForTargetParams) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetWindowForTargetParams) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *GetWindowForTargetParams) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetWindowForTargetParams) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (p GetWindowForTargetParams) WithTargetID(targetID target.ID) *GetWindowForTargetParams
WithTargetID devtools agent host id. If called as a part of the session, associated targetId is used.
type GetWindowForTargetReturns struct { WindowID WindowID `json:"windowId,omitempty"` // Browser window id. Bounds *Bounds `json:"bounds,omitempty"` // Bounds information of the window. When window state is 'minimized', the restored window position and size are returned. }
GetWindowForTargetReturns return values.
func (v GetWindowForTargetReturns) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetWindowForTargetReturns) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *GetWindowForTargetReturns) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetWindowForTargetReturns) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type GrantPermissionsParams struct { Permissions []PermissionType `json:"permissions"` Origin string `json:"origin,omitempty"` // Origin the permission applies to, all origins if not specified. BrowserContextID cdp.BrowserContextID `json:"browserContextId,omitempty"` // BrowserContext to override permissions. When omitted, default browser context is used. }
GrantPermissionsParams grant specific permissions to the given origin and reject all others.
func GrantPermissions(permissions []PermissionType) *GrantPermissionsParams
GrantPermissions grant specific permissions to the given origin and reject all others.
See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-grantPermissions
parameters:
permissions
func (p *GrantPermissionsParams) Do(ctx context.Context) (err error)
Do executes Browser.grantPermissions against the provided context.
func (v GrantPermissionsParams) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v GrantPermissionsParams) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *GrantPermissionsParams) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GrantPermissionsParams) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (p GrantPermissionsParams) WithBrowserContextID(browserContextID cdp.BrowserContextID) *GrantPermissionsParams
WithBrowserContextID browserContext to override permissions. When omitted, default browser context is used.
func (p GrantPermissionsParams) WithOrigin(origin string) *GrantPermissionsParams
WithOrigin origin the permission applies to, all origins if not specified.
type Histogram struct { Name string `json:"name"` // Name. Sum int64 `json:"sum"` // Sum of sample values. Count int64 `json:"count"` // Total number of samples. Buckets []*Bucket `json:"buckets"` // Buckets. }
Histogram chrome histogram.
See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#type-Histogram
MarshalEasyJSON supports easyjson.Marshaler interface
MarshalJSON supports json.Marshaler interface
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
UnmarshalJSON supports json.Unmarshaler interface
type PermissionDescriptor struct { Name string `json:"name"` // Name of permission. See https://cs.chromium.org/chromium/src/third_party/blink/renderer/modules/permissions/permission_descriptor.idl for valid permission names. Sysex bool `json:"sysex,omitempty"` // For "midi" permission, may also specify sysex control. UserVisibleOnly bool `json:"userVisibleOnly,omitempty"` // For "push" permission, may specify userVisibleOnly. Note that userVisibleOnly = true is the only currently supported type. AllowWithoutSanitization bool `json:"allowWithoutSanitization,omitempty"` // For "clipboard" permission, may specify allowWithoutSanitization. PanTiltZoom bool `json:"panTiltZoom,omitempty"` // For "camera" permission, may specify panTiltZoom. }
PermissionDescriptor definition of PermissionDescriptor defined in the Permissions API: https://w3c.github.io/permissions/#dictdef-permissiondescriptor.
See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#type-PermissionDescriptor
func (v PermissionDescriptor) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v PermissionDescriptor) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *PermissionDescriptor) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *PermissionDescriptor) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
PermissionSetting [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#type-PermissionSetting
const ( PermissionSettingGranted PermissionSetting = "granted" PermissionSettingDenied PermissionSetting = "denied" PermissionSettingPrompt PermissionSetting = "prompt" )
PermissionSetting values.
func (t PermissionSetting) MarshalEasyJSON(out *jwriter.Writer)
MarshalEasyJSON satisfies easyjson.Marshaler.
func (t PermissionSetting) MarshalJSON() ([]byte, error)
MarshalJSON satisfies json.Marshaler.
func (t PermissionSetting) String() string
String returns the PermissionSetting as string value.
func (t *PermissionSetting) UnmarshalEasyJSON(in *jlexer.Lexer)
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *PermissionSetting) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies json.Unmarshaler.
PermissionType [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#type-PermissionType
const ( PermissionTypeAccessibilityEvents PermissionType = "accessibilityEvents" PermissionTypeAudioCapture PermissionType = "audioCapture" PermissionTypeBackgroundSync PermissionType = "backgroundSync" PermissionTypeBackgroundFetch PermissionType = "backgroundFetch" PermissionTypeClipboardReadWrite PermissionType = "clipboardReadWrite" PermissionTypeClipboardSanitizedWrite PermissionType = "clipboardSanitizedWrite" PermissionTypeDisplayCapture PermissionType = "displayCapture" PermissionTypeDurableStorage PermissionType = "durableStorage" PermissionTypeFlash PermissionType = "flash" PermissionTypeGeolocation PermissionType = "geolocation" PermissionTypeMidi PermissionType = "midi" PermissionTypeMidiSysex PermissionType = "midiSysex" PermissionTypeNfc PermissionType = "nfc" PermissionTypeNotifications PermissionType = "notifications" PermissionTypePaymentHandler PermissionType = "paymentHandler" PermissionTypePeriodicBackgroundSync PermissionType = "periodicBackgroundSync" PermissionTypeProtectedMediaIdentifier PermissionType = "protectedMediaIdentifier" PermissionTypeSensors PermissionType = "sensors" PermissionTypeVideoCapture PermissionType = "videoCapture" PermissionTypeVideoCapturePanTiltZoom PermissionType = "videoCapturePanTiltZoom" PermissionTypeIdleDetection PermissionType = "idleDetection" PermissionTypeWakeLockScreen PermissionType = "wakeLockScreen" PermissionTypeWakeLockSystem PermissionType = "wakeLockSystem" )
PermissionType values.
func (t PermissionType) MarshalEasyJSON(out *jwriter.Writer)
MarshalEasyJSON satisfies easyjson.Marshaler.
func (t PermissionType) MarshalJSON() ([]byte, error)
MarshalJSON satisfies json.Marshaler.
func (t PermissionType) String() string
String returns the PermissionType as string value.
func (t *PermissionType) UnmarshalEasyJSON(in *jlexer.Lexer)
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *PermissionType) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies json.Unmarshaler.
type ResetPermissionsParams struct { BrowserContextID cdp.BrowserContextID `json:"browserContextId,omitempty"` // BrowserContext to reset permissions. When omitted, default browser context is used. }
ResetPermissionsParams reset all permission management for all origins.
func ResetPermissions() *ResetPermissionsParams
ResetPermissions reset all permission management for all origins.
See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-resetPermissions
parameters:
func (p *ResetPermissionsParams) Do(ctx context.Context) (err error)
Do executes Browser.resetPermissions against the provided context.
func (v ResetPermissionsParams) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v ResetPermissionsParams) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *ResetPermissionsParams) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *ResetPermissionsParams) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (p ResetPermissionsParams) WithBrowserContextID(browserContextID cdp.BrowserContextID) *ResetPermissionsParams
WithBrowserContextID browserContext to reset permissions. When omitted, default browser context is used.
type SetDockTileParams struct { BadgeLabel string `json:"badgeLabel,omitempty"` Image string `json:"image,omitempty"` // Png encoded image. }
SetDockTileParams set dock tile details, platform-specific.
func SetDockTile() *SetDockTileParams
SetDockTile set dock tile details, platform-specific.
See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-setDockTile
parameters:
func (p *SetDockTileParams) Do(ctx context.Context) (err error)
Do executes Browser.setDockTile against the provided context.
func (v SetDockTileParams) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v SetDockTileParams) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *SetDockTileParams) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *SetDockTileParams) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (p SetDockTileParams) WithBadgeLabel(badgeLabel string) *SetDockTileParams
WithBadgeLabel [no description].
func (p SetDockTileParams) WithImage(image string) *SetDockTileParams
WithImage png encoded image.
SetDownloadBehaviorBehavior whether to allow all or deny all download requests, or use default Chrome behavior if available (otherwise deny). |allowAndName| allows download and names files according to their dowmload guids.
See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-setDownloadBehavior
const ( SetDownloadBehaviorBehaviorDeny SetDownloadBehaviorBehavior = "deny" SetDownloadBehaviorBehaviorAllow SetDownloadBehaviorBehavior = "allow" SetDownloadBehaviorBehaviorAllowAndName SetDownloadBehaviorBehavior = "allowAndName" SetDownloadBehaviorBehaviorDefault SetDownloadBehaviorBehavior = "default" )
SetDownloadBehaviorBehavior values.
func (t SetDownloadBehaviorBehavior) MarshalEasyJSON(out *jwriter.Writer)
MarshalEasyJSON satisfies easyjson.Marshaler.
func (t SetDownloadBehaviorBehavior) MarshalJSON() ([]byte, error)
MarshalJSON satisfies json.Marshaler.
func (t SetDownloadBehaviorBehavior) String() string
String returns the SetDownloadBehaviorBehavior as string value.
func (t *SetDownloadBehaviorBehavior) UnmarshalEasyJSON(in *jlexer.Lexer)
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *SetDownloadBehaviorBehavior) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies json.Unmarshaler.
type SetDownloadBehaviorParams struct { Behavior SetDownloadBehaviorBehavior `json:"behavior"` // Whether to allow all or deny all download requests, or use default Chrome behavior if available (otherwise deny). |allowAndName| allows download and names files according to their dowmload guids. BrowserContextID cdp.BrowserContextID `json:"browserContextId,omitempty"` // BrowserContext to set download behavior. When omitted, default browser context is used. DownloadPath string `json:"downloadPath,omitempty"` // The default path to save downloaded files to. This is required if behavior is set to 'allow' or 'allowAndName'. }
SetDownloadBehaviorParams set the behavior when downloading a file.
func SetDownloadBehavior(behavior SetDownloadBehaviorBehavior) *SetDownloadBehaviorParams
SetDownloadBehavior set the behavior when downloading a file.
See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-setDownloadBehavior
parameters:
behavior - Whether to allow all or deny all download requests, or use default Chrome behavior if available (otherwise deny). |allowAndName| allows download and names files according to their dowmload guids.
func (p *SetDownloadBehaviorParams) Do(ctx context.Context) (err error)
Do executes Browser.setDownloadBehavior against the provided context.
func (v SetDownloadBehaviorParams) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v SetDownloadBehaviorParams) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *SetDownloadBehaviorParams) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *SetDownloadBehaviorParams) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (p SetDownloadBehaviorParams) WithBrowserContextID(browserContextID cdp.BrowserContextID) *SetDownloadBehaviorParams
WithBrowserContextID browserContext to set download behavior. When omitted, default browser context is used.
func (p SetDownloadBehaviorParams) WithDownloadPath(downloadPath string) *SetDownloadBehaviorParams
WithDownloadPath the default path to save downloaded files to. This is required if behavior is set to 'allow' or 'allowAndName'.
type SetPermissionParams struct { Permission *PermissionDescriptor `json:"permission"` // Descriptor of permission to override. Setting PermissionSetting `json:"setting"` // Setting of the permission. Origin string `json:"origin,omitempty"` // Origin the permission applies to, all origins if not specified. BrowserContextID cdp.BrowserContextID `json:"browserContextId,omitempty"` // Context to override. When omitted, default browser context is used. }
SetPermissionParams set permission settings for given origin.
func SetPermission(permission *PermissionDescriptor, setting PermissionSetting) *SetPermissionParams
SetPermission set permission settings for given origin.
See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-setPermission
parameters:
permission - Descriptor of permission to override. setting - Setting of the permission.
func (p *SetPermissionParams) Do(ctx context.Context) (err error)
Do executes Browser.setPermission against the provided context.
func (v SetPermissionParams) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v SetPermissionParams) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *SetPermissionParams) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *SetPermissionParams) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (p SetPermissionParams) WithBrowserContextID(browserContextID cdp.BrowserContextID) *SetPermissionParams
WithBrowserContextID context to override. When omitted, default browser context is used.
func (p SetPermissionParams) WithOrigin(origin string) *SetPermissionParams
WithOrigin origin the permission applies to, all origins if not specified.
type SetWindowBoundsParams struct { WindowID WindowID `json:"windowId"` // Browser window id. Bounds *Bounds `json:"bounds"` // New window bounds. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'. Leaves unspecified fields unchanged. }
SetWindowBoundsParams set position and/or size of the browser window.
func SetWindowBounds(windowID WindowID, bounds *Bounds) *SetWindowBoundsParams
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.
func (p *SetWindowBoundsParams) Do(ctx context.Context) (err error)
Do executes Browser.setWindowBounds against the provided context.
func (v SetWindowBoundsParams) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (v SetWindowBoundsParams) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (v *SetWindowBoundsParams) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *SetWindowBoundsParams) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
WindowID [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#type-WindowID
Int64 returns the WindowID as int64 value.
WindowState the state of the browser window.
See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#type-WindowState
const ( WindowStateNormal WindowState = "normal" WindowStateMinimized WindowState = "minimized" WindowStateMaximized WindowState = "maximized" WindowStateFullscreen WindowState = "fullscreen" )
WindowState values.
func (t WindowState) MarshalEasyJSON(out *jwriter.Writer)
MarshalEasyJSON satisfies easyjson.Marshaler.
func (t WindowState) MarshalJSON() ([]byte, error)
MarshalJSON satisfies json.Marshaler.
func (t WindowState) String() string
String returns the WindowState as string value.
func (t *WindowState) UnmarshalEasyJSON(in *jlexer.Lexer)
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *WindowState) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies json.Unmarshaler.
Package browser imports 8 packages (graph) and is imported by 8 packages. Updated 2021-01-06. Refresh now. Tools for package owners.