For a browser launched with puppeteer.launch(), call browser.process() and listen for the returned Node.js child process’s exit event. That confirms the operating-system process exited. Puppeteer’s disconnected event only means its connection ended; it does not prove that the browser process stopped.
Check for actual browser process exit
Install the listener immediately after launching the browser so you can observe an early exit:
As an Amazon Associate I earn from qualifying purchases.
const puppeteer = require('puppeteer');
async function main() {
const browser = await puppeteer.launch();
const child = browser.process();
if (!child) {
throw new Error('No child process handle: was this browser launched with puppeteer.launch()?');
}
child.once('exit', (code, signal) => {
console.log('Browser process exited', { code, signal });
});
// Use the browser here. For example:
// const page = await browser.newPage();
// await page.goto('https://example.com');
}
main().catch(console.error);
browser.process() returns the associated ChildProcess for a browser Puppeteer launched. Its exit event is the relevant process-level signal. The callback’s code and signal are the values emitted by that child-process event; do not assume a particular exit cause from the event alone.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Some Puppeteer versions also expose hasClosed() on the browser-process wrapper. Check the API reference for the version installed in your project before relying on that method or version-specific launch options.
#1 Best Overall
Choose the signal for the lifecycle you mean
| Question | Use | What it tells you |
|---|---|---|
| Did a page close? | page.isClosed() |
Whether that page is closed, not whether the browser process exited. |
| Did Puppeteer lose its connection? | browser.connected or the browser’s disconnected event |
Connection state only. The browser may still be running. |
| Did a Puppeteer-launched browser process exit? | browser.process() and its exit event |
OS process termination. |
| Did Puppeteer request browser shutdown? | browser.close() |
Closes the browser and its associated pages; observe the process separately if you need confirmation of OS-level exit. |
| Do you only want to detach Puppeteer? | browser.disconnect() |
Ends Puppeteer’s connection without shutting down the browser or closing its pages. |
Launched browsers and connected browsers differ
Browser launched by this Puppeteer process
After puppeteer.launch(), browser.process() gives you the process handle to monitor. Keep the handle and attach the listener promptly. If you call browser.close(), that requests shutdown; the child-process event is the separate confirmation that the process exited.
Browser attached with puppeteer.connect()
For a browser attached using puppeteer.connect(), browser.process() returns null. The connected Puppeteer client does not own the launcher’s child-process handle, so it cannot use this browser object to observe that process’s OS exit. Monitor it in the code or service that launched the browser. The connected client can still observe its Puppeteer connection state, but that is not process-exit proof.
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
Close the browser or disconnect?
Use await browser.close() when your code should shut down the browser and its pages. Use await browser.disconnect() when Puppeteer should detach while leaving the browser running. A disconnect can therefore happen without process exit; do not treat the browser’s disconnected event as a substitute for the child process’s exit event. See the Puppeteer browser management guide and Browser API.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Common mistakes and fixes
- Using
disconnectedas proof Chrome exited: it records Puppeteer connection loss. To confirm exit for a launched browser, watch its child process. - Checking
page.isClosed(): that reports only the page’s state. Use the browser process handle for process exit. - Expecting a process handle after
puppeteer.connect():browser.process()isnullfor a connected browser. Monitor the process where it was launched. - Calling
browser.close()when you meant to detach: close shuts down the browser and pages; disconnect detaches Puppeteer and leaves them running. - Adding the listener late: a process may exit before a late listener is attached. Register it as soon as you have the browser object and process handle.
Launch and shutdown options
Puppeteer’s launch options document handling for SIGHUP, SIGINT, and SIGTERM, as well as an AbortSignal option that closes the browser when aborted. The onExit option appears in the next documentation; verify that it exists in the installed Puppeteer version before using it. These options concern shutdown behavior, not a replacement for observing the child process when you need confirmation of actual exit. See the LaunchOptions API.
Rank #3
Or skip the browser setup
If your goal is to capture a website rather than manage a Puppeteer process, ScreenshotNeo provides a screenshot API and MCP server. A single GET request returns an image or PDF; the example below saves a WebP screenshot:
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. ScreenshotNeo accepts cookie and consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each of those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and responses include X-Page-Verdict and X-Billed headers. Its MCP server offers take_screenshot, get_page_info, and capture_pdf tools for AI agents. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.
Sign up for 1,000 free screenshots a month, with no card required.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →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
Frequently Asked Questions
Does the Puppeteer `disconnected` event mean Chrome has exited?
No. It signals that Puppeteer’s connection ended; the browser process may still be running.
What does `browser.process()` return after `puppeteer.connect()`?
It returns `null`; the connected client does not hold the external launcher’s child-process handle.
Best Value
Does `page.isClosed()` check whether the browser process is closed?
No. It reports whether that individual page is closed.
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.




