CDPotion.Domain.Browser (cdpotion v0.1.0)

Summary

Functions

Allows a site to use privacy sandbox features that require enrollment without the site actually being enrolled. Only supported on page targets.

Cancel a download if in progress

Close browser gracefully.

Crashes browser on the main thread.

Crashes GPU process.

Invoke custom browser commands used by telemetry.

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

Get a Chrome histogram by name.

Returns version information.

Get position and size of the browser window.

Get the browser window that contains the devtools target.

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

Reset all permission management for all origins.

Set dock tile details, platform-specific.

Set position and/or size of the browser window.

Functions

Link to this function

add_privacy_sandbox_enrollment_override(url)

Allows a site to use privacy sandbox features that require enrollment without the site actually being enrolled. Only supported on page targets.

Parameters:

  • url:string: description not provided :(
Link to this function

cancel_download(guid, browser_context_id \\ nil)

Cancel a download if in progress

Parameters:

  • guid:string: Global unique identifier of the download.
  • browserContextId:BrowserContextID: (Optional) BrowserContext to perform the action in. When omitted, default browser context is used.

Close browser gracefully.

Crashes browser on the main thread.

Link to this function

crash_gpu_process()

Crashes GPU process.

Link to this function

execute_browser_command(command_id)

Invoke custom browser commands used by telemetry.

Parameters:

  • commandId:BrowserCommandId: description not provided :(
Link to this function

get_browser_command_line()

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

Link to this function

get_histogram(name, delta \\ nil)

Get a Chrome histogram by name.

Parameters:

  • name:string: Requested histogram name.
  • delta:boolean: (Optional) If true, retrieve delta since last delta call.
Link to this function

get_histograms(query \\ nil, delta \\ nil)

Get Chrome histograms.

Parameters:

  • query:string: (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:boolean: (Optional) If true, retrieve delta since last delta call.

Returns version information.

Link to this function

get_window_bounds(window_id)

Get position and size of the browser window.

Parameters:

  • windowId:WindowID: Browser window id.
Link to this function

get_window_for_target(target_id \\ nil)

Get the browser window that contains the devtools target.

Parameters:

  • targetId:Target.TargetID: (Optional) Devtools agent host id. If called as a part of the session, associated targetId is used.
Link to this function

grant_permissions(permissions, origin \\ nil, browser_context_id \\ nil)

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

Parameters:

  • permissions:array: description not provided :(
  • origin:string: (Optional) Origin the permission applies to, all origins if not specified.
  • browserContextId:BrowserContextID: (Optional) BrowserContext to override permissions. When omitted, default browser context is used.
Link to this function

reset_permissions(browser_context_id \\ nil)

Reset all permission management for all origins.

Parameters:

  • browserContextId:BrowserContextID: (Optional) BrowserContext to reset permissions. When omitted, default browser context is used.
Link to this function

set_dock_tile(badge_label \\ nil, image \\ nil)

Set dock tile details, platform-specific.

Parameters:

  • badgeLabel:string: (Optional) description not provided :(
  • image:string: (Optional) Png encoded image. (Encoded as a base64 string when passed over JSON)
Link to this function

set_download_behavior(behavior, browser_context_id \\ nil, download_path \\ nil, events_enabled \\ nil)

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.
  • browserContextId:BrowserContextID: (Optional) BrowserContext to set download behavior. When omitted, default browser context is used.
  • downloadPath:string: (Optional) The default path to save downloaded files to. This is required if behavior is set to 'allow' or 'allowAndName'.
  • eventsEnabled:boolean: (Optional) Whether to emit download events (defaults to false).
Link to this function

set_permission(permission, setting, origin \\ nil, browser_context_id \\ nil)

Set permission settings for given origin.

Parameters:

  • permission:PermissionDescriptor: Descriptor of permission to override.
  • setting:PermissionSetting: Setting of the permission.
  • origin:string: (Optional) Origin the permission applies to, all origins if not specified.
  • browserContextId:BrowserContextID: (Optional) Context to override. When omitted, default browser context is used.
Link to this function

set_window_bounds(window_id, bounds)

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.