From 03355f6a4ac73acfb5241fa6ef4c8e5fae2df1a3 Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Tue, 18 Feb 2025 11:01:52 +0100 Subject: [PATCH 1/8] readme: remove useless badges --- README.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/README.md b/README.md index f8471029..c43894f6 100644 --- a/README.md +++ b/README.md @@ -7,20 +7,12 @@

lightpanda.io

- -[![Commit Activity](https://img.shields.io/github/commit-activity/m/lightpanda-io/browser)](https://github.com/lightpanda-io/browser/commits/main) [![License](https://img.shields.io/github/license/lightpanda-io/browser)](https://github.com/lightpanda-io/browser/blob/main/LICENSE) [![Twitter Follow](https://img.shields.io/twitter/follow/lightpanda_io)](https://twitter.com/lightpanda_io) [![GitHub stars](https://img.shields.io/github/stars/lightpanda-io/browser)](https://github.com/lightpanda-io/browser)
-
- -lightpanda-io%2Fbrowser | Trendshift - -
- Lightpanda is the open-source browser made for headless usage: - Javascript execution From cd429f59353a474d50df77dc7ec3150c6166be95 Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Tue, 18 Feb 2025 11:06:51 +0100 Subject: [PATCH 2/8] readme: fix binary name --- README.md | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index c43894f6..ebd04875 100644 --- a/README.md +++ b/README.md @@ -36,29 +36,22 @@ You can download the last binary from the [nightly builds](https://github.com/lightpanda-io/browser/releases/tag/nightly) for Linux x86_64 and MacOS aarch64. +*For linux* ```console -# Download the binary -$ wget https://github.com/lightpanda-io/browser/releases/download/nightly/lightpanda-x86_64-linux -$ chmod a+x ./lightpanda-x86_64-linux -$ ./lightpanda-x86_64-linux -h -usage: ./lightpanda-x86_64-linux [options] [URL] +$ wget -O lightpanda https://github.com/lightpanda-io/browser/releases/download/nightly/lightpanda-x86_64-linux +$ chmod a+x ./lightpanda +``` - start Lightpanda browser - - * if an url is provided the browser will fetch the page and exit - * otherwhise the browser starts a CDP server - - -h, --help Print this help message and exit. - --host Host of the CDP server (default "127.0.0.1") - --port Port of the CDP server (default "9222") - --timeout Timeout for incoming connections of the CDP server (in seconds, default "3") - --dump Dump document in stdout (fetch mode only) +*For MacOS* +```console +$ wget -O lightpanda https://github.com/lightpanda-io/browser/releases/download/nightly/lightpanda-aarch64-macos +$ chmod a+x ./lightpanda ``` ### Dump an URL ```console -$ ./lightpanda-x86_64-linux --dump https://lightpanda.io +$ ./lightpanda --dump https://lightpanda.io info(browser): GET https://lightpanda.io/ http.Status.ok info(browser): fetch script https://api.website.lightpanda.io/js/script.js: http.Status.ok info(browser): eval remote https://api.website.lightpanda.io/js/script.js: TypeError: Cannot read properties of undefined (reading 'pushState') @@ -68,7 +61,7 @@ info(browser): eval remote https://api.website.lightpanda.io/js/script.js: TypeE ### Start a CDP server ```console -$ ./lightpanda-x86_64-linux --host 127.0.0.1 --port 9222 +$ ./lightpanda --host 127.0.0.1 --port 9222 info(websocket): starting blocking worker to listen on 127.0.0.1:9222 info(server): accepting new conn... ``` From f8d01e159604e98c1d03bc9938dcdfd17f0b0b1e Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Tue, 18 Feb 2025 11:15:06 +0100 Subject: [PATCH 3/8] readme: update exemple t odump links --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index ebd04875..406d55ae 100644 --- a/README.md +++ b/README.md @@ -83,10 +83,20 @@ const browser = await puppeteer.connect({ const context = await browser.createBrowserContext(); const page = await context.newPage(); +// Dump all the links from the page. await page.goto('https://wikipedia.com/'); +const links = await page.evaluate(() => { + return Array.from(document.querySelectorAll('a')).map(row => { + return row.getAttribute('href'); + }); +}); + +console.log(links); + await page.close(); await context.close(); +await browser.disconnect(); ``` ## Build from sources From 689dddd11a746d097aa79a8953a1d83a5f05e1b4 Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Tue, 18 Feb 2025 11:19:02 +0100 Subject: [PATCH 4/8] readme: allow copy/paste install instruction --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 406d55ae..395af948 100644 --- a/README.md +++ b/README.md @@ -38,14 +38,14 @@ Linux x86_64 and MacOS aarch64. *For linux* ```console -$ wget -O lightpanda https://github.com/lightpanda-io/browser/releases/download/nightly/lightpanda-x86_64-linux -$ chmod a+x ./lightpanda +wget -O lightpanda https://github.com/lightpanda-io/browser/releases/download/nightly/lightpanda-x86_64-linux && \ +chmod a+x ./lightpanda ``` *For MacOS* ```console -$ wget -O lightpanda https://github.com/lightpanda-io/browser/releases/download/nightly/lightpanda-aarch64-macos -$ chmod a+x ./lightpanda +wget -O lightpanda https://github.com/lightpanda-io/browser/releases/download/nightly/lightpanda-aarch64-macos && \ +chmod a+x ./lightpanda ``` ### Dump an URL From 0a1e6623c8d9105f031d5c457a40a85740b2e6e9 Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Tue, 18 Feb 2025 11:20:56 +0100 Subject: [PATCH 5/8] readme: allow examples copy/paste --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 395af948..7a91d8ea 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,9 @@ chmod a+x ./lightpanda ### Dump an URL ```console -$ ./lightpanda --dump https://lightpanda.io +./lightpanda --dump https://lightpanda.io +``` +```console info(browser): GET https://lightpanda.io/ http.Status.ok info(browser): fetch script https://api.website.lightpanda.io/js/script.js: http.Status.ok info(browser): eval remote https://api.website.lightpanda.io/js/script.js: TypeError: Cannot read properties of undefined (reading 'pushState') @@ -61,7 +63,9 @@ info(browser): eval remote https://api.website.lightpanda.io/js/script.js: TypeE ### Start a CDP server ```console -$ ./lightpanda --host 127.0.0.1 --port 9222 +./lightpanda --host 127.0.0.1 --port 9222 +``` +```console info(websocket): starting blocking worker to listen on 127.0.0.1:9222 info(server): accepting new conn... ``` From 27e907491be9f7931f147804d5bfe83b734b6de0 Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Tue, 18 Feb 2025 11:25:04 +0100 Subject: [PATCH 6/8] readme: remove text duplication --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7a91d8ea..b6e3038a 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Lightpanda is the open-source browser made for headless usage: - Support of Web APIs (partial, WIP) - Compatible with Playwright, Puppeteer through CDP (WIP) -Fast web automation for AI agents, LLM training, scraping and testing with minimal memory footprint: +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 From 1a8cc2d019d31e491463409608368d395ea31074 Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Tue, 18 Feb 2025 11:31:52 +0100 Subject: [PATCH 7/8] readme: adjust text --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b6e3038a..b8b50b4b 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,8 @@ Lightpanda is the open-source browser made for headless usage: 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 +- Exceptionally fast execution (11x faster than Chrome) +- Instant startup From cdcc5e106f384cadd5cb6972d7a814ebc75b7144 Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Tue, 18 Feb 2025 11:32:02 +0100 Subject: [PATCH 8/8] readme: use curl to download binary --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b8b50b4b..f8664bd5 100644 --- a/README.md +++ b/README.md @@ -39,13 +39,13 @@ Linux x86_64 and MacOS aarch64. *For linux* ```console -wget -O lightpanda https://github.com/lightpanda-io/browser/releases/download/nightly/lightpanda-x86_64-linux && \ +curl -L -o lightpanda https://github.com/lightpanda-io/browser/releases/download/nightly/lightpanda-x86_64-linux && \ chmod a+x ./lightpanda ``` *For MacOS* ```console -wget -O lightpanda https://github.com/lightpanda-io/browser/releases/download/nightly/lightpanda-aarch64-macos && \ +curl -L -o lightpanda https://github.com/lightpanda-io/browser/releases/download/nightly/lightpanda-aarch64-macos && \ chmod a+x ./lightpanda ```