browser.process() returns the Node.js ChildProcess for a browser Puppeteer launched, or null when Puppeteer connected to a browser that already existed. Use browser.close() to shut down the browser and its pages; use browser.disconnect() to detach Puppeteer while leaving the browser running.
What Browser.process() returns
Puppeteer’s Browser API reference types the return value as ChildProcess | null. The method gives access to the Node.js process associated with the browser when Puppeteer launched it.
As an Amazon Associate I earn from qualifying purchases.
A null result is expected when the browser was opened independently and Puppeteer attached with Puppeteer.connect(). It does not, by itself, mean the connection failed. A Browser instance can represent either a browser launched with PuppeteerNode.launch() or one reached through Puppeteer.connect(), and that ownership distinction explains the nullable result.
Choose between closing and disconnecting
| Goal | Call | Effect |
|---|---|---|
| Shut down the Puppeteer-managed browser | await browser.close() |
Closes the browser and all associated pages. |
| Stop controlling the browser but keep it running | await browser.disconnect() |
Detaches Puppeteer; the browser process and pages remain open. |
| Get the process handle, if Puppeteer launched the browser | browser.process() |
Returns a ChildProcess, or null for a connected browser. |
The official browser management guide distinguishes these lifecycle operations. Prefer the browser-level methods for routine cleanup rather than treating the process handle as a substitute: closing the browser through Puppeteer also closes its pages, while disconnecting preserves the running browser.
#1 Best Overall
Read the process handle safely
Check for null before using the returned value. This example assumes browser is an existing Puppeteer Browser instance:
const child = browser.process();
if (child === null) {
console.log('Puppeteer is connected to an existing browser; no launched process handle is available.');
} else {
console.log('Browser process ID:', child.pid);
}
The returned object is Node.js’s ChildProcess. Its availability means Puppeteer has an associated launched process; it does not change which browser lifecycle method you should use.
Close or detach in a complete lifecycle
Gracefully close a browser Puppeteer launched
Await browser.close() when the task is finished and the browser should stop:
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
await page.goto('https://example.com');
// Do the browser work here.
} finally {
await browser.close();
}
The finally block ensures the close is attempted whether the browser work succeeds or throws. The documented effect is to close the browser and its associated pages.
Disconnect while keeping the browser alive
When Puppeteer should relinquish control but another client or later step needs the browser, call browser.disconnect() instead:
await browser.disconnect();
Puppeteer’s disconnect reference says this “leaves the process running.” The browser’s pages remain open as well. Disconnecting is not a shutdown operation; reconnecting later requires a way to reach that running browser.
Rank #3
Isolate tasks with BrowserContexts
If the objective is to separate browsing state rather than manage the operating-system process, use a BrowserContext. Puppeteer’s browser management guide explains that contexts do not share cookies or local storage. Closing a context closes its pages, but the default context cannot be closed. Context closure therefore ends that context’s pages without requiring you to close the entire browser.
Process-related launch options
Puppeteer’s LaunchOptions reference lists several controls relevant to process lifecycle and output. The cited reference reports version 25.12.0; options and defaults can change, so confirm them against the documentation for the version installed in your project.
handleSIGHUP,handleSIGINT, andhandleSIGTERMare shown astrueby default in that reference. They control Puppeteer’s handling of those signals.signalaccepts anAbortSignal; aborting it kills the browser process.dumpioforwards browser process stdout and stderr to the parent process.executablePathselects the browser executable path.onExitruns once after the process exits or beforeProcess.close()closes it.
These launch options concern the process Puppeteer creates. A browser reached by connecting to an existing process was not launched by that Puppeteer instance.
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
The lower-level Process class
Puppeteer’s Process class reference lists a readonly nodeProcess property typed as childProcess.ChildProcess, along with methods named close(), getRecentLogs(), hasClosed(), kill(), and waitForLineOutput(regex, timeout). That API listing establishes the names and types, but not enough detail to assume additional behavior. For implementation-specific use, consult the API reference corresponding to your installed Puppeteer version.
Troubleshooting common surprises
browser.process() is null
This is normal for a browser Puppeteer connected to rather than launched. If your code needs to shut down that browser, confirm which application owns its lifecycle; browser.close() closes the browser, whereas browser.disconnect() leaves it running.
Free tools Windows power users keep installed
One-click scans. No signup required.
The browser remains open after your script exits its Puppeteer session
Check whether the code called browser.disconnect(). That method intentionally detaches without stopping the process. Use and await browser.close() when Puppeteer-managed browser shutdown is the goal.
Best Value
Pages disappear when you close the browser
That is expected: browser.close() closes the browser and all associated pages. To keep the browser and pages alive while ending Puppeteer control, disconnect instead.
Signal or launch behavior differs between versions
Verify the installed Puppeteer version and consult its matching LaunchOptions documentation. The cited reference displays version 25.12.0, and its defaults should not be generalized to every release.
Or skip the browser setup
If the goal is simply to get a website screenshot, ScreenshotNeo offers a one-request API rather than requiring you to manage a Puppeteer browser process. Its API can remove 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.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →See the ScreenshotNeo API documentation for request options. For example, this cURL request saves a WebP capture of Stripe:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
The free plan includes 1,000 screenshots a month with no card required; paid plans start at $5 for 3,000. Sign up for ScreenshotNeo.
Quick Recap
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.




