October 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 NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

Puppeteer Browser.process(): What It Returns and How to Close or Disconnect

Puppeteer’s browser.process() returns a ChildProcess for a launched browser and null for a connected one. Learn how that differs from closing or disconnecting.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

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

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.

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:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
HTML and CSS: Design and Build Websites
  • 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.

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.

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

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, and handleSIGTERM are shown as true by default in that reference. They control Puppeteer’s handling of those signals.
  • signal accepts an AbortSignal; aborting it kills the browser process.
  • dumpio forwards browser process stdout and stderr to the parent process.
  • executablePath selects the browser executable path.
  • onExit runs once after the process exits or before Process.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
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • 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.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

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.

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

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.

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.

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

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.

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
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

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.