screenshot

abstract suspend fun screenshot(format: ImageFormat = ImageFormat.Png, quality: Int = 90): ByteArray

Captures the viewport by drawing the view.

Throws

ErrorCode.UNSUPPORTED on a one-pixel session. Pass a viewport to HeadlessBrowser.newPage when a screenshot is wanted.