{"name":"@puppeteer/browsers","version":"2.10.3","keywords":["puppeteer","browsers"],"author":{"name":"The Chromium Authors"},"license":"Apache-2.0","_id":"@puppeteer/browsers@2.10.3","maintainers":[{"name":"mathias","email":"mathias@qiwi.be"},{"name":"google-wombot","email":"node-team-npm+wombot@google.com"}],"homepage":"https://github.com/puppeteer/puppeteer/tree/main#readme","bugs":{"url":"https://github.com/puppeteer/puppeteer/issues"},"bin":{"browsers":"lib/cjs/main-cli.js"},"dist":{"shasum":"4d89b3520359da6f7016ff96316c2c243be2b3ee","tarball":"http://registry-npm.ywwl.com/@puppeteer/browsers/download/@puppeteer/browsers-2.10.3.tgz","fileCount":168,"integrity":"sha512-iPpnFpX25gKIVsHsqVjHV+/GzW36xPgsscWkCnrrETndcdxNsXLdCrTwhkCJNR/FGWr122dJUBeyV4niz/j3TA==","signatures":[{"sig":"MEUCIFhhRGlpILVc4htpaUFrIvV1oZOdEj5pR6Y1UF4hoQwpAiEA5Um0qYAPUpUEwRF+/c1Xwo54ufgW0aU/3/R2BKh+VvQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":540600,"size":80026,"noattachment":false,"key":"/@puppeteer/browsers/-/@puppeteer/browsers-2.10.3.tgz"},"main":"./lib/cjs/main.js","type":"commonjs","types":"./lib/cjs/main.d.ts","wireit":{"test":{"files":[".mocharc.cjs"],"command":"node tools/downloadTestBrowsers.mjs && mocha","dependencies":["build:test"]},"build":{"clean":"if-file-deleted","files":["src/**/*.ts","tsconfig.json"],"output":["lib/**","!lib/esm/package.json"],"command":"tsc -b && node --experimental-strip-types ../../tools/chmod.ts 755 lib/cjs/main-cli.js lib/esm/main-cli.js","dependencies":["generate:package-json","generate:version"]},"build:docs":{"files":["api-extractor.docs.json","lib/esm/main.d.ts","tsconfig.json"],"command":"api-extractor run --local --config \"./api-extractor.docs.json\"","dependencies":["build"]},"build:test":{"files":["test/**/*.ts","test/src/tsconfig.json"],"output":["test/build/**"],"command":"tsc -b test/src/tsconfig.json","dependencies":["build","../testserver:build"]},"generate:version":{"clean":"if-file-deleted","files":["Herebyfile.mjs"],"output":["src/generated/version.ts"],"command":"hereby generate:version"},"generate:package-json":{"files":["../../tools/generate_module_package_json.ts"],"output":["lib/esm/package.json"],"command":"node --experimental-strip-types ../../tools/generate_module_package_json.ts lib/esm/package.json"}},"engines":{"node":">=18"},"exports":{"import":"./lib/esm/main.js","require":"./lib/cjs/main.js"},"gitHead":"5fcbb11a53b883c3688bdb0dc1fe42ccf9263338","scripts":{"test":"wireit","build":"wireit","clean":"../../tools/clean.mjs","build:docs":"wireit","build:test":"wireit"},"_npmUser":{"name":"google-wombot","email":"node-team-npm+wombot@google.com"},"repository":{"url":"git+https://github.com/puppeteer/puppeteer.git#main","type":"git"},"_npmVersion":"10.9.2","description":"Download and launch browsers","directories":{},"_nodeVersion":"22.15.0","dependencies":{"debug":"^4.4.0","yargs":"^17.7.2","semver":"^7.7.1","tar-fs":"^3.0.8","progress":"^2.0.3","extract-zip":"^2.0.1","proxy-agent":"^6.5.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/ws":"8.18.1","@types/debug":"4.1.12","@types/yargs":"17.0.33","@types/tar-fs":"2.0.4","@types/progress":"2.0.7"},"_npmOperationalInternal":{"tmp":"tmp/browsers_2.10.3_1746174905267_0.32202525814083494","host":"s3://npm-registry-packages-npm-production"},"readme":"# @puppeteer/browsers\n\nManage and launch browsers/drivers from a CLI or programmatically.\n\n## System requirements\n\n- A compatible Node version (see `engines` in `package.json`).\n- For Firefox downloads:\n  - Linux builds: `xz` and `bzip2` utilities are required to unpack `.tar.gz` and `.tar.bz2` archives.\n  - MacOS builds: `hdiutil` is required to unpack `.dmg` archives.\n- For Chrome downloads:\n  - On Linux/MacOS: `unzip`.\n  - On Windows: `tar.exe`.\n\n## CLI\n\nUse `npx` to run the CLI:\n\n```bash\n# This will install and run the @puppeteer/browsers package.\n# If it is already installed in the current directory, the installed\n# version will be used.\nnpx @puppeteer/browsers --help\n```\n\nBuilt-in per-command `help` will provide all documentation you need to use the CLI.\n\n```bash\nnpx @puppeteer/browsers --help # help for all commands\nnpx @puppeteer/browsers install --help # help for the install command\nnpx @puppeteer/browsers launch --help # help for the launch command\nnpx @puppeteer/browsers clear --help # help for the clear command\nnpx @puppeteer/browsers list --help # help for the list command\n```\n\nYou can specify the version of the `@puppeteer/browsers` when using\n`npx`:\n\n```bash\n# Always install and use the latest version from the registry.\nnpx @puppeteer/browsers@latest --help\n# Always use a specific version.\nnpx @puppeteer/browsers@2.4.1 --help\n# Always install the latest version and automatically confirm the installation.\nnpx --yes @puppeteer/browsers@latest --help\n```\n\nTo clear all installed browsers, use the `clear` command:\n\n```bash\nnpx @puppeteer/browsers clear\n```\n\nTo list all installed browsers, use the `list` command:\n\n```bash\nnpx @puppeteer/browsers list\n```\n\nSome example to give an idea of what the CLI looks like (use the `--help` command for more examples):\n\n```sh\n# Download the latest available Chrome for Testing binary corresponding to the Stable channel.\nnpx @puppeteer/browsers install chrome@stable\n\n# Download a specific Chrome for Testing version.\nnpx @puppeteer/browsers install chrome@116.0.5793.0\n\n# Download the latest Chrome for Testing version for the given milestone.\nnpx @puppeteer/browsers install chrome@117\n\n# Download the latest available ChromeDriver version corresponding to the Canary channel.\nnpx @puppeteer/browsers install chromedriver@canary\n\n# Download a specific ChromeDriver version.\nnpx @puppeteer/browsers install chromedriver@116.0.5793.0\n\n# On Ubuntu/Debian and only for Chrome, install the browser and required system dependencies.\n# If the browser version has already been installed, the command\n# will still attempt to install system dependencies.\n# Requires root privileges.\nnpx puppeteer browsers install chrome --install-deps\n```\n\n## Known limitations\n\n1. Launching the system browsers is only possible for Chrome/Chromium.\n\n## Proxies\n\nThe library and CLI respect `HTTP_PROXY`, `HTTPS_PROXY` and `NO_PROXY` environment variables. For them to work, you must have the `proxy-agent` package installed:\n\n```bash\nnpm install proxy-agent\n```\n\n## Debugging\n\nTo enable verbose logging for `@puppeteer/browsers` operations (like download progress, installation steps, and launching parameters), use Node.js's built-in `NODE_DEBUG` environment variable.\n\n```bash\nenv NODE_DEBUG=\"puppeteer:browsers:*\" npx @puppeteer/browsers install chrome@stable\n```\n\nThe following debug channels are available:\n\n- `puppeteer:browsers:cache`: Caching operations.\n- `puppeteer:browsers:fileUtil`: Decompressing and other file utility operations.\n- `puppeteer:browsers:install`: Download and install progress.\n- `puppeteer:browsers:launcher`: Browser launching parameters and process state.\n\n## Custom Providers\n\nYou can implement custom browser providers to download from alternative sources like corporate mirrors, private repositories, or specialized browser builds.\n\n```typescript\nimport {\n  BrowserProvider,\n  DownloadOptions,\n  Browser,\n  BrowserPlatform,\n} from '@puppeteer/browsers';\n\nclass SimpleMirrorProvider implements BrowserProvider {\n  constructor(private mirrorUrl: string) {}\n\n  supports(options: DownloadOptions): boolean {\n    return options.browser === Browser.CHROME;\n  }\n\n  getDownloadUrl(options: DownloadOptions): URL | null {\n    const {buildId, platform} = options;\n    const filenameMap = {\n      [BrowserPlatform.LINUX]: 'chrome-linux64.zip',\n      [BrowserPlatform.MAC]: 'chrome-mac-x64.zip',\n      [BrowserPlatform.MAC_ARM]: 'chrome-mac-arm64.zip',\n      [BrowserPlatform.WIN32]: 'chrome-win32.zip',\n      [BrowserPlatform.WIN64]: 'chrome-win64.zip',\n    };\n    const filename = filenameMap[platform];\n    if (!filename) return null;\n    return new URL(`${this.mirrorUrl}/chrome/${buildId}/${filename}`);\n  }\n\n  getExecutablePath(options: DownloadOptions): string {\n    const {platform} = options;\n    if (\n      platform === BrowserPlatform.MAC ||\n      platform === BrowserPlatform.MAC_ARM\n    ) {\n      return 'chrome-mac/Chromium.app/Contents/MacOS/Chromium';\n    } else if (platform === BrowserPlatform.LINUX) {\n      return 'chrome-linux64/chrome';\n    } else if (platform.includes('win')) {\n      return 'chrome-win64/chrome.exe';\n    }\n    throw new Error(`Unsupported platform: ${platform}`);\n  }\n}\n```\n\nUse with the `install` API:\n\n```typescript\nimport {install} from '@puppeteer/browsers';\n\nconst customProvider = new SimpleMirrorProvider('https://internal.company.com');\n\nawait install({\n  browser: Browser.CHROME,\n  buildId: '120.0.6099.109',\n  platform: BrowserPlatform.LINUX,\n  cacheDir: '/tmp/puppeteer-cache',\n  providers: [customProvider],\n});\n```\n\nMultiple providers can be chained - they're tried in order until one succeeds, with a default provider such as Chrome for Testing, as an automatic fallback.\n\n:::caution\nCustom providers are NOT officially supported by Puppeteer. You accept full responsibility for binary compatibility, testing, and maintenance.\n:::\n\n## API\n\nThe programmatic API allows installing and launching browsers from your code. See the `test` folder for examples on how to use the `install`, `canInstall`, `launch`, `computeExecutablePath`, `computeSystemExecutablePath`, and other methods.\n","publish_time":1746174905452,"_cnpm_publish_time":1746174905452,"dist-tags":{"latest":"3.2.6"}}