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.

Principle:Puppeteer Puppeteer Platform Detection

From Leeroopedia
Knowledge Sources
Domains Browser_Management, System_Detection
Last Updated 2026-02-11 23:00 GMT

Overview

A technique that auto-detects the operating system and CPU architecture to determine the correct browser binary variant to download.

Description

Platform Detection is the first step in browser installation. Different operating systems and architectures require different browser binaries. The detection maps the Node.js runtime environment to a platform identifier used for download URL construction and executable path resolution.

Supported platforms: Linux (x64), Linux (ARM64), macOS (x64), macOS (ARM64/Apple Silicon), Windows (32-bit), Windows (64-bit).

Usage

Use platform detection at the start of any browser installation workflow. It is typically called automatically by the install function but can be used independently to verify platform support.

Theoretical Basis

# Platform detection mapping
os.platform() + os.arch() → BrowserPlatform
'linux' + 'x64'    → 'linux'
'linux' + 'arm64'  → 'linux_arm'
'darwin' + 'x64'   → 'mac'
'darwin' + 'arm64'  → 'mac_arm'
'win32' + 'ia32'   → 'win32'
'win32' + 'x64'    → 'win64'

Related Pages

Implemented By

Page Connections

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