Skip to content

feat: Lightpanda browser support#21

Merged
4ier merged 1 commit intomainfrom
feat/lightpanda-support
Mar 18, 2026
Merged

feat: Lightpanda browser support#21
4ier merged 1 commit intomainfrom
feat/lightpanda-support

Conversation

@4ier
Copy link
Copy Markdown
Owner

@4ier 4ier commented Mar 18, 2026

What

Add Lightpanda as an alternative headless browser backend for Neo, alongside Chrome.

Lightpanda is an open-source headless browser written in Zig, purpose-built for AI agents and automation. It's 11x faster and uses 9x less memory than Chrome for headless tasks.

Changes

  • neo setup auto-detects Lightpanda binary; defaults to Chrome when both available
  • New browserType config field ('chrome' | 'lightpanda')
  • neo start launches Lightpanda with serve --host --port when configured
  • neo connect handles Lightpanda's single-WS CDP (no /json/list, uses Target.createTarget)
  • Persistent WebSocket connection pool for Lightpanda (context tied to WS lifetime)
  • neo open, neo read, neo snapshot, neo click all work with Lightpanda
  • Always include params: {} in CDP messages (Lightpanda rejects missing params key)
  • Page-load polling in context bootstrap for reliable a11y tree reads

Config

// ~/.neo/config.json
{
  "chromePath": "/usr/local/bin/lightpanda",
  "browserType": "lightpanda",  // or 'chrome' (default)
  "cdpPort": 9222
}

Tested

All core commands verified with Lightpanda nightly (bd2406f8):

Command Status
neo connect
neo open
neo read
neo snapshot ✅ (12 a11y nodes for example.com)
neo click

Chrome remains the default and is unaffected by these changes.

- Detect Lightpanda binary in neo setup, default to Chrome when both available
- Add browserType config field ('chrome' | 'lightpanda')
- Support Lightpanda's single-WS multiplexed CDP in neo connect/open/read/snapshot
- Persistent WebSocket pool for backends that tie context to connection lifetime
- Graceful fallback: /json/list → Target.createTarget for target discovery
- Always send params:{} in CDP messages (Lightpanda rejects missing params key)
- Wait for page load in ensureLightpandaPageContext before a11y/DOM queries

Tested: connect, open, read, snapshot, click all working with Lightpanda nightly (bd2406f8).
Lightpanda is 11x faster and uses 9x less memory than Chrome for headless automation.
@4ier 4ier merged commit 5e8a460 into main Mar 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant