mix playwriter.setup (Playwriter v0.3.0)

Copy Markdown View Source

Installs the Node Playwright driver for the :local (headless) transport.

Usage

mix playwriter.setup

This will, in the project root (using the committed package.json, which pins the Playwright version playwright_ex targets):

  1. Install the Playwright npm package into node_modules/
  2. Download the matching Chromium browser

The :local transport then resolves the driver from node_modules/playwright/cli.js (override with PLAYWRIGHT_CLI or config :playwriter, :playwright_cli).

Options

mix playwriter.setup --browser firefox    # Install Firefox instead
mix playwriter.setup --browser all        # Install all browsers
mix playwriter.setup --with-deps          # Also install OS libs (needs sudo)

After Setup

You can then use Playwriter in local mode:

Playwriter.fetch_html("https://example.com")

For WSL-to-Windows (mode: :windows), no local setup is needed - that transport provisions its own Node Playwright on the Windows side.