Commit Graph

5737 Commits

Author SHA1 Message Date
Halil Durak
012fe40bb5 cli: remove aliases and shortcuts 2026-04-22 16:08:12 +03:00
Halil Durak
a3af914cda Config: adaptation to new cookie arguments 2026-04-22 16:08:12 +03:00
Halil Durak
29d8e0c9b7 Config: bring back validateUserAgent 2026-04-22 16:08:12 +03:00
Halil Durak
5e0c046e96 rebase and remove commented out code 2026-04-22 16:08:11 +03:00
Halil Durak
721b959dbf Config: always return a valid mode for --dump 2026-04-22 16:07:05 +03:00
Halil Durak
74a518c56f cli: reintroduce command sniffing 2026-04-22 16:07:04 +03:00
Halil Durak
156cf9b5a4 testing.zig: init directly on .serve 2026-04-22 16:07:04 +03:00
Halil Durak
f5b9bdb51b rebase and backport new feature from main 2026-04-22 16:07:04 +03:00
Halil Durak
07351f0e40 cli: add an explanatory doc-comment that goes in depth of the API 2026-04-22 16:07:04 +03:00
Halil Durak
85e624356b Commands: more aliases 2026-04-22 16:07:03 +03:00
Halil Durak
baa0d83fa7 cli: positional argument must not be null after parsing 2026-04-22 16:07:03 +03:00
Halil Durak
059d21f7fd cli: return errors if next argument not found 2026-04-22 16:07:03 +03:00
Halil Durak
dc57096995 main_legacy_test: fix regression 2026-04-22 16:07:02 +03:00
Halil Durak
886448aaa3 Commands: add shortcuts for host and port of serve 2026-04-22 16:07:02 +03:00
Halil Durak
1a68ea7370 cli: better handle unknown arguments 2026-04-22 16:07:02 +03:00
Halil Durak
10914d6288 cli: fix --log-filter-scopes regression 2026-04-22 16:07:02 +03:00
Halil Durak
b01e93502e cli: revert enum specific peek ahead logic
This was needed before the introduction of `validator`; doesn't make sense now.
2026-04-22 16:07:01 +03:00
Halil Durak
56b6fbe011 cli: many improvements
* Options with optional types are introduced to null by default
* Options with boolean types cannot be optional (nullable)
* Options with boolean types are introduced with false by default
* introduce shortcuts for options that can be provided via single dash
* introduce validators; custom parsing logic can be inserted for niche cases
2026-04-22 16:07:01 +03:00
Halil Durak
0e4ed2639f main: changes to build, introduced couple regressions
`help` command, `--dump` and `--log-filter-scopes` regressed, will come up with a solution for these.
2026-04-22 16:07:01 +03:00
Halil Durak
81b89e67b7 Config: adapt to new CLI builder 2026-04-22 16:07:01 +03:00
Halil Durak
9bf85214e3 cli: add support for command aliases and shared options 2026-04-22 16:03:18 +03:00
Halil Durak
ce62e1c631 dump.Opts.Strip: struct -> packed struct(u3)
`cli.zig` only understands packed structs currently.
2026-04-22 16:03:18 +03:00
Halil Durak
ed512d3203 introduce cli_parser
Generalized way to define command line interfaces.
2026-04-22 16:03:18 +03:00
Karl Seguin
11e584a9d8 Merge pull request #2209 from lightpanda-io/sqlite-build-zig
build: port sqlite3 to zig build system
2026-04-22 14:32:50 +08:00
Adrià Arrufat
cff45b89e5 build: remove sqlite.h 2026-04-22 08:18:36 +02:00
Adrià Arrufat
ca1f2c0854 build: port sqlite3 to zig build system 2026-04-22 07:52:10 +02:00
Karl Seguin
7511ee6a3d Merge pull request #2198 from lightpanda-io/nikneym/cookie-lookalike-domain
`Cookie`: require label boundary when matching domain attribute
2026-04-22 13:06:17 +08:00
Karl Seguin
00ca20b485 Merge pull request #2200 from lightpanda-io/page_to_frame
Page to frame
2026-04-22 09:08:42 +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
b08e347661 page.frames -> page.child_frames
More prep work. So that we have frame.child_frames and not `frame.frames`.
2026-04-22 06:30:23 +08:00
Karl Seguin
842affd83b Pre-op for Page -> Frame rename
Rename page.id -> page._loader_id and propagate the change throughout. This was
my attempt at pretending that page.id (and page._frame_id) weren't CDP-sepcific.
But they are, and it's a lot cleaner to treat them this way. Might seem
unnecessary, but without this, after page -> frame, you'd end up with:

