Implementation:Microsoft Playwright Roll Browser
Overview
Roll Browser is a build utility for updating browser revisions in the Playwright repository, handling version bumps, protocol type regeneration, and CDN URL validation.
Description
This script automates the process of updating a browser (Chromium, Firefox, WebKit, FFmpeg) to a new revision:
1. Parses CLI arguments for browser name and revision number
2. Updates the revision in browsers.json
3. Validates that the browser build exists on the CDN
4. Downloads the new browser build
5. Regenerates protocol type definitions from the new browser
6. Supports short aliases (cr, ff, wk) for browser names
The script handles browser-specific logic:
- Chromium, Firefox, WebKit have protocol type files that need regeneration
- Firefox-beta has a separate revision track
- FFmpeg updates are revision-only without protocol changes
Usage
Run when updating browsers to new revisions during the release process.
Code Reference
Source Location
utils/roll_browser.js (137 lines)
Execution
node utils/roll_browser.js <browser> <revision>
# Example:
node utils/roll_browser.js chromium 123456
node utils/roll_browser.js ff 1234
I/O Contract
Inputs
- Browser name: chromium, firefox, webkit, ffmpeg, firefox-beta (or aliases cr, ff, wk)
- Revision number
Outputs
- Updated
browsers.jsonwith new revision - Downloaded browser binary
- Regenerated protocol type definition files
Side Effects
- Downloads browser from CDN
- Runs protocol type generator
Related Pages
- Microsoft_Playwright_Generate_Font_Families -- Font regeneration after Chromium roll
- Microsoft_Playwright_Workspace -- Workspace build management