chrome-devtools-kotlin / org.hildan.chrome.devtools.targets / ChromePageSession

ChromePageSession

class ChromePageSession : AbstractTargetSession, RenderFrameTarget

A page session, usually created when attaching to a page from the root browser session.

Properties

metaData

Info about the underlying page target.

val metaData: ChromePageMetaData

parent

The parent session which created this page target.

val parent: ChromeBrowserSession

Functions

close

Closes this page session.

suspend fun close(): Unit

detach

Detaches from this page session, leaving the tab open.

suspend fun detach(): Unit

Extension Functions

getTargetInfo

Retrieves information about this session's page target.

suspend fun ChromePageSession.getTargetInfo(): TargetInfo

navigateAndAwaitPageLoad

Navigates the current page according to the provided url, and suspends until the corresponding frameStoppedLoading event is received.

suspend fun ChromePageSession.navigateAndAwaitPageLoad(url: String): Unit

Navigates the current page according to the provided navigateRequest, and suspends until the corresponding frameStoppedLoading event is received.

suspend fun ChromePageSession.navigateAndAwaitPageLoad(navigateRequest: NavigateRequest): Unit

use

Performs the given operation in this session and closes the target.

suspend fun <T> ChromePageSession.use(block: (ChromePageSession) -> T): T