Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Puppeteer Puppeteer Browser Data Types

From Leeroopedia
Property Value
sources packages/browsers/src/browser-data/types.ts
domains Type Definitions, Browser Management
last_updated 2026-02-12 00:00 GMT

Overview

Description

The Browser Data Types module defines the core TypeScript enumerations and interfaces used throughout the @puppeteer/browsers package for browser identification, platform targeting, release channel selection, and profile configuration. These types form the foundational contract for all browser management operations including downloading, installing, launching, and configuring browsers.

The module exports five enums and one interface:

  • Browser -- identifies supported browser products (Chrome, Chrome Headless Shell, Chromium, Firefox, ChromeDriver)
  • BrowserPlatform -- identifies OS/architecture combinations for download targeting
  • BrowserTag -- describes release channels and version aliases used with resolveBuildId
  • ChromeReleaseChannel -- Chrome-specific release channels (Stable, Dev, Canary, Beta)
  • ProfileOptions -- interface for browser profile creation configuration

Usage

These types are imported by virtually every other module in the @puppeteer/browsers package and are re-exported from the package's public API. They serve as parameters for download URL resolution, executable path computation, build ID resolution, and system executable detection.

Code Reference

Source Location

packages/browsers/src/browser-data/types.ts

Signature

export enum Browser {
  CHROME = 'chrome',
  CHROMEHEADLESSSHELL = 'chrome-headless-shell',
  CHROMIUM = 'chromium',
  FIREFOX = 'firefox',
  CHROMEDRIVER = 'chromedriver',
}

export enum BrowserPlatform {
  LINUX = 'linux',
  LINUX_ARM = 'linux_arm',
  MAC = 'mac',
  MAC_ARM = 'mac_arm',
  WIN32 = 'win32',
  WIN64 = 'win64',
}

export enum BrowserTag {
  CANARY = 'canary',
  NIGHTLY = 'nightly',
  BETA = 'beta',
  DEV = 'dev',
  DEVEDITION = 'devedition',
  STABLE = 'stable',
  ESR = 'esr',
  LATEST = 'latest',
}

export interface ProfileOptions {
  preferences: Record<string, unknown>;
  path: string;
}

export enum ChromeReleaseChannel {
  STABLE = 'stable',
  DEV = 'dev',
  CANARY = 'canary',
  BETA = 'beta',
}

Import

import {
  Browser,
  BrowserPlatform,
  BrowserTag,
  ChromeReleaseChannel,
  type ProfileOptions,
} from './browser-data/types.js';

I/O Contract

Exported Enums

Enum Values Description
Browser chrome, chrome-headless-shell, chromium, firefox, chromedriver Supported browser product identifiers
BrowserPlatform linux, linux_arm, mac, mac_arm, win32, win64 OS platform and architecture combinations
BrowserTag canary, nightly, beta, dev, devedition, stable, esr, latest Release channel/version alias tags
ChromeReleaseChannel stable, dev, canary, beta Chrome-specific release channel identifiers

Exported Interfaces

Interface Property Type Description
ProfileOptions preferences Record<string, unknown> Key-value pairs of browser preferences
ProfileOptions path string Filesystem path for the profile directory

Usage Examples

import {
  Browser,
  BrowserPlatform,
  BrowserTag,
  ChromeReleaseChannel,
} from '@puppeteer/browsers';

// Use Browser enum to specify which browser to download
const browser = Browser.CHROME;

// Use BrowserPlatform to target a specific OS
const platform = BrowserPlatform.LINUX;

// Use BrowserTag to specify a release channel
const tag = BrowserTag.STABLE;

// Use ChromeReleaseChannel for Chrome-specific operations
const channel = ChromeReleaseChannel.CANARY;

// Profile options for Firefox profile creation
const profileOptions: ProfileOptions = {
  path: '/tmp/test-profile',
  preferences: {
    'browser.startup.homepage': 'about:blank',
  },
};

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment