Chrome DevTools Protocol

Methods

Browser.close

Close browser gracefully.

Browser.getVersion

Returns version information.

Return Object
protocolVersion
string

Protocol version.

product
string

Product name.

revision
string

Product revision.

userAgent
string

User-Agent.

jsVersion
string

V8 version.

Browser.crash Experimental

Crashes browser on the main thread.

Browser.crashGpuProcess Experimental

Crashes GPU process.

Browser.getBrowserCommandLine Experimental

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

Return Object
arguments
array[ string ]

Commandline parameters

Browser.getHistogram Experimental

Get a Chrome histogram by name.

parameters
name
string

Requested histogram name.

delta
boolean

If true, retrieve delta since last call.

Return Object
histogram
Histogram

Histogram.

Browser.getHistograms Experimental

Get Chrome histograms.

parameters
query
string

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
boolean

If true, retrieve delta since last call.

Return Object
histograms
array[ Histogram ]

Histograms.

Browser.getWindowBounds Experimental

Get position and size of the browser window.

parameters
windowId
WindowID

Browser window id.

Return Object
bounds
Bounds

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

Browser.getWindowForTarget Experimental

Get the browser window that contains the devtools target.

parameters
targetId
Target.TargetID

Devtools agent host id. If called as a part of the session, associated targetId is used.

Return Object
windowId
WindowID

Browser window id.

bounds
Bounds

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

Browser.grantPermissions Experimental

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

parameters
permissions
array[ PermissionType ]
origin
string

Origin the permission applies to, all origins if not specified.

browserContextId
BrowserContextID

BrowserContext to override permissions. When omitted, default browser context is used.

Browser.resetPermissions Experimental

Reset all permission management for all origins.

parameters
browserContextId
BrowserContextID

BrowserContext to reset permissions. When omitted, default browser context is used.

Browser.setDockTile Experimental

Set dock tile details, platform-specific.

parameters
badgeLabel
string
image
string

Png encoded image.

Browser.setDownloadBehavior Experimental

Set the behavior when downloading a file.

parameters
behavior
string

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.

Allowed Values: deny, allow, allowAndName, default
browserContextId
BrowserContextID

BrowserContext to set download behavior. When omitted, default browser context is used.

downloadPath
string

The default path to save downloaded files to. This is requred if behavior is set to 'allow' or 'allowAndName'.

Browser.setPermission Experimental

Set permission settings for given origin.

parameters
permission
PermissionDescriptor

Descriptor of permission to override.

setting
PermissionSetting

Setting of the permission.

origin
string

Origin the permission applies to, all origins if not specified.

browserContextId
BrowserContextID

Context to override. When omitted, default browser context is used.

Browser.setWindowBounds Experimental

Set position and/or size of the browser window.

parameters
windowId
WindowID

Browser window id.

bounds
Bounds

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

Types

Browser.Bounds Experimental

Browser window bounds information

Type: object

properties
left
integer

The offset from the left edge of the screen to the window in pixels.

top
integer

The offset from the top edge of the screen to the window in pixels.

width
integer

The window width in pixels.

height
integer

The window height in pixels.

windowState
WindowState

The window state. Default to normal.

Browser.BrowserContextID Experimental

Type: string

Browser.Bucket Experimental

Chrome histogram bucket.

Type: object

properties
low
integer

Minimum value (inclusive).

high
integer

Maximum value (exclusive).

count
integer

Number of samples.

Browser.Histogram Experimental

Chrome histogram.

Type: object

properties
name
string

Name.

sum
integer

Sum of sample values.

count
integer

Total number of samples.

buckets
array[ Bucket ]

Buckets.

Browser.PermissionDescriptor Experimental

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

Type: object

properties
name
string
sysex
boolean

For "midi" permission, may also specify sysex control.

userVisibleOnly
boolean

For "push" permission, may specify userVisibleOnly. Note that userVisibleOnly = true is the only currently supported type.

allowWithoutSanitization
boolean

For "clipboard" permission, may specify allowWithoutSanitization.

Browser.PermissionSetting Experimental

Allowed Values: granted, denied, prompt

Type: string

Browser.PermissionType Experimental

Allowed Values: accessibilityEvents, audioCapture, backgroundSync, backgroundFetch, clipboardReadWrite, clipboardSanitizedWrite, durableStorage, flash, geolocation, midi, midiSysex, nfc, notifications, paymentHandler, periodicBackgroundSync, protectedMediaIdentifier, sensors, videoCapture, idleDetection, wakeLockScreen, wakeLockSystem

Type: string

Browser.WindowID Experimental

Type: integer

Browser.WindowState Experimental

The state of the browser window.

Allowed Values: normal, minimized, maximized, fullscreen

Type: string