Lightpanda Browser Assessment¶
What Is It?¶
Lightpanda is an open-source headless browser written in Zig, purpose-built for machine-driven tasks (scraping, AI agents, automation). It skips all rendering (no CSS layout, painting, GPU, or image loading) for extreme speed and minimal memory usage.
Performance¶
| Metric | Lightpanda | Headless Chrome |
|---|---|---|
| 100 pages | ~2.3s | ~25.2s |
| Peak memory | ~24 MB | ~207 MB |
| Startup | Near-instant | Seconds |
11x faster, 9x less memory on simple pages.
How It Works¶
- Exposes Chrome DevTools Protocol (CDP) on a WebSocket
- Connect via Puppeteer or Playwright:
ws://127.0.0.1:9222 - CLI modes:
serve(CDP server) orfetch(one-shot HTML/Markdown dump)
Assessment for rr-bizops¶
Current E2E Setup¶
Our tests use agent-browser (Vercel Labs) with bash test scripts that:
- Control a real Chrome browser
- Use accessibility tree snapshots for assertions (browser snapshot -i -c)
- Cover admin login, compliance module, procurement module (14 test files, 30+ assertions)
Why Lightpanda Does NOT Fit (Today)¶
- Incompatible with agent-browser — agent-browser has its own Chrome protocol, not generic CDP
- No accessibility tree — our tests rely on screen reader view assertions; Lightpanda has no a11y APIs
- Partial Web API coverage — MedusaJS admin is a complex React SPA that would hit missing APIs
- Beta quality — crashes expected on complex sites, pre-1.0 (v0.2.6)
- No screenshots — can't do visual regression testing
- AGPL-3.0 license — copyleft concerns if we modify and distribute
Where It Could Help (Future)¶
- Smoke tests: Lightweight health checks that verify pages load and contain expected content
- Link validation: Crawl storefront for broken links at CI speed
- SEO checks: Fast HTML/meta tag extraction without full browser overhead
- API response validation: Fetch pages and check structured data
Recommendation¶
Do not migrate. Our agent-browser + bash framework provides richer testing through accessibility tree assertions on a real Chrome engine. Lightpanda is not a viable replacement today.
Revisit when: - Lightpanda reaches v1.0 with broader Web API coverage - We need high-throughput scraping or crawling tasks - We want to add lightweight smoke tests alongside (not replacing) our E2E suite
If We Did Want to Use It Someday¶
# Install
curl -fsSL https://pkg.lightpanda.io/install.sh | bash
# Or npm
npm install @lightpanda/browser
# Start CDP server
lightpanda serve --host 127.0.0.1 --port 9222
# Connect with Puppeteer
import puppeteer from 'puppeteer-core';
const browser = await puppeteer.connect({ browserWSEndpoint: 'ws://127.0.0.1:9222' });