ChromeDPHttpApi

An API to interact with Chrome's JSON HTTP endpoints.

Use ChromeDP.httpApi to get an instance of this API.

These endpoints should mostly be used to query metadata about the protocol. Prefer the richer web socket API to interact with the browser using the Chrome DevTools Protocol.

Inheritors

Functions

Link copied to clipboard
abstract suspend fun activateTab(targetId: String): String

Brings the page identified by the given targetId into the foreground (activates a tab).

Link copied to clipboard
open suspend fun closeAllTargets()

Closes all targets.

Link copied to clipboard
abstract suspend fun closeTab(targetId: String): String

Closes the page identified by targetId.

Link copied to clipboard
abstract suspend fun newTab(url: String = "about:blank"): ChromeDPTarget

Opens a new tab, and returns the websocket target data for the new tab.

Link copied to clipboard
abstract suspend fun protocolJson(): String

Fetches the current Chrome DevTools Protocol definition, as a JSON string.

Link copied to clipboard
abstract suspend fun targets(): List<ChromeDPTarget>

Fetches the list of all available web socket targets (e.g. browser tabs).

Link copied to clipboard
abstract suspend fun version(): ChromeVersion

Fetches the browser version metadata via the debugger's HTTP API.

Link copied to clipboard
abstract suspend fun webSocket(): BrowserSession

Opens a web socket connection to interact with the browser.