Commit Graph

6044 Commits

Author SHA1 Message Date
Nikolay Govorov
9c669974e4 Merge pull request #2359 from lightpanda-io/wp/mrdimidium/spli-cdp-http
Reorganize Server, Client, CDP and HttpClient
2026-05-04 17:03:19 +01:00
Nikolay Govorov
9a312a4177 Refactor server/client/cdp structure 2026-05-04 16:41:22 +01:00
Karl Seguin
112d4d1603 Merge pull request #2356 from lightpanda-io/cdp-audits
cdp: rename Audit into Audits
2026-05-04 19:03:35 +08:00
Pierre Tachoire
080e1e6415 cdp: rename Audit into Audits 2026-05-04 12:42:55 +02:00
Karl Seguin
6b896ba243 Merge pull request #2355 from lightpanda-io/worker_timers
Extract Window Scheduling and re-use it in Worker
2026-05-04 18:18:31 +08:00
Karl Seguin
d1bf44b686 Extract Window Scheduling and re-use it in Worker
Add worker.setInterval, clearInterval, setTimeout, clearTimeout by extracting
the scheduling logic from Window and making it use Execution rather than Frame.
2026-05-04 17:57:05 +08:00
Pierre Tachoire
5aa47f0837 Merge pull request #2354 from lightpanda-io/brew-AUR
README: add hombrew and AUR install
2026-05-04 11:42:07 +02:00
Pierre Tachoire
584d817d2e Merge pull request #2353 from lightpanda-io/remove-archlinux-pkg
ci: remove archlinux packaging
2026-05-04 11:40:43 +02:00
Pierre Tachoire
a266ae7c51 README: add hombrew and AUR install 2026-05-04 11:36:52 +02:00
Pierre Tachoire
2fde24c9c1 ci: remove archlinux packaging
Better use
```
yay -S lightpanda-bin
```
2026-05-04 11:29:24 +02:00
Karl Seguin
116cc3aee7 Merge pull request #2350 from lightpanda-io/worker_importScripts
Worker.importScripts
2026-05-04 16:00:42 +08:00
Karl Seguin
5238799f6c Merge pull request #2348 from lightpanda-io/window_close_scheduler_reset
On window.close, reset the frame's scheduler
2026-05-04 15:56:46 +08:00
Karl Seguin
b25b91447c Merge pull request #2344 from lightpanda-io/sighandler_threadsafety
Make sighandler thread-safe
2026-05-04 15:56:33 +08:00
Karl Seguin
3d8499abe4 Merge pull request #2317 from lightpanda-io/worker_xhr_fetch
Make Fetch and XHR usable from Worker
2026-05-04 15:56:10 +08:00
Pierre Tachoire
65308f01c4 Merge pull request #2297 from lightpanda-io/pending-page
keep the existing page active until the pending one is loaded
2026-05-04 09:42:27 +02:00
Pierre Tachoire
14743e4369 replace pages array from Session to allocated active and pending pages 2026-05-04 08:59:59 +02:00
Pierre Tachoire
f9cdc12bf6 use qn.is_about_blank for check instead of string comparison
And fix comment
2026-05-04 08:59:58 +02:00
Pierre Tachoire
6e7398d586 Don't re-init fields w/ default values 2026-05-04 08:59:57 +02:00
Pierre Tachoire
35cecf6fcc fix lp.assert usage
Remove unreachable code and use `comptime IS_DEBUG` check when need.
2026-05-04 08:59:57 +02:00
Pierre Tachoire
3fc5e6d8a5 rename var old_idx into old_active_idx for clarity 2026-05-04 08:59:56 +02:00
Pierre Tachoire
38169fdb52 rename pendingOrCurrentFrame
Co-authored-by: Karl Seguin <karlseguin@users.noreply.github.com>
2026-05-04 08:59:55 +02:00
Pierre Tachoire
e3eb8eba46 typo fix 2026-05-04 08:59:54 +02:00
Pierre Tachoire
ddbdaafa28 refacto Session install and teardown active page 2026-05-04 08:59:54 +02:00
Pierre Tachoire
cddabe60f5 cdp: avoid request id conflict between LID- and REQ-
Use distinct key for laoder id and request id based captured response.
2026-05-04 08:59:53 +02:00
Pierre Tachoire
b2c53f4a1d update comments according to abortFrame change 2026-05-04 08:59:52 +02:00
Pierre Tachoire
e33018f40e discardPendingPage on Session.initiateRootNavigation 2026-05-04 08:59:51 +02:00
Pierre Tachoire
11172a341a cdp: use loader_id as captured response key for documents 2026-05-04 08:59:50 +02:00
Pierre Tachoire
84246c3b57 Get the pending frame from the Runner
We want to take in account the pending frame in Runner._tick to continue
to process. If we use only the current frame, we will immediately return
in case of navigation.
2026-05-04 08:59:49 +02:00
Pierre Tachoire
c251f0c03b cdp: remove replacePage and use Session.initiateRootNavigation 2026-05-04 08:59:48 +02:00
Pierre Tachoire
f7ac258b8c dispatch frame_remove and new_frame events from sesion.replacePage
So the CDP can remove/reset context and re-create isolated world
accordingly
2026-05-04 08:59:47 +02:00
Pierre Tachoire
6e1b8f6a41 always deinit http of frame/page/worker by frame id 2026-05-04 08:59:45 +02:00
Pierre Tachoire
acdddb7ec8 keep the existing page active until the pending one is loaded
During a root navigation, we keep the existing page active until we get
the headers callback from the pending page. Then
Session.commitPendingPage makes the switch.

It delays the deinit of CPD execution context to handle JS execution in
the meantime.

Now session has an array of two pages, _active_idx points to the main
page.