frame.id
frame._frame_id

Which is weird? What is `frame.id` if it isn't the frame id and if that's the
case, what's frame_id? Now it'll be:

frame._loader_id
frame._frame_id

Which removes the ambiguity, makes the CDP code a bit more obvious, and doesn't
try to hide the fact that these are CDP things that, for now at least, pollute
the code a little.
2026-04-22 06:30:23 +08:00
Karl Seguin
650c0cbd28 Merge pull request #2196 from lightpanda-io/sqlite
Sqlite
2026-04-22 06:30:00 +08:00
Karl Seguin
bfb5ea1d94 Merge pull request #2201 from lightpanda-io/worker_apis
More worker APIs
2026-04-22 06:28:53 +08:00
Karl Seguin
9b96d4f7f4 Merge pull request #2202 from lightpanda-io/clone_shared_buffer_error
Add error-callback on shared buffer clone from v8
2026-04-22 06:28:41 +08:00
Karl Seguin
5731429200 Merge pull request #2205 from lightpanda-io/cdp_timing_fields
Add timing fields to a few CDP messages
2026-04-22 06:28:28 +08:00
Karl Seguin
6a6a28ede5 Merge pull request #2204 from lightpanda-io/shrink_screenshot
Shrink screenshot.png
2026-04-21 18:39:26 +08:00
Karl Seguin
686591baed fix wrong method name, ugh 2026-04-21 17:49:59 +08:00
Karl Seguin
8294ad4921 Add timing fields to a few CDP messages
Hopefully fixes https://github.com/lightpanda-io/browser/issues/2199

Adds requestTime to responseReceived and, for completeness, adds timestamp and
wallTime to requestWillBeSent.
2026-04-21 17:40:36 +08:00
Karl Seguin
33f8905f1d Shrink screenshot.png
I asked claude to do for the png what it did for the pdf. The savings aren't as
big AND, it isn't as nice as the original.

I'm tempted to say we should keep the original, but I don't feel strongly about
it and maybe saving a few KB is worth it?
2026-04-21 17:10:26 +08:00
Karl Seguin
7c9dce2a39 Add error-callback on shared buffer clone from v8
With our current "null" cullback, trying to clone a shared buffer crashes. The
callback throws an error.

Fixes a WPT crash:
/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html
2026-04-21 17:00:31 +08:00
Karl Seguin
a38e21278f More worker APIs
WritableStream*, ReadableStream*, Blob, TextDecoderStream, TextEncoderStream
and TransformStream all migrated from depending on Page to Execution.
2026-04-21 16:04:19 +08:00
Pierre Tachoire
9df41fdeb0 Merge pull request #2197 from lightpanda-io/fake-printopdf
cdp: implement a fake Page.printToPDF
2026-04-20 17:54:49 +02:00
Pierre Tachoire
fbb93e7d53 cdp: implement a fake Page.printToPDF
Similar to Page.captureScreenshot
This is useful for tools integration calling this method, returning a
fake result instead of an error.
2026-04-20 16:52:24 +02:00
Karl Seguin
ef2e42292f Merge pull request #2195 from lightpanda-io/import_string
@import(".....string.zig").String => lp.String
2026-04-20 21:58:03 +08:00
Halil Durak
780bf8cbc5 Cookie: update tests 2026-04-20 16:47:28 +03:00
Halil Durak
9ed39e4c3e Cookie: check for either exact match or dot-prefixed domain 2026-04-20 16:47:20 +03:00
Karl Seguin
e7be3c8b14 still trying to get this test to pass 2026-04-20 18:57:45 +08:00
Karl Seguin
55d7bae943 more busy timeout tricks 2026-04-20 18:42:55 +08:00
Karl Seguin
fcd3d1cd14 Use unsafe journal_mode during Pool test
Can't use WAL, as it thread sanitizer reports false positives. The default,
delete, causes busy timeouts. Let's try the unsafe memory!
2026-04-20 18:14:29 +08:00
Karl Seguin
b226a9ed52 Disable WAL mode for Sqlite pool test
It seems like there are known false positives with thread sanitizer and sqlite.

(There are various references to this in sqlite's wal.c and also possibly
related https://bugzilla.mozilla.org/show_bug.cgi?id=1153409
2026-04-20 17:16:42 +08:00