Back to Puppeteer

Browser.pages() method

website/versioned_docs/version-24.40.0/api/puppeteer.browser.pages.md

19.2.2915 B
Original Source

Browser.pages() method

Gets a list of all open pages inside this Browser.

If there are multiple browser contexts, this returns all pages in all browser contexts.

Signature

typescript
class Browser {
  pages(includeAll?: boolean): Promise<Page[]>;
}

Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead> <tbody><tr><td>

includeAll

</td><td>

boolean

</td><td>

(Optional) experimental, setting to true includes all kinds of pages.

</td></tr> </tbody></table>

Returns:

Promise<Page[]>

Remarks

Non-visible pages, such as "background_page", will not be listed here. You can find them using Target.page().