Commit Graph
8287 Commits
Author SHA1 Message Date
Karl Seguin a6af331ab2 zig fmt 2026-07-24 08:25:21 +08:00
Karl Seguin 2b945aa1f9 cdp: ignore duplicate enable calls
CDP driver can send multiple Network.enable which would register the same
listener multiple times. This commit makes it so that only one (the first)
callback registered for a listener+eventtype is used. Subsequent registration
for the same listener+eventtype are ignored. This is safe because all callbacks
are currently static. It's a mistake (enforced by a debug-only assertion) for
code to try to register a different callback for an already registered listener+
eventtype.

This generalizes https://github.com/lightpanda-io/browser/pull/3038
2026-07-24 08:20:32 +08:00
Karl Seguin de85a51dda Merge pull request #3039 from lightpanda-io/fix-help-pager
cli: fix help pager broken by lp.io's failing allocator
2026-07-24 08:10:45 +08:00
Karl Seguin 8fbcc7e5c1 Merge pull request #3015 from lightpanda-io/cdp-utf8-sanitization
cdp: Sanitize non-UTF 8 values
2026-07-24 08:03:38 +08:00
Karl Seguin 76e2e7e619 Merge pull request #2983 from lightpanda-io/layer-ordering
css: Respect @layer priority
2026-07-24 08:03:03 +08:00
Karl Seguin 05957a2eb9 Merge pull request #3044 from lightpanda-io/fix-report-error-crash
Fix Seg Fault on `window.reportError`
2026-07-24 08:01:53 +08:00
Muki Kiboigo fccd6bf90b acquire ref on event before dispatchDirect on reportError 2026-07-23 12:57:59 -07:00
Karl Seguin 40894a6bfd Merge pull request #3008 from lightpanda-io/zig-0.16-flake
Update Nix flake for Zig 0.16
2026-07-23 21:35:41 +08:00
Muki Kiboigo 791af8fded update Nix flake for Zig 0.16 2026-07-23 05:54:13 -07:00
Pierre Tachoire 3c925f740c Merge pull request #3040 from lightpanda-io/fix/lightpanda-request-blocking
Fix/lightpanda request blocking
2026-07-23 12:39:17 +02:00
Adrià Arrufat 4840a96645 cli: fix help pager broken by lp.io's failing allocator
std.Io.Threaded.init_single_threaded sets .allocator = .failing, which
spawnPosix uses to build the child's argv/env, so
std.process.spawn(lp.io, ...) always returns OutOfMemory and printPaged
silently fell back to plain output. Spawn the pager through a local
Threaded instance with a real allocator and the real environ (the
single-threaded one is empty, breaking PATH lookup of the less
fallback).
2026-07-23 12:16:19 +02:00
Pierre Tachoire 303a3666b6 don't count blocked redirects as followed
Move the http_redirects metric increment after the URL block check so a
redirect that gets blocked is recorded as an error, not a redirect.
2026-07-23 12:15:50 +02:00
Pierre Tachoire 43d17a78f2 skip empty URL block patterns consistently
Centralize empty-pattern filtering in UrlBlocklist.init/initPatterns so
the CDP setBlockedURLs path matches the CLI --block-urls behavior. Keep
blocks aligned with the filtered patterns.
2026-07-23 12:15:49 +02:00
Matt Van Horn dee40075a0 feat(cdp): implement Network.setBlockedURLs via urlPatterns
Reimplement request blocking on the non-deprecated urlPatterns shape:
each pattern carries an explicit block/allow flag (first match wins),
UrlBlocklist owns the compiled patterns plus their block flags, and the
legacy setBlockedUrls path stays for back-compat. Tests updated.
2026-07-23 12:15:49 +02:00
Matt Van Horn 311ab3aaae feat(cdp): add Network.setBlockedURLs and --block-urls request blocking 2026-07-23 12:15:47 +02:00
Pierre Tachoire 1d3e9617c4 Merge pull request #2891 from lightpanda-io/nikneym/custom-cert-load
Support loading custom CAs (`--ca-cert`, `--ca-path`)
2026-07-23 11:33:30 +02:00
Pierre Tachoire b90d9def84 remove dead condition 2026-07-23 11:12:50 +02:00
Pierre Tachoire 45c8f7499c adjust help for --ca-* options 2026-07-23 10:33:41 +02:00
Karl Seguin a50c38b672 Merge pull request #3016 from Ppsoft1991/fix/cdp-frame-parent
cdp: expose child frame metadata
2026-07-23 12:43:55 +08:00
Karl Seguin 6374dab634 refactor: Use JSON writer to serialize CDP Frame
This has the benefit of avoiding a few arena dupes, but those were small. The
real benefit is consistency with the rest of the code.
2026-07-23 12:22:24 +08:00
Ppsoft1991 f88564b56d cdp: expose child frame metadata
Include parentId on child frame navigation events and recursively serialize child frames in Page.getFrameTree using their live frame and loader IDs.

