You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lightpanda is the open-source browser made for headless usage:
12
+
13
+
- Javascript execution
14
+
- Support of the Web APIs (partial, WIP)
15
+
- Compatible with Playwright, Puppeteer through CDP (WIP)
16
+
17
+
Fast scraping and web automation with minimal memory footprint:
18
+
19
+
- Ultra-low memory footprint (12x less than Chrome)
20
+
- Blazingly fast & instant startup (64x faster than Chrome)
21
+
22
+
See [benchmark details](https://github.com/lightpanda-io/demo).
23
+
24
+
## Why?
25
+
26
+
### Javascript execution is mandatory for the modern web
27
+
28
+
Back in the good old times, grabbing 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:
29
+
30
+
- Ajax, Single Page App, Infinite loading, “click to display”, instant search, etc.
31
+
- JS web frameworks: React, Vue, Angular & others
32
+
33
+
### Chrome is not the right tool
34
+
35
+
So if we need Javascript, why not use a real web browser. Let’s take a huge desktop application, hack it, and run it on the server, right? Hundreds of instance of Chrome if you use it at scale. Are you sure it’s such a good idea?
36
+
37
+
- Heavy on RAM and CPU, expensive to run
38
+
- Hard to package, deploy and maintain at scale
39
+
- Bloated, lots of features are not useful in headless usage
40
+
41
+
### Lightpanda is built for performance
42
+
43
+
If we want both Javascript and performance, for a real headless browser, we need to start from scratch. Not yet another iteration of Chromium, really from a blank page. Crazy right? But that’s we did:
44
+
45
+
- Not based on Chromium, Blink or WebKit
46
+
- Low-level system programming language (Zig) with optimisations in mind
47
+
- Opinionated, no rendering
48
+
49
+
## Build from sources
50
+
51
+
We do not provide yet binary versions of Lightpanda, you have to compile it from source.
4
52
5
53
### Prerequisites
6
54
7
-
Browsercore is written with [Zig](https://ziglang.org/)`0.12`. You have to
55
+
Lightpanda is written with [Zig](https://ziglang.org/)`0.12`. You have to
8
56
install it with the right version in order to build the project.
The relevant tests cases are committed in a [dedicated repository](https://github.com/lightpanda-io/wpt) which is fetched by the `make install-submodule` command.
147
+
148
+
All the tests cases executed are located in the `tests/wpt` sub-directory.
96
149
97
150
For reference, you can easily execute a WPT test case with your browser via
98
151
[wpt.live](https://wpt.live).
99
152
100
-
*Run WPT test suite*
153
+
#### Run WPT test suite
154
+
155
+
To run all the tests:
101
156
102
-
You can run all the test.
103
-
The runner execute all the tests ending with `.html`.
104
157
```
105
158
make wpt
106
159
```
107
160
108
-
Or one specific test by using a suffix.
161
+
Or one specific test:
162
+
109
163
```
110
164
make wpt Node-childNodes.html
111
165
```
112
166
113
-
*Add a new WPT test case*
167
+
#### Add a new WPT test case
114
168
115
-
We add new tests cases files with implemented changes in Browsercore.
169
+
We add new relevant tests cases files when we implemented changes in Lightpanda.
116
170
117
-
Copy the test case you want to add from the [WPT
118
-
repo](https://github.com/web-platform-tests/wpt) into `tests/wpt` dir, commit
119
-
the files in the https://github.com/lightpanda-io/wpt repository and update the
120
-
git submodule in browsercore.
171
+
To add a new test, copy the file you want from the [WPT
172
+
repo](https://github.com/web-platform-tests/wpt) into the `tests/wpt` directory.
121
173
122
-
:warning: Please keep the original directory tree structure into`tests/wpt`.
174
+
:warning: Please keep the original directory tree structure of`tests/wpt`.
0 commit comments