Files
browser-automation-botGitHubrelease-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
4d7b677d1d chore: release main (#15201)
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
2026-07-27 14:29:23 +02:00

1.7 KiB

sidebar_label
sidebar_label
Page.screenshot

Page.screenshot() method

screenshot(): Promise<string>

Captures a screenshot of this page.

Signature

class Page {
  screenshot(
    options: Readonly<ScreenshotOptions> & {
      encoding: 'base64';
    },
  ): Promise<string>;
}

Parameters

Parameter

Type

Description

options

Readonly<ScreenshotOptions> & { encoding: 'base64'; }

Configures screenshot behavior.

Returns:

Promise<string>

Remarks

While a screenshot is being taken in a BrowserContext, the following methods will automatically wait for the screenshot to finish to prevent interference with the screenshot process: BrowserContext.newPage(), Browser.newPage(), Page.close().

Calling Page.bringToFront() will not wait for existing screenshot operations.

screenshot(): Promise<Uint8Array>

Signature

class Page {
  screenshot(options?: Readonly<ScreenshotOptions>): Promise<Uint8Array>;
}

Parameters

Parameter

Type

Description

options

Readonly<ScreenshotOptions>

(Optional)

Returns:

Promise<Uint8Array>