clj-chrome-devtools.commands.browser

The Browser domain defines methods and events for browser managing.

cancel-download

(cancel-download)(cancel-download {:as params, :keys [guid browser-context-id]})(cancel-download connection {:as params, :keys [guid browser-context-id]})

Cancel a download if in progress

Parameters map keys:

Key Description
:guid Global unique identifier of the download.
:browser-context-id BrowserContext to perform the action in. When omitted, default browser context is used. (optional)

close

(close)(close {:as params, :keys []})(close connection {:as params, :keys []})

Close browser gracefully.

crash

(crash)(crash {:as params, :keys []})(crash connection {:as params, :keys []})

Crashes browser on the main thread.

crash-gpu-process

(crash-gpu-process)(crash-gpu-process {:as params, :keys []})(crash-gpu-process connection {:as params, :keys []})

Crashes GPU process.

execute-browser-command

(execute-browser-command)(execute-browser-command {:as params, :keys [command-id]})(execute-browser-command connection {:as params, :keys [command-id]})

Invoke custom browser commands used by telemetry.

Parameters map keys:

Key Description
:command-id null

get-browser-command-line

(get-browser-command-line)(get-browser-command-line {:as params, :keys []})(get-browser-command-line connection {:as params, :keys []})

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

Return map keys:

Key Description
:arguments Commandline parameters

get-histogram

(get-histogram)(get-histogram {:as params, :keys [name delta]})(get-histogram connection {:as params, :keys [name delta]})

Get a Chrome histogram by name.

Parameters map keys:

Key Description
:name Requested histogram name.
:delta If true, retrieve delta since last call. (optional)

Return map keys:

Key Description
:histogram Histogram.

get-histograms

(get-histograms)(get-histograms {:as params, :keys [query delta]})(get-histograms connection {:as params, :keys [query delta]})

Get Chrome histograms.

Parameters map keys:

Key Description
:query Requested substring in name. Only histograms which have query as a

substring in their name are extracted. An empty or absent query returns all histograms. (optional) :delta | If true, retrieve delta since last call. (optional)

Return map keys:

Key Description
:histograms Histograms.

get-version

(get-version)(get-version {:as params, :keys []})(get-version connection {:as params, :keys []})

Returns version information.

Return map keys:

Key Description
:protocol-version Protocol version.
:product Product name.
:revision Product revision.
:user-agent User-Agent.
:js-version V8 version.

get-window-bounds

(get-window-bounds)(get-window-bounds {:as params, :keys [window-id]})(get-window-bounds connection {:as params, :keys [window-id]})

Get position and size of the browser window.

Parameters map keys:

Key Description
:window-id Browser window id.

Return map keys:

Key Description
:bounds Bounds information of the window. When window state is ‘minimized’, the restored window

position and size are returned.

get-window-for-target

(get-window-for-target)(get-window-for-target {:as params, :keys [target-id]})(get-window-for-target connection {:as params, :keys [target-id]})

Get the browser window that contains the devtools target.

Parameters map keys:

Key Description
:target-id Devtools agent host id. If called as a part of the session, associated targetId is used. (optional)

Return map keys:

Key Description
:window-id Browser window id.
:bounds Bounds information of the window. When window state is ‘minimized’, the restored window

position and size are returned.

grant-permissions

(grant-permissions)(grant-permissions {:as params, :keys [permissions origin browser-context-id]})(grant-permissions connection {:as params, :keys [permissions origin browser-context-id]})

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

Parameters map keys:

Key Description
:permissions null
:origin Origin the permission applies to, all origins if not specified. (optional)
:browser-context-id BrowserContext to override permissions. When omitted, default browser context is used. (optional)

reset-permissions

(reset-permissions)(reset-permissions {:as params, :keys [browser-context-id]})(reset-permissions connection {:as params, :keys [browser-context-id]})

Reset all permission management for all origins.

Parameters map keys:

Key Description
:browser-context-id BrowserContext to reset permissions. When omitted, default browser context is used. (optional)

set-dock-tile

(set-dock-tile)(set-dock-tile {:as params, :keys [badge-label image]})(set-dock-tile connection {:as params, :keys [badge-label image]})

Set dock tile details, platform-specific.

Parameters map keys:

Key Description
:badge-label null (optional)
:image Png encoded image. (Encoded as a base64 string when passed over JSON) (optional)

set-download-behavior

(set-download-behavior)(set-download-behavior {:as params, :keys [behavior browser-context-id download-path events-enabled]})(set-download-behavior connection {:as params, :keys [behavior browser-context-id download-path events-enabled]})

Set the behavior when downloading a file.

Parameters map keys:

Key Description
: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. :browser-context-id | BrowserContext to set download behavior. When omitted, default browser context is used. (optional) :download-path | The default path to save downloaded files to. This is required if behavior is set to ‘allow’ or ‘allowAndName’. (optional) :events-enabled | Whether to emit download events (defaults to false). (optional)

set-permission

(set-permission)(set-permission {:as params, :keys [permission setting origin browser-context-id]})(set-permission connection {:as params, :keys [permission setting origin browser-context-id]})

Set permission settings for given origin.

Parameters map keys:

Key Description
:permission Descriptor of permission to override.
:setting Setting of the permission.
:origin Origin the permission applies to, all origins if not specified. (optional)
:browser-context-id Context to override. When omitted, default browser context is used. (optional)

set-window-bounds

(set-window-bounds)(set-window-bounds {:as params, :keys [window-id bounds]})(set-window-bounds connection {:as params, :keys [window-id bounds]})

Set position and/or size of the browser window.

Parameters map keys:

Key Description
:window-id 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.