Implementation:Puppeteer Puppeteer LaunchOptions
| Property | Value |
|---|---|
| sources | packages/puppeteer-core/src/node/LaunchOptions.ts |
| domains | Node, Configuration, Launch |
| last_updated | 2026-02-12 00:00 GMT |
Overview
Description
The LaunchOptions module defines the TypeScript interfaces and types that configure browser launching in Puppeteer. It contains the LaunchOptions interface (the primary configuration object passed to puppeteer.launch()), the ChromeReleaseChannel type re-export, and a helper function convertPuppeteerChannelToBrowsersChannel that maps Puppeteer's channel names to the @puppeteer/browsers library's channel enum values.
The LaunchOptions interface extends ConnectOptions and provides properties for:
- Browser selection --
browser(chrome or firefox),channel(chrome, chrome-dev, chrome-beta, chrome-canary), andexecutablePath. - Process control --
handleSIGINT,handleSIGTERM,handleSIGHUP,signal(AbortSignal), anddumpio. - Startup behavior --
timeout,waitForInitialPage,headless(true, false, or 'shell'), anddevtools. - Browser configuration --
args,env,userDataDir,pipe,debuggingPort,ignoreDefaultArgs,enableExtensions, andextraPrefsFirefox.
Usage
LaunchOptions is the type for the options parameter of puppeteer.launch(). All properties are optional with sensible defaults applied by BrowserLauncher.
Code Reference
Source Location
packages/puppeteer-core/src/node/LaunchOptions.ts
Signature
export type ChromeReleaseChannel = 'chrome' | 'chrome-dev' | 'chrome-beta' | 'chrome-canary';
export function convertPuppeteerChannelToBrowsersChannel(
channel: ChromeReleaseChannel,
): BrowsersChromeReleaseChannel;
export interface LaunchOptions extends ConnectOptions {
channel?: ChromeReleaseChannel;
executablePath?: string;
ignoreDefaultArgs?: boolean | string[];
enableExtensions?: boolean | string[];
handleSIGINT?: boolean;
handleSIGTERM?: boolean;
handleSIGHUP?: boolean;
timeout?: number;
dumpio?: boolean;
env?: Record<string, string | undefined>;
pipe?: boolean;
browser?: SupportedBrowser;
extraPrefsFirefox?: Record<string, unknown>;
waitForInitialPage?: boolean;
headless?: boolean | 'shell';
userDataDir?: string;
devtools?: boolean;
debuggingPort?: number;
args?: string[];
signal?: AbortSignal;
}
Import
import type {LaunchOptions, ChromeReleaseChannel} from '../node/LaunchOptions.js';
I/O Contract
| Property | Type | Default | Description |
|---|---|---|---|
| channel | ChromeReleaseChannel |
-- | Chrome release channel to use |
| executablePath | string |
-- | Custom browser executable path |
| ignoreDefaultArgs | string[] | false |
Skip or filter default browser arguments |
| enableExtensions | string[] | -- | Enable extensions or load specific extension paths |
| handleSIGINT | boolean |
true |
Close browser on Ctrl+C |
| handleSIGTERM | boolean |
true |
Close browser on SIGTERM |
| handleSIGHUP | boolean |
true |
Close browser on SIGHUP |
| timeout | number |
30000 |
Browser startup timeout in ms |
| dumpio | boolean |
false |
Pipe browser stdout/stderr to process |
| env | undefined> | process.env |
Environment variables for the browser |
| pipe | boolean |
false |
Use pipe connection instead of WebSocket |
| browser | SupportedBrowser |
'chrome' |
Which browser to launch |
| headless | 'shell' | true |
Headless mode configuration |
| userDataDir | string |
-- | Custom user data directory |
| devtools | boolean |
false |
Auto-open DevTools (forces headless: false) |
| args | string[] |
-- | Additional command line arguments |
| signal | AbortSignal |
-- | Signal to abort and close the browser |
| Function | Input | Output | Description |
|---|---|---|---|
| convertPuppeteerChannelToBrowsersChannel | ChromeReleaseChannel |
BrowsersChromeReleaseChannel |
Maps Puppeteer channel names to @puppeteer/browsers enum values |
Usage Examples
import puppeteer from 'puppeteer';
// Launch with various options
const browser = await puppeteer.launch({
headless: true,
browser: 'chrome',
channel: 'chrome-canary',
timeout: 60000,
args: ['--no-sandbox', '--disable-setuid-sandbox'],
handleSIGINT: true,
dumpio: false,
});
// Launch with a custom executable and user data directory
const browser = await puppeteer.launch({
executablePath: '/usr/bin/google-chrome',
userDataDir: '/tmp/my-chrome-profile',
headless: 'shell',
});