Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk4 min

List Open Pages in Puppeteer

Puppeteer’s browser.pages() lists open pages across browser contexts. Use context.pages() for one context, and account for hidden pages and unspecified ordering.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use await browser.pages() to get a Page[] for all open pages across a Puppeteer browser’s contexts. To list pages in just one context, use await context.pages(). Both methods are asynchronous, and the ordinary listing omits non-visible pages such as extension background pages.

List pages across the browser

Call pages() on the Browser instance and await its promise before iterating. Each result is a Puppeteer Page, which represents a browser tab or an extension background page.

As an Amazon Associate I earn from qualifying purchases.

const pages = await browser.pages();

for (const page of pages) {
  console.log(await page.title(), page.url());
}

browser.pages() includes pages from all browser contexts belonging to that browser. A launched browser has at least a default context, and applications can create additional contexts. Choose this method when you need browser-wide discovery rather than pages in a particular user context.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Limit the listing to one browser context

Call pages() on the BrowserContext when the task is scoped to that context:

const contextPages = await context.pages();

The returned value is also a Promise<Page[]>, but it contains pages in that context only. A popup opened by a page belongs to its parent page’s context, so it is included in that context’s listing.

Method Call on Scope Result
browser.pages() Browser All browser contexts Promise<Page[]>
context.pages() BrowserContext That context only Promise<Page[]>

Know what the result includes

The ordinary listing does not include non-visible pages; Puppeteer’s API documentation gives background_page as an example. The methods accept an optional includeAll boolean, documented as experimental. Setting it to true includes all kinds of pages according to the API reference:

const allPages = await browser.pages(true);
const allContextPages = await context.pages(true);

If you specifically need a non-visible target such as an extension background page, the Puppeteer API documentation points to Target.page() for finding it. Do not assume the returned array is ordered by visible tab position: the API references do not specify a stable ordering contract.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Handle results safely

  • Await the call: both methods return promises. Iterating before awaiting gives you a promise, not a page array.
  • Choose the scope deliberately: use the browser method for all contexts and the context method for just one context.
  • Do not rely on tab order: if your logic depends on a particular page, identify it by a property such as URL or title instead of an assumed array position.
  • Account for page changes: tabs can be opened or closed while your program runs. Take a fresh listing when you need current state.

Troubleshooting

The result is empty or missing a page

Confirm that you are calling the method on the intended browser or context and that the page has been created in that scope. If the missing page is non-visible, the ordinary listing may omit it; the optional experimental includeAll argument or the documented Target.page() route may be relevant.

The code says the result is not iterable

Await the method call before using a loop: const pages = await browser.pages();. Without await, pages is a promise.

The page order does not match the tabs you expected

The API references do not promise visible-tab ordering. Find a page by its URL, title, or another property your application controls; do not use an array index as a tab identity.

A method or option behaves differently in your installation

The reviewed Puppeteer API references displayed different 25.x versions: the Browser reference showed 25.9.0, while the BrowserContext reference showed 25.12.0. Check the documentation matching your installed package, especially before relying on the experimental includeAll option.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your goal is a screenshot of a URL rather than enumerating tabs in an existing Puppeteer browser, ScreenshotNeo can return an image or PDF from one GET request. Its API does not list open Puppeteer pages.

Best Value
The SQL Programming Language: .
  • Used Book in Good Condition

cURL, with the API details in the ScreenshotNeo documentation:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

The same request in Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Or Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
  • Cookie and consent banners, newsletter popups, and chat widgets are removed before capture; each cleanup step can be turned off.
  • Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed; response headers indicate the page verdict and billing status.
  • An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents.
  • The Free plan includes 1,000 screenshots per month with no card required; paid plans start at $5 for 3,000 screenshots.

Sign up for ScreenshotNeo’s free plan to try 1,000 screenshots a month with no card.

Frequently Asked Questions

What type does Puppeteer return from pages()?

A promise that resolves to an array of Puppeteer Page objects: Promise<Page[]>.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Does browser.pages() include pages from other browser contexts?

Yes. It lists pages across the browser’s contexts; use context.pages() when you want only one context.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.