Browser setup

Download Chromium, Firefox or WebKit for MotionPR, install their system libraries on Linux, or point MotionPR at a browser you already have.

On this page
  1. Choosing an engine
  2. Networks, mirrors and caches
  3. Using a browser you already have
  4. Docker

MotionPR captures with Playwright's builds of Chromium, Firefox and WebKit, in the versions that match its bundled Playwright (1.65). Download the engines you use, once per machine:

Shell
npx motionpr install                     # the engine in browser.name (Chromium by default)
npx motionpr install firefox webkit      # name the engines
npx motionpr install --all               # Chromium, Firefox and WebKit

On a fresh Linux machine or CI runner, also install the system libraries the engines need. This uses sudo (or root):

Shell
npx motionpr install --with-deps
npx motionpr install --all --with-deps
OptionEffect
--allChromium, Firefox and WebKit
--with-depsAlso install system libraries (Linux; needs root)
--only-shellChromium only: the headless shell; smaller, but --headed will not work
--forceReinstall even if present
--dry-runPrint what would be installed

npx motionpr doctor lists which engines are installed and launches the configured one; npx motionpr doctor --browser all launches all three.

Choosing an engine

Chromium is the default. Use another for one run, for a shell or CI job, or for the project:

Shell
npx motionpr run --browser firefox
MOTIONPR_BROWSER=webkit npx motionpr run
TypeScript
// motionpr.config.ts
browser: { name: "firefox" },

Each engine keeps its own baseline: see Browser support and Cross-browser testing.

Networks, mirrors and caches

The download is Playwright's, so Playwright's environment variables apply:

VariableUse
HTTPS_PROXYDownload through a proxy
PLAYWRIGHT_DOWNLOAD_HOSTDownload from a mirror
PLAYWRIGHT_BROWSERS_PATHInstall into (and launch from) a custom directory, e.g. a CI cache. Set it both times

Using a browser you already have

TypeScript
// motionpr.config.ts
browser: { channel: "chrome" },                  // an installed Google Chrome (or "msedge")
// or
browser: { executablePath: "/path/to/chromium" }, // a binary for the engine in browser.name

A Chromium channel is used whenever Chromium runs; Playwright's Firefox channels (moz-firefox, …) whenever Firefox runs. MOTIONPR_BROWSER_PATH sets browser.executablePath from the environment. A different build can render fonts and timing slightly differently from the baseline's; captures record the browser version and the comparison warns (BROWSER_VERSION_DIFFERS) when they differ. MotionPR's tests cover Playwright's builds.

Docker

The official Playwright images (mcr.microsoft.com/playwright) already contain the system libraries of all three engines, so npx motionpr install without --with-deps is enough inside them. The browsers an image ships with only match MotionPR when the image's Playwright version is the same (1.65); this setup is not covered by MotionPR's own tests.

Engine specifics: Chromium, Firefox, WebKit. Next: Project initialization.