Commit Graph
14 Commits
Author SHA1 Message Date
Karl Seguin 218a4bacd4 split out protocol.json to 1 line per command 2026-09-11 06:40:23 +08:00
Karl Seguin 5bc4f7482c render: add "clutter" option to --strip-mode
Adds a `clutter` option to --strip-mode. This is based on readability.js. It
isn't a direct port (e.g. it doesn't strop bylines). It fallsback to `shell` if
it strips too much (and shell itself can fallback to not stripping anything).
But clutter rarely fallback to shell, only when a page is very small or when
it strips out _a lot_.

Also expanded shell to look at class names and ids.
2026-09-11 06:36:48 +08:00
Karl Seguin cdceca37c3 render: add "shell" option to --strip-mode
Some additional API changes:
- Add strip-mode support to pdf/png generation.
- Add LP.dump which provides greater content gathering capability to CDP,
  exposing most `fetch` dump-related parameters (e.g. format, strip, selector,
  ...)

The new "--strip-mode shell" is designed to try to remove non-content elements
such as the header and footer. The end goal is to use readibility.js test cases
as a baseline, but this isn't a port of readibility.js.

This is just the basic implementation of this, e.g removing a few key tags, e.g.
<header>, <footer> and considering some specific roles.

Even if --strip-mode shell is used, we might decide to stick with a whole dump:
it's better to strip not enough than to strip too much. This currently works by
measuring the ratio of non-link text of the stripped vs unstripped page.
2026-09-11 06:35:26 +08:00
Karl Seguin ceaa81721b update protocol.json 2026-09-11 06:09:51 +08:00
Karl Seguin 37af405076 sync protocol.json 2026-08-29 10:48:36 +08:00
Karl Seguin 2fb1629d05 update protocol.json 2026-08-29 09:48:21 +08:00
Rohit 3901858977 fix(cdp): advertise geolocation override methods in protocol + test denied path 2026-08-19 20:50:05 +05:30
Karl Seguin f4783d8fcc cdp: add /json/protocol endpoint
https://krabarena.com/claims/browserless-exposes-57-cdp-domains-for-discovery-lightpanda-s-endpoint-is-a-404
2026-08-03 15:51:42 +08:00
Karl Seguin 6a83881634 chore: add lp.IS_DEBUG and lp.IS_TEST
Change all users to builtin.mode and built.is_test
2026-08-01 09:15:18 +08:00
Karl Seguin 1363240ba5 cookie: Allow cookie on the bare domain matching public suffix list
1 - Update the public suffix list
2 - Fix the restriction on cookies domains for the public suffix list, allowing
    the bare domain to be matched

Fixes https://github.com/lightpanda-io/browser/issues/2900
2026-07-09 11:54:14 +08:00
Karl Seguin 2275416505 Page -> Frame
This is to pave the way for introducing a new "Page" container, which will take
over the page lifecycle currently burdening Session. The ultimate goal of that
is to allow the Session to have multiple pages (mostly for better transitions
between pages), which is hard to do now since the Session has so much state.

This rename was aggressive, e.g. currentPage() -> currentFrame() so that, when
the new Page container is added, you won't see "currentPage()" and wonder:

  "Does 'currentPage' mean the new Page container, or the Frame (which
  used to be called Page)".
2026-04-22 08:42:18 +08:00
Karl Seguin 75abe7da1b Update the public suffix list 2026-01-29 21:00:06 +08:00
Karl Seguin be11d82c9c improve build times (a little) 2025-07-03 13:56:01 +08:00
Karl Seguin 6f5028612a add cookie jar 2025-02-27 16:09:10 +08:00