WorkerSession

A session created when attaching to a target of type Worker.

Properties

Link copied to clipboard
abstract val io: IODomain

Input/Output operations for streams produced by DevTools.

Link copied to clipboard

Info about this session and its underlying target.

Link copied to clipboard
abstract val network: NetworkDomain

Network domain allows tracking network activities of the page. It exposes information about http, file, data and other requests and responses, their headers, bodies, timing, etc.

Link copied to clipboard
abstract val parent: BrowserSession

The parent browser session that created this target session.

Link copied to clipboard
abstract val target: TargetDomain

Supports additional targets discovery and allows to attach to them.

Functions

Link copied to clipboard

Adapts this ChildSession to a PageSession. If the attached target is not of a compatible type, this function throws an exception.

Link copied to clipboard

Adapts this ChildSession to a ServiceWorkerSession. If the attached target is not of a compatible type, this function throws an exception.

Link copied to clipboard

Adapts this ChildSession to a SharedWorkerSession. If the attached target is not of a compatible type, this function throws an exception.

Link copied to clipboard

Adapts this ChildSession to a WorkerSession. If the attached target is not of a compatible type, this function throws an exception.

Link copied to clipboard
abstract suspend fun close(keepBrowserContext: Boolean = false)

Closes this session and its target. If the target is a page, the tab gets closed.

Link copied to clipboard
abstract suspend fun closeWebSocket()

Closes the underlying web socket connection, effectively closing every session based on the same web socket connection.

Link copied to clipboard
abstract suspend fun detach()

Detaches this session from its target, effectively closing this session and all its child sessions, but without closing the corresponding target (this leaves the tab open in the case of a page session).

Link copied to clipboard
abstract fun unsafe(): AllDomainsTarget

Gives access to all domains of the protocol, regardless of the type of this session.