Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesUse await browser.createBrowserContext() to create a fresh Puppeteer browser context, then call await context.newPage() to put pages in it. The context keeps cookies and cache separate from other browser contexts; close it with await context.close() when its work is done.
Runnable example
This ES module example launches a browser, creates a non-default context, opens a page inside it, and cleans up both resources. Install Puppeteer in your project first; the installed package and browser must support the APIs you use.
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch();
let context;
try {
// This context has cookies and cache separate from other contexts.
context = await browser.createBrowserContext();
const page = await context.newPage();
await page.goto('https://example.com');
// Use this page and any popups it opens.
} finally {
if (context) {
await context.close();
}
await browser.close();
}
The current Puppeteer API reference, version 25.12.0, documents browser.createBrowserContext() as returning a Promise<BrowserContext> and says the new context does not share cookies or cache with other browser contexts: Browser.createBrowserContext().
What the context isolates
A created context separates browser storage from other contexts. Puppeteer’s API overview names cookies and localStorage, and the method reference also specifies cache separation. A page opened in the created context uses that context’s state; a popup opened by that page stays in the same context. In Chrome, non-default contexts are incognito. This describes storage separation within a browser, not a separate browser process or an OS-level security boundary. See the Puppeteer API reference.
#1 Best Overall
Put pages in the right context
Use context.newPage() for a page that should use the isolated context. Calling browser.newPage() instead creates a page in the default context, so it will not use the newly created context’s separated storage. The browser API lists these as distinct operations: Puppeteer API reference.
For separate sessions, create one context per session and create each session’s pages from its own context. Popups opened by a page inherit that page’s context; they do not automatically move to the default context.
Rank #2
Close the context you create
await context.close() closes the context and all pages associated with it. The code that creates a context is responsible for its cleanup. If your function borrows a browser instance owned by another part of the application, close only the context it created; do not close the shared browser.
If your code owns the browser lifecycle, await browser.close() closes the browser and its associated pages. browser.disconnect() instead disconnects Puppeteer while leaving the browser process running. These lifecycle methods are documented in Puppeteer’s Browser API reference. The default browser context returned by browser.defaultBrowserContext() cannot be closed: Browser.defaultBrowserContext().
Optional context settings
createBrowserContext() accepts optional BrowserContextOptions. The current reference lists downloadBehavior, proxyBypassList, and proxyServer. The proxy option can specify a proxy for requests; username and password can be set with Page.authenticate(). Check the documentation for your installed Puppeteer version and browser when relying on a specific option’s support or behavior: BrowserContextOptions. None of these options is required to create an isolated context.
Common mistakes and fixes
- Calling the obsolete method: Use
createBrowserContext(), notcreateIncognitoBrowserContext(). Puppeteer records the rename as a breaking change in version 22.0.0, dated 2024-02-05: Puppeteer changelog. - Opening the page on the browser: Replace
browser.newPage()withcontext.newPage()when the page needs the new context’s state. - Leaving pages open after a task: Close the created context; doing so closes its associated pages. Close the browser only if your code owns it.
- Trying to close the default context: The default context cannot be closed. Create a non-default context if you need disposable, separated storage.
- Expecting a separate process or security sandbox: A browser context provides documented storage isolation, not a separate browser process or a guarantee of process-level security isolation.
Or skip the browser setup
If your goal is a website screenshot rather than browser automation, ScreenshotNeo can return a screenshot with one GET request. Its screenshot API removes cookie and consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are not billed. It also provides an MCP server for AI agents. The free plan includes 1,000 screenshots per month with no card, and paid plans start at $5 for 3,000.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
See the ScreenshotNeo API documentation for request options. Sign up free for 1,000 screenshots a month; no card required.
Rank #4
Frequently Asked Questions
How do I keep cookies separate between Puppeteer pages?
Create separate browser contexts and open each page with that context’s newPage() method.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Is a Puppeteer browser context a separate browser process?
No. It is a context within the browser; the documented guarantee here concerns storage separation, not a separate process.
Quick Recap
Best Value
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.




