Skip to main content
AgentsUse

Browser Automation

Puppeteer

A JavaScript library that controls Chrome and Firefox through a high-level API for automation, scraping, and testing.

open sourceApache-2.0Checked 2026-10-29Source-verified

Quick decision

Best for
JavaScript teams that want direct Chrome control, screenshots, PDFs, and page automation without a test-runner layer.
Not ideal for
Cross-engine work that needs WebKit, or teams that want a built-in test runner with assertions and tracing. That is Playwright territory.
Pricing model
Open source under Apache-2.0. The library is free to use. You provide the machine, the browser, and any infrastructure around it.
Deployment
Self-hosted library. Local browser.
Authentication
No account needed for the library. Sites you automate handle their own sign-in.
Review state
Source-verified; behaviour tested locally 2026-11-28. Checked 2026-11-28.

What Puppeteer installs, when to pick Playwright, and setting the user agent

Puppeteer is a JavaScript library, maintained by the Chrome team at Google, for driving Chrome or Firefox from Node.js. npm i puppeteer installs version 25.19.0 (released 2026-11-25), which needs Node 22.12.0 or later and downloads Chrome for Testing 158.0.8127.88. To change the user agent, call page.setUserAgent({ userAgent }) before page.goto(). Pass userAgentMetadata and platform in the same call as well: in our test, a user agent string on its own made Chrome stop sending the Sec-CH-UA header and left navigator.platform reading Linux x86_64.

What npm i puppeteer gives you

The puppeteer package downloads a browser during install, and since v20 that browser is Chrome for Testing rather than Chromium. puppeteer-core is the same library without the download, for when you launch a Chrome you already have through executablePath. Firefox support uses the stable Firefox release since v23. The version pairs below come from the supported-browsers page and the npm registry, read 2026-11-28.

Puppeteer starts Chrome headless unless you pass headless: false. The default has been the new headless mode since v22. The old one now ships as a separate binary, chrome-headless-shell, which you select with headless: 'shell'. The docs call it faster for jobs that do not need all of Chrome, but say it does not behave exactly like regular Chrome.

Current Puppeteer release and the browsers it pairs with, checked 2026-11-28
ItemValueSource
Latest version25.19.0, published 2026-11-25npm registry
Node.js needed22.12.0 or laternpm registry (engines field)
Chrome it downloadsChrome for Testing 158.0.8127.88Puppeteer supported-browsers page
Firefox it pairs withFirefox 161.0Puppeteer supported-browsers page
Default headless modeNew headless (headless: true)Puppeteer headless-modes guide
LicenseApache-2.0GitHub repository

Puppeteer or Playwright

The first real difference is browser coverage: only Playwright drives WebKit. After that, the choice comes down to the languages you need and whether you want a test runner in the box. Facts below are from each project’s README, read 2026-11-28.

  • Pick Puppeteer for a Node.js script or service that only needs Chrome: screenshots, PDFs, scraping your own pages, or Chrome DevTools Protocol calls the higher-level API does not wrap.
  • Pick Playwright when the work must also run on WebKit, when the team writes Python, Java or C#, or when you want a test runner with tracing rather than assembling one.
Puppeteer and Playwright side by side, from the two READMEs, checked 2026-11-28
QuestionPuppeteerPlaywright
BrowsersChrome and FirefoxChromium, Firefox and WebKit (the Safari engine)
LanguagesJavaScript and TypeScript on Node.jsJavaScript and TypeScript, plus official Python, .NET and Java versions
Test runnerNone; use Jest, Mocha or node:testPlaywright Test, with auto-waiting and web-first assertions
Agent toolingchrome-devtools-mcp, a Puppeteer-based MCP server the README points toPlaywright MCP (@playwright/mcp) and Playwright CLI for coding agents
Setting a user agentPer page: page.setUserAgent()Per context: browser.newContext({ userAgent })

Set the user agent with page.setUserAgent()

