back to home

lightpanda-io / browser

Lightpanda: the headless browser designed for AI and automation

18,328 stars
685 forks
86 issues
ZigHTMLRust

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing lightpanda-io/browser in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Source files are only loaded when you start an analysis to optimize performance.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind.in/repo/lightpanda-io/browser)
Preview:Analyzed by RepoMind

Repository Overview (README excerpt)

Crawler view

Lightpanda Browser The headless browser built from scratch for AI agents and automation. Not a Chromium fork. Not a WebKit patch. A new browser, written in Zig.   _Puppeteer requesting 100 pages from a local website on a AWS EC2 m5.large instance. See benchmark details._ Lightpanda is the open-source browser made for headless usage: • Javascript execution • Support of Web APIs (partial, WIP) • Compatible with Playwright[^1], Puppeteer, chromedp through CDP Fast web automation for AI agents, LLM training, scraping and testing: • Ultra-low memory footprint (9x less than Chrome) • Exceptionally fast execution (11x faster than Chrome) • Instant startup [^1]: **Playwright support disclaimer:** Due to the nature of Playwright, a script that works with the current version of the browser may not function correctly with a future version. Playwright uses an intermediate JavaScript layer that selects an execution strategy based on the browser's available features. If Lightpanda adds a new Web API, Playwright may choose to execute different code for the same script. This new code path could attempt to use features that are not yet implemented. Lightpanda makes an effort to add compatibility tests, but we can't cover all scenarios. If you encounter an issue, please create a GitHub issue and include the last known working version of the script. Quick start Install **Install from the nightly builds** You can download the last binary from the nightly builds for Linux x86_64 and MacOS aarch64. *For Linux* *For MacOS* *For Windows + WSL2* The Lightpanda browser is compatible to run on windows inside WSL. Follow the Linux instruction for installation from a WSL terminal. It is recommended to install clients like Puppeteer on the Windows host. **Install from Docker** Lightpanda provides official Docker images for both Linux amd64 and arm64 architectures. The following command fetches the Docker image and starts a new container exposing Lightpanda's CDP server on port . Dump a URL Start a CDP server Once the CDP server started, you can run a Puppeteer script by configuring the . Telemetry By default, Lightpanda collects and sends usage telemetry. This can be disabled by setting an environment variable . You can read Lightpanda's privacy policy at: https://lightpanda.io/privacy-policy. Status Lightpanda is in Beta and currently a work in progress. Stability and coverage are improving and many websites now work. You may still encounter errors or crashes. Please open an issue with specifics if so. Here are the key features we have implemented: • [x] HTTP loader (Libcurl) • [x] HTML parser (html5ever) • [x] DOM tree • [x] Javascript support (v8) • [x] DOM APIs • [x] Ajax • [x] XHR API • [x] Fetch API • [x] DOM dump • [x] CDP/websockets server • [x] Click • [x] Input form • [x] Cookies • [x] Custom HTTP headers • [x] Proxy support • [x] Network interception • [x] Respect with option NOTE: There are hundreds of Web APIs. Developing a browser (even just for headless mode) is a huge task. Coverage will increase over time. You can also follow the progress of our Javascript support in our dedicated zig-js-runtime project. Build from sources Prerequisites Lightpanda is written with Zig . You have to install it with the right version in order to build the project. Lightpanda also depends on zig-js-runtime (with v8), Libcurl and html5ever. To be able to build the v8 engine for zig-js-runtime, you have to install some libs: For **Debian/Ubuntu based Linux**: You also need to install Rust. For systems with **Nix**, you can use the devShell: For **MacOS**, you need cmake and Rust. Build and run You an build the entire browser with or for debug env. But you can directly use the zig command: . Embed v8 snapshot Lighpanda uses v8 snapshot. By default, it is created on startup but you can embed it by using the following commands: Generate the snapshot. Build using the snapshot binary. See #1279 for more details. Test Unit Tests You can test Lightpanda by running . End to end tests To run end to end tests, you need to clone the demo repository into dir. You have to install the demo's node requirements You also need to install Go > v1.24. Web Platform Tests Lightpanda is tested against the standardized Web Platform Tests. We use a fork including a custom . For reference, you can easily execute a WPT test case with your browser via wpt.live. Configure WPT HTTP server To run the test, you must clone the repository, configure the custom hosts and generate the file. Clone the repository with the branch. Enter into the dir. Install custom domains in your Generate Use the WPT's setup guide for details. Run WPT test suite An external Go runner is provided by github.com/lightpanda-io/demo/ repository, located into dir. You need to clone the project first. First start the WPT's HTTP server from your clone dir. Run a Lightpanda browser Then you can start the wptrunner from the Demo's clone dir: Or one specific test: command accepts and options modifying output. Also define the concurrency limit. :warning: Running the whole test suite will take a long time. In this case, it's useful to build in mode to make tests faster. Contributing Lightpanda accepts pull requests through GitHub. You have to sign our CLA during the pull request process otherwise we're not able to accept your contributions. Why? Javascript execution is mandatory for the modern web In the good old days, scraping a webpage was as easy as making an HTTP request, cURL-like. It’s not possible anymore, because Javascript is everywhere, like it or not: • Ajax, Single Page App, infinite loading, “click to display”, instant search, etc. • JS web frameworks: React, Vue, Angular & others Chrome is not the right tool If we need Javascript, why not use a real web browser? Take a huge desktop application, hack it, and run it on the server. Hundreds or thousands of instances of Chrome if you use it at sc…