close

abstract suspend fun close(keepBrowserContext: Boolean = false)(source)

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

This only closes the corresponding tab, but preserves the underlying web socket connection (of the parent browser session), because it could be used by other page sessions.

If keepBrowserContext is true, the browser context of this page session will be preserved, which means that other tabs that were opened from this page session will not be force-closed.