Headless Chrome announces itself. In our test the default user agent was Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/158.0.0.0 Safari/537.36, and browser.userAgent() returns the same string, so a server log can tell a Puppeteer visit from a person’s.

page.setUserAgent() now takes an options object with userAgent, userAgentMetadata and platform. The older form, setUserAgent(userAgent, userAgentMetadata), still works, but the API reference marks it obsolete. Call it on each page before page.goto(), because the setting belongs to that page only.

Change only the HeadlessChrome token. Keeps the real version and operating system and drops the word Headless. Fine for a site that only reads the User-Agent header.

Change only the HeadlessChrome token
import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
const page = await browser.newPage();
const ua = (await browser.userAgent()).replace('HeadlessChrome', 'Chrome');
await page.setUserAgent({ userAgent: ua });
await page.goto('https://example.com/');
console.log(await page.evaluate(() => navigator.userAgent));
await browser.close();

Set the string, the client hints and the platform together. A page can then read the same platform from the header, navigator.platform and userAgentData. Match the brands, version and platform to the string you send.

Set the string, the client hints and the platform together
const ua =
  'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 ' +
  '(KHTML, like Gecko) Chrome/158.0.0.0 Safari/537.36';

await page.setUserAgent({
  userAgent: ua,
  platform: 'Win32',
  userAgentMetadata: {
    brands: [
      { brand: 'Google Chrome', version: '158' },
      { brand: 'Chromium', version: '158' },
      { brand: 'Not_A Brand', version: '24' },
    ],
    platform: 'Windows',
    platformVersion: '15.0.0',
    architecture: 'x86',
    model: '',
    mobile: false,
  },
});

What a site sees with each method (our test)

We ran puppeteer-core 25.19.0 on Linux on 2026-11-28 against Chrome for Testing 158.0.8127.36 (the package downloads .88, a later patch build of the same major version), loading a local page that printed the request headers and the navigator values. The table shows what each method changed.

  • A Windows user agent with a Linux navigator.platform, or with no Sec-CH-UA header at all, is easy for a site to spot. Set all three values or keep the real ones.
  • The --user-agent flag is the quickest way to cover every tab, but it leaves the client hints on the real values.
  • A different user agent does not give you permission to automate a site. Follow its terms and robots.txt, and keep request rates low.
Headers and navigator values after each method, puppeteer-core 25.19.0, tested 2026-11-28
MethodUser-Agent headerSec-CH-UA headernavigator.platformOther pages
No changeHeadlessChrome/158.0.0.0 on X11 Linux"Not.A/Brand";v="24", "Chromium";v="158"Linux x86_64Same default
setUserAgent({ userAgent }) onlyYour stringNot sent; navigator.userAgentData.brands was emptyLinux x86_64A new page went back to HeadlessChrome
setUserAgent with userAgentMetadata and platformYour stringYour brands; Sec-CH-UA-Platform "Windows"Win32A new page went back to HeadlessChrome
--user-agent launch flagYour string, on every pageUnchanged: Chromium brands, platform "Linux"Linux x86_64Applies to every page

The examples use placeholders; keep your own key out of shared files.

Use this profile in a stack

Open the browser workspace, search for Puppeteer, and add it to a saved stack or watchlist. The workspace is free, needs no sign-in, and stores stacks in your browser only.

What it does

Puppeteer is a JavaScript library maintained by the Chrome team at Google. It provides a high-level API to control Chrome or Firefox over the DevTools Protocol or WebDriver BiDi, and it runs headless by default.

Installing the main package downloads a compatible Chrome build. The puppeteer-core package installs only the library, for cases where you point Puppeteer at a browser you manage yourself.

For agent workflows, the project points readers to chrome-devtools-mcp, a Puppeteer-based MCP server for browser automation and debugging. Puppeteer also documents experimental WebMCP support.

Capabilities on record

Browser control

  • Chrome and Firefox control Source-verified

    Control Chrome or Firefox over the DevTools Protocol or WebDriver BiDi.

  • Page navigation and input Source-verified

    Open pages, set viewports, type, and click through locators.