Fixes #3014
2026-07-23 12:08:45 +08:00
Karl Seguin 0d77c501db Merge pull request #3012 from mh0pe/codex/svg-01-factory
webapi: derive SVG prototype chains
2026-07-23 10:31:38 +08:00
Madison Steiner 7140cfab5a webapi: derive SVG prototype chains 2026-07-23 08:05:40 +08:00
Karl Seguin 6f82bdcd51 Merge pull request #3026 from staylor/inline-finalizer-callbacks
browser: inline finalizer callbacks
2026-07-23 08:02:26 +08:00
Karl Seguin 95ed50500b Merge pull request #3000 from lightpanda-io/resize-observer
webapi: Improve ResizeObserver
2026-07-23 07:48:40 +08:00
Karl Seguin bd19246b45 Merge pull request #2999 from lightpanda-io/runner-tick-signal
perf: Improve Runner tick signaling on macrotask-only wait
2026-07-23 07:48:27 +08:00
Karl Seguin bbbbfc7314 Merge pull request #3024 from lightpanda-io/agent-console-sink
script: route console output through an optional sink
2026-07-23 07:33:08 +08:00
Karl Seguin 8f562330c8 perf: Improve Runner tick signaling on macrotask-only wait
Currently, Runner assumes that HttpClient.tick did something. But it's possible
that HttpClient had nothing to do, and thus didn't poll. In that case, Runner
would return .{.ok = 0} and Runner's caller would also certainly call
Runner.tick again, resulting in a spin-loop.

The reason Runner allows this to happen is because it can still have macrotasks
to run. So now, when HttpClient.tick has done nothing, Runner will return its
ms_to_next_task, rather than 0.

On sites where all i/o is completed, and only macrotasks are waiting, this
significantly reduces CPU usage.
2026-07-23 07:28:32 +08:00
Karl Seguin e88b4b6779 zig 0.16 2026-07-23 07:27:40 +08:00
Karl Seguin 61fd04d3a5 webapi: Improve ResizeObserver
This gives ResizeObserver a touch up that brings it on par with how the more
flushed out IntersectionObserver behaves. While it's impossible to fully
implement this in a headless world, we can correctly emit ResizeObserverEntry
in a number of important cases, e.g. visibility change, and style width/height
changes.

Most importantly, we not execute the callback on the initial observe, which can
unlock some cases.
2026-07-23 07:23:56 +08:00
Karl Seguin 4e14331046 Merge pull request #3017 from lightpanda-io/websocket-improvements
websocket, wpt: Improve websocket WPT results + flakiness
2026-07-23 07:23:32 +08:00
Scott Taylor 2be09b5199 browser: inline finalizer callbacks
Assisted-By: devx/3b7fd0ba-7378-40f0-a356-c0f5ce04cd1e
2026-07-22 12:52:40 -04:00
Pierre Tachoire bb2f1a7fe3 Merge pull request #3020 from raj921/codex/fix-cdp-detached-node
cdp: preserve node IDs across child frame navigation
2026-07-22 18:20:44 +02:00
Karl Seguin c451cd763a websocket, wpt: Improve websocket WPT results + flakiness
1 - Blocks connection to "bad" ports
2 - new WebSocket('...'); mostly returns the instance, and errors are emitted
    in a close event (1)
3 - More validation (no # allowed, ...);
4 - http -> ws, https -> wss  (yes, per spec)

There's also some groundwork for better float16 support, but it turns out this
will require a new v8 build to complete. So I left the harmless float16 mapping
in (but, without the matching Float16Array, it doesn't help much).

(1) Some things cause an exception to be raised, but most don't
2026-07-22 23:31:54 +08:00
Halil Durak a4ba95b3ad changes for Zig 0.16 (again) 2026-07-22 18:29:33 +03:00
Halil Durak b791512b37 libcrypto: remove dead bindings 2026-07-22 18:29:32 +03:00
Halil Durak 9d6c54ac81 changes for Zig 0.16 2026-07-22 18:29:32 +03:00
Halil Durak f18d958135 Network: rework how CA stores are created 2026-07-22 18:29:32 +03:00
Halil Durak 4eeb9f5ecf Config: add customCertStore helper
Returns a pointer to `X509_STORE` if custom CA supplied, else null.
2026-07-22 18:29:32 +03:00
Halil Durak 0e32b9c41f Config: remove dead isHashedDirectory function 2026-07-22 18:29:31 +03:00
Halil Durak 6a9a1f9729 Config: cert store creation is done in Config if custom CA given 2026-07-22 18:29:31 +03:00
Halil Durak 83d3fb45e3 cli: introduce shared fields
Storage fields can now be shared by CLI arguments; also having a different type for internal representation and CLI is also added.
2026-07-22 18:29:31 +03:00
Halil Durak cbaef301d9 Config: fix crash related to absolute paths
BoringSSL is fine with that still.
2026-07-22 18:29:31 +03:00
Halil Durak 6f828cb92e createX509Store: track hashed directories separately 2026-07-22 18:29:30 +03:00
Halil Durak 1429202de3 update createX509Store in all call sites 2026-07-22 18:29:30 +03:00
Halil Durak 03cfdbe567 Config: dupe received dir from arg iterator 2026-07-22 18:29:30 +03:00
Halil Durak 71536de386 createX509Store: report if no certificates loaded
Unifies how we report empty stores by checking directly on `X509_STORE`.
2026-07-22 18:29:30 +03:00
Halil Durak 2a53b1e243 createX509Store: skip custom CA loading if none given 2026-07-22 18:29:29 +03:00
Halil Durak 1c97bc42a4 crypto: more bindings
* bind `X509_STORE_get0_objects`,
* bind `sk_num`,
* bind `sk_X509_OBJECT_num`,
* add `getCertCount` helper.
2026-07-22 18:29:29 +03:00
Halil Durak d6ce3738a5 remove --disable-root-certificates flag 2026-07-22 18:29:29 +03:00