What Is Puppeteer? Chrome and Firefox Automation Explained
Scrapeless Scraping Browser provides managed cloud browser sessions that Puppeteer clients can use for browser automation and dynamic web-data workflows.
TL;DR
- Puppeteer is a JavaScript browser-automation library. Its high-level API controls Chrome and Firefox for navigation, input, screenshots, PDFs, network observation, and page evaluation.
- Puppeteer uses more than one browser protocol. Chrome normally uses the Chrome DevTools Protocol, while Firefox automation uses WebDriver BiDi by default in current Puppeteer documentation.
- The package can manage or connect to a browser. A workflow can launch a compatible local browser, install a browser separately, or connect to a supported remote endpoint.
- Puppeteer is focused rather than all-in-one. It supplies browser control but leaves test discovery, assertions, fixtures, and reporting to other libraries or application code.
- A browser does not guarantee usable data. Scripts still need state-aware waits, stable selectors, output validation, bounded traffic, and explicit permission to access the target.
Puppeteer Gives JavaScript Direct Control of a Browser
Puppeteer is an open-source JavaScript library for controlling supported browsers through a high-level API. It exposes browser, context, page, frame, input, network, tracing, screenshot, PDF, and evaluation operations. A script can launch a browser that Puppeteer manages or connect to an existing compatible browser process. Because the API is JavaScript-first and maps closely to browser concepts, it fits Node.js services, command-line tools, crawlers, visual capture systems, and custom test harnesses.
official Puppeteer introduction presents Puppeteer as a JavaScript library for Chrome and Firefox automation. Older descriptions often reduce Puppeteer to headless Chromium, but that is now incomplete. Headless Chrome remains a central use case, yet current browser support and protocol work include Firefox. Teams should use the current compatibility table rather than repeating an historical definition when choosing browsers or designing a migration.
Browser, Context, Page, and Protocol Work Together
The Browser object owns the process or remote connection. BrowserContext separates cookies and storage for independent sessions. Page represents a tab and provides navigation, DOM queries, locators, events, screenshots, and script execution. Underneath the high-level API, a protocol transports commands and events. Chrome automation commonly uses CDP, while WebDriver BiDi provides a cross-browser event-driven path that Puppeteer uses for Firefox and can use with Chrome for supported features.
official Puppeteer WebDriver BiDi guide explains Puppeteer’s WebDriver BiDi support and notes that unsupported operations can produce an UnsupportedOperation error. That boundary matters in protocol selection: CDP exposes a deep Chrome-specific surface, while BiDi aims for standardized cross-browser control but is still developing. Test the exact features—network interception, downloads, emulation, tracing, extensions, or browser management—on the protocol and browser required by the project.
- Browser. Launches or connects to a browser process and manages the overall lifecycle.
- BrowserContext. Creates an isolated cookie, cache, and storage boundary inside the browser.
- Page. Represents a tab and exposes navigation, input, evaluation, network, and capture operations.
- CDP session. Provides lower-level access to Chrome DevTools Protocol domains when the high-level API is not enough.
- WebDriver BiDi connection. Provides an event-driven standards path for supported cross-browser operations.
Puppeteer Can Launch, Install, or Connect
The full Puppeteer package normally manages a compatible browser download, which makes a local project easy to start but increases installation size. Puppeteer Core omits that managed browser and is useful when the browser executable or remote service is supplied separately. Remote connection keeps the Node.js control process local while browser execution happens on another host. Each approach changes who owns browser versions, executable paths, sandbox settings, operating-system dependencies, and cleanup.
official Puppeteer supported-browser table publishes the mapping between Puppeteer releases and supported Chrome and Firefox versions. That mapping is operational, not trivia. Pinning the package while silently changing the browser can create unsupported combinations, and upgrading the package can change the downloaded browser. Containers and CI images should record both sides. A remote service should expose enough environment information to reproduce a behavior observed in production.
Puppeteer Choices Affect Ownership and Portability
The same page API can sit above different installation and protocol models, but those models do not have identical maintenance or feature boundaries.
| Choice | Operational effect |
|---|---|
| Puppeteer package | Includes browser-management behavior and is convenient when the project wants Puppeteer to own a compatible local browser. |
| Puppeteer Core | Leaves browser installation and lifecycle to the project or remote provider, reducing assumptions in library packaging. |
| Local launch | The application owns operating-system dependencies, browser processes, sandbox configuration, resources, and cleanup. |
| Remote connect | A service owns browser hosting while the application retains Puppeteer logic and must verify remote feature support. |
| CDP | Provides deep Chrome-specific inspection and control and is the default path for Chrome in Puppeteer. |
| WebDriver BiDi | Provides cross-browser commands and events for supported features and is the default path for Firefox in Puppeteer. |
Puppeteer Use Cases That Benefit From a Focused API
Puppeteer fits projects that want browser primitives inside a JavaScript application without adopting a prescribed test architecture.
Dynamic page extraction
Puppeteer can render client applications, perform permitted interactions, and extract structured public information from the DOM or observed responses.
Screenshot and PDF services
A Node.js service can load controlled pages, apply viewport and media settings, and produce visual or printable artifacts.
Custom test harnesses
Teams with an existing JavaScript runner can add browser control while keeping their own fixtures, assertions, reporting, and scheduling.
Browser diagnostics
CDP access, tracing, console events, performance data, and network inspection can support debugging and synthetic monitoring.
Puppeteer Leaves Test Architecture and Capacity to the Project
Puppeteer does not prescribe one runner, assertion library, fixture model, or report format. That is useful for embedding automation in an application, but a test team must assemble and maintain those layers. Browser processes also consume material resources, and one Node.js process can create too many pages long before the code looks complex. Define browser and context pooling carefully, close resources deterministically, and isolate accounts or markets that should not share storage.
Chrome DevTools Protocol documentation documents the Chrome DevTools Protocol as the interface used to instrument, inspect, debug, and profile Chrome. CDP’s depth is valuable, but Chrome-specific commands reduce portability. Keep low-level protocol calls behind a small adapter, document why they are needed, and provide a clear behavior when the same workflow runs through WebDriver BiDi or another browser.
A Puppeteer Project Readiness Checklist
The important decisions are browser ownership, protocol, context scope, evidence, and the framework layers that Puppeteer intentionally leaves open.
- Select browsers from requirements. Confirm whether Chrome alone is sufficient or Firefox behavior matters. Use the current supported-browser table and run the exact combinations before committing to a matrix.
- Choose package ownership. Use the full package when Puppeteer should manage a compatible browser, or Puppeteer Core when containers, system packages, or a remote service own the browser.
- Identify protocol dependencies. List every direct CDP call and every feature expected over WebDriver BiDi. Keep browser-specific behavior visible instead of hiding it inside generic helpers.
- Scope contexts intentionally. Use separate contexts for independent cookies and storage. A shared context is appropriate only when the workflow is meant to continue one identity or state.
- Wait for meaningful conditions. Tie progress to selectors, responses, URL changes, function results, or other observable state. Fixed delays should not carry the main synchronization burden.
- Assemble the test stack. If the project is a test suite, name the runner, assertion library, fixtures, reports, and artifact policy that surround Puppeteer.
- Measure browser capacity. Track process memory, active pages, startup cost, session duration, network volume, and target-host concurrency before increasing workers.
- Validate output content. Check final URLs, expected fields, page language, record counts, and page type. A successful navigation can still land on a consent screen or incomplete application shell.
Using Puppeteer With Scrapeless Scraping Browser
Scrapeless Scraping Browser can host a browser session that a Puppeteer client connects to through a supported remote endpoint. The application keeps familiar Puppeteer page operations while Scrapeless owns the cloud browser process, session settings, and configured network path.
Verify the current endpoint, supported client package, session controls, and remote feature surface before moving a production workflow. Review the current Scrapeless Scraping Browser product overview, Scrapeless Scraping Browser getting-started documentation, and Scrapeless pricing before choosing an operating model.
Conclusion: Puppeteer Is a Focused Browser-Control Library
Puppeteer gives JavaScript applications a direct, high-level way to control Chrome and Firefox. It can launch compatible browsers, connect to remote sessions, work through CDP, and use WebDriver BiDi for supported cross-browser operations. The focused API makes it easy to embed browser behavior into custom systems.
That focus also leaves important decisions to the project. Control browser versions, make protocol assumptions explicit, isolate context state, choose condition-based waits, validate the returned page, and assemble a test stack when testing is the job.
Ready to Run Puppeteer in the Cloud?
Create a Scrapeless account and test one bounded Puppeteer workflow against a managed browser session before moving a larger automation service.
Start Free →FAQ
Does Puppeteer support Firefox?
Yes. Current Puppeteer documentation lists Chrome and Firefox support. Firefox uses WebDriver BiDi by default, while Chrome normally uses CDP. Feature coverage can differ by browser and protocol, so test every required operation rather than assuming identical behavior.
Is Puppeteer only for headless Chrome?
No. Puppeteer can run supported browsers in headless or headed modes and now covers Chrome and Firefox. The historical “headless Chrome library” description misses current browser and WebDriver BiDi support.
What is the difference between Puppeteer and Puppeteer Core?
The full Puppeteer package includes browser-management behavior and normally works with a compatible managed browser. Puppeteer Core is the library without that browser ownership and fits projects that provide an executable, container image, or remote browser service separately.
Can Puppeteer be used for web scraping?
Yes. Puppeteer can render JavaScript pages, interact with permitted public controls, inspect the DOM, and observe responses. Use it only when browser execution changes the available data; direct HTTP collection is simpler when the initial response is sufficient.
Does Puppeteer include a test runner?
No single runner is required or bundled as the complete testing architecture. Teams commonly pair Puppeteer with a JavaScript test runner, assertion library, fixtures, and reporting tools, or embed it in a custom application that owns scheduling and result handling.