Both active and pending pages share the same frame_id, it must remains
stable. So this PR adds a Request.protect_from_abort to avoid removing
the request form the pending page when deinit the previous active page.
2026-05-04 08:50:26 +02:00
Karl Seguin
77a1fdc2a0 Worker.importScripts
I also noticed that failures in async assertions could be ignored, so I fixed
that and fixed a couple failing XHR tests.
2026-05-04 14:40:57 +08:00
Karl Seguin
0420802f8d Merge pull request #2349 from lightpanda-io/remove-arraylist-unmanaged
RobotsLayer: use ArrayList
2026-05-04 14:19:09 +08:00
Adrià Arrufat
eab9ae0243 RobotsLayer: use managed ArrayList 2026-05-04 08:01:22 +02:00
Karl Seguin
0c55875b63 encode worker URL 2026-05-04 13:52:38 +08:00
Karl Seguin
d8b16eb4f6 Make Fetch and XHR usable from Worker
Follows previous changes to make a WebAPI worker-compatible by replacing any
dependency on *Frame with *js.Execute, *Page and/or *Session. The changes here
are relatively minor since most of the existing supporting WebApis (e.g. Blob,
Response, Request) have already been migrated.
2026-05-04 13:50:30 +08:00
Karl Seguin
2ee398b6d5 On window.close, reset the frame's scheduler
Saw that worker.close() does this and it makes sense to do for window.close()
too.
2026-05-04 11:31:02 +08:00
Karl Seguin
b8144d3ec4 Merge pull request #2346 from navidemad/fix/libidn2-macos-strchrnul
build: provide strchrnul shim for libidn2 on macOS
2026-05-04 11:30:42 +08:00
Karl Seguin
87b7ebfc00 Merge pull request #2340 from lightpanda-io/tick_efficiency
More aggressive popup cleanup, more efficient load tick
2026-05-04 11:29:24 +08:00
Karl Seguin
cf04873d7a Merge pull request #2334 from lightpanda-io/script_mode
Split Script
2026-05-04 11:28:25 +08:00
Karl Seguin
150c401a27 Merge pull request #2313 from lightpanda-io/callback_fixes
Fix more DOM assumptions that callback and document.write can break
2026-05-04 11:28:05 +08:00
Karl Seguin
501bfe65f0 Merge pull request #2333 from webcoyote/display-dynamic-port
Display actual port when binding --port 0
2026-05-04 11:15:58 +08:00
Karl Seguin
ab93cbb56c Merge pull request #2318 from lightpanda-io/atob_btoa
Fix atob/btoa
2026-05-04 08:29:11 +08:00
Karl Seguin
0da32a73b7 Merge pull request #2337 from lightpanda-io/about_blank_navigation_assertion
Fix failed navigation assertion
2026-05-04 08:27:28 +08:00
Karl Seguin
9bea9c9dc7 Merge pull request #2347 from lightpanda-io/fix/summary-click-toggles-details
Fix/summary click toggles details
2026-05-04 08:26:57 +08:00
Karl Seguin
1b90ef58be Summary click opens details
Tweak on https://github.com/lightpanda-io/browser/pull/2342
2026-05-04 08:02:56 +08:00
Navid EMAD
d76b76221f build: colocate libidn2 strchrnul shim with strverscmp block
config.h already has a hand-added _LIBIDN2_LP_DECLS guarded block at
the end declaring extern strverscmp for the same gnulib-overlay reason.
Move the strchrnul prototype into that block (still #ifdef __APPLE__
since glibc Linux already declares it) so all project-added externs
live in one place, the autoconf-generated section stays untouched, and
the precedent for "how this codebase handles missing glibc extensions"
is one consistent pattern instead of two.

Refresh the build.zig and strchrnul.c comments to point at the
relocated declaration.

No functional change — verified across -target x86_64-macos.{13.0,
14.0,15.4} (lookup.c pattern + the three TUs that include both
<config.h> and <string.h>) plus x86_64-linux-gnu, all under
-Wall -Wextra -Werror.
2026-05-02 10:11:41 +02:00
Navid EMAD
7b5e18e23d build: relocate libidn2 strchrnul prototype into config.h
Move the macOS strchrnul declaration from a side-channel header injected
via -include into vendor/libidn2/config.h itself, gated on __APPLE__.
config.h is the canonical place where libidn2 documents its
HAVE_STRCHRNUL detection — co-locating the platform fallback prototype
there mirrors gnulib's own approach (which declares missing symbols in
its substituted <string.h>) and removes the per-platform build-flag
asymmetry plus the dedicated include path.

The Darwin-only strchrnul.c implementation is unchanged; build.zig now
just adds it on Darwin without touching the lib/ flags array.

Verified that on both `-target x86_64-macos.14.0` (no libc strchrnul)
and `-target x86_64-macos.15.4` (libc has it) a TU mimicking lookup.c
(`#include "config.h"` then call strchrnul) compiles cleanly with no
implicit-declaration error and no redeclaration warning.
2026-05-02 10:00:42 +02:00
Navid EMAD
40900a358c build: provide strchrnul shim for libidn2 on macOS
libidn2's lib/lookup.c calls strchrnul() unconditionally — a glibc
extension that macOS libc neither defines nor declares. Upstream's
portable build relies on gnulib substituting <string.h> with a
declaration and linking gl/strchrnul.c, but that overlay is not wired
up here. The result was an "implicit function declaration" hard error
on every macOS nightly build.

Add a Darwin-only shim under vendor/libidn2/darwin/ and inject its
prototype into the libidn2 lib/ sources via -include. The shim mirrors
strchrnul's semantics without falling through to rawmemchr (also
glibc-only) since libidn2 only ever searches for '.'.
2026-05-02 09:52:05 +02:00