Data access

  • Screenshots and page capture Source-verified

    Capture pages as part of scraping and QA workflows.

Setup

  • Bundled browser download Source-verified

    The main package downloads a compatible Chrome during installation, with a browsers install command when the script is blocked.

  • Library-only install Source-verified

    puppeteer-core installs without downloading Chrome, for bring-your-own-browser setups.

Agent integration

  • MCP path Source-verified

    The README points to chrome-devtools-mcp, a Puppeteer-based MCP server for automation and debugging.

Quick start

Install Puppeteer

From the official README. Modern package managers may block the browser download script, and the README documents the follow-up command.

Install Puppeteer
npm i puppeteer
# if the browser download was blocked:
# npx puppeteer browsers install

Source: https://github.com/puppeteer/puppeteer. The example uses placeholders. Keep real credentials in your environment, not in shared configs, tickets, or repositories.

MCP support: Via a separate project. The Puppeteer README directs readers to chrome-devtools-mcp, a Puppeteer-based MCP server. AgentsUse has not published a separate MCP page for it yet.

Works with

MCP

Puppeteer-based MCP server (chrome-devtools-mcp) linked from the README.

Packages

npm: puppeteer and puppeteer-core.

Browsers

Chrome and Firefox through DevTools Protocol or WebDriver BiDi.

Deployment

Self-hosted library. You run the browsers.

Only support with a source is listed. An absent framework is unverified by AgentsUse, not incompatible.

Health and maintenance

GitHub stars

95,765

Checked 2026-10-29

GitHub forks

9,588

Checked 2026-10-29

Package
npm: puppeteer
License
Open source, Apache-2.0
Maintainer
Google

Stars and forks from the GitHub repository page. No package version is shown because AgentsUse did not re-check the npm version field in this pass. Maintenance signals only, not a quality rating.

Pricing and license

Open source under Apache-2.0. The library is free to use. You provide the machine, the browser, and any infrastructure around it.

Limitations and safety

  • No WebKit engine. If you need Safari-engine coverage, look at Playwright instead.
  • Package managers that block install scripts will skip the Chrome download until you run the browsers install command.
  • No independently checked benchmark is published for this tool yet. The maintenance and setup facts above are source checked, but they do not measure task quality or speed.
Safety

Agent tools can read data, write files, call APIs, and act through connected accounts. Start with a test account or read-only access, keep credentials in environment variables, and review agent actions before connecting anything that can spend money, send messages, or delete data.

Alternatives to Puppeteer

Common questions

What does Puppeteer do for an AI agent?

A JavaScript library that controls Chrome and Firefox through a high-level API for automation, scraping, and testing.

Is Puppeteer open source?

Yes. This profile records the license as Apache-2.0 from the official repository.

Does Puppeteer support MCP?

Via a separate project. The Puppeteer README directs readers to chrome-devtools-mcp, a Puppeteer-based MCP server. AgentsUse has not published a separate MCP page for it yet.

What is Puppeteer used for?

Driving Chrome or Firefox from Node.js code: filling in forms, taking screenshots and PDFs, testing pages and scraping content that only appears after JavaScript runs.

How do I change the user agent in Puppeteer?

Call await page.setUserAgent({ userAgent: '...' }) on the page before page.goto(). To cover every page at once, launch Chrome with the --user-agent= flag in args instead.

Is Puppeteer better than Playwright?

Neither is better across the board. Puppeteer is the smaller choice for Chrome-only Node.js scripts. Playwright adds WebKit, official Python, Java and .NET versions, and its own test runner.

What is the difference between puppeteer and puppeteer-core?

puppeteer downloads a matching Chrome for Testing when you install it. puppeteer-core is only the library, so you pass executablePath to a browser you installed yourself.

Sources and freshness

Checked 2026-11-28. Source-verified means the claims above trace to the listed sources; it does not mean AgentsUse ran the tool. Send corrections through the contact page. Back to the tools catalog.