The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Call context.browser(). It synchronously returns the Browser instance associated with that Puppeteer BrowserContext; no await is needed. See the Puppeteer API reference.
Get the browser from a BrowserContext
Use the context’s browser() method:
const browser = context.browser();
The method returns a Browser, not a promise. Calling it retrieves the browser already associated with the context; it does not launch another browser. The signature and return type are documented in the BrowserContext.browser() reference.
As an Amazon Associate I earn from qualifying purchases.
Runnable example
This ES module example launches Puppeteer, creates a context and page, then gets the same browser instance from the context:
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch();
const context = await browser.createBrowserContext();
const page = await context.newPage();
const sameBrowser = context.browser();
console.log(sameBrowser === browser); // expected to be true
await context.close();
await browser.close();
The browser launch and context/page creation are asynchronous, so they use await. The accessor context.browser() is synchronous. The equality check follows from the documented association between the context and its browser; it is not a separate Puppeteer guarantee about every possible setup.
#1 Best Overall
Starting from a Page
If you have a Puppeteer Page rather than its context, get the context first, then the browser:
const browser = page.browserContext().browser();
Page.browserContext() returns the context to which the page belongs; BrowserContext.browser() returns that context’s browser. Both accessors are synchronous. See the Page.browserContext() reference and the BrowserContext.browser() reference.
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
How Browser, BrowserContext, and Page relate
Browserrepresents a browser instance launched with Puppeteer or connected throughPuppeteer.connect().BrowserContextrepresents a user context within that browser. Contexts isolate storage such as cookies and local storage, and can be created withbrowser.createBrowserContext().Pagebelongs to a context. A page can reach its context withpage.browserContext().
Consequently, retrieving a browser from a context gives you the associated existing browser, not a new instance. See the BrowserContext documentation and Browser documentation.
Common mistakes and fixes
- Adding unnecessary
await:await context.browser()is unnecessary because the method returnsBrowserdirectly. - Using the context-listing method:
browser.browserContexts()lists contexts; it is not the accessor for the browser from a context. Callcontext.browser(). - Starting from a page: Call
page.browserContext().browser(), rather than looking for the browser directly on the page. - Closing the wrong object:
context.close()closes that context and its associated pages. The default browser context cannot be closed; consult the BrowserContext lifecycle documentation.
Or skip the browser setup
If your goal is simply to capture a website rather than control Puppeteer directly, ScreenshotNeo returns a screenshot or PDF from one GET request. For example, this cURL request saves a WebP screenshot:
Quick Recap
Best Value
Rank #4
- Brand: Wiley
- Set of 2 Volumes
- A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
Rank #3
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. Cookie banners, popups and chat widgets are removed before capture; bot checks, blank pages and failed loads are never billed. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000. Sign up for free.
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.




