Commit Graph

4671 Commits

Author SHA1 Message Date
Karl Seguin
7a417435cc Update src/browser/Session.zig
Co-authored-by: Pierre Tachoire <pierre@lightpanda.io>
2026-02-26 10:53:16 +08:00
Karl Seguin
497d6e80f7 Merge pull request #1658 from lightpanda-io/wp/mrdimidium/typesafe-libcurl
Move curl C API to type-safe wrapper
2026-02-26 10:28:37 +08:00
Karl Seguin
ae6ab34e72 Make NodeList enumerable
This probably needs to be done for more types. Foundation is now in bridge, so
it should be easy to add.
2026-02-26 08:57:42 +08:00
Nikolay Govorov
4c26161728 Move curl C API to type-safe wrapper 2026-02-25 23:29:54 +00:00
Karl Seguin
1731dca5dd Merge pull request #1648 from lightpanda-io/remove_unused_page_wait
Some checks failed
e2e-test / zig build release (push) Has been cancelled
e2e-test / demo-scripts (push) Has been cancelled
e2e-test / cdp-and-hyperfine-bench (push) Has been cancelled
e2e-test / perf-fmt (push) Has been cancelled
e2e-test / browser fetch (push) Has been cancelled
zig-test / zig test using v8 in debug mode (push) Has been cancelled
zig-test / zig test (push) Has been cancelled
zig-test / perf-fmt (push) Has been cancelled
nightly build / build-linux-x86_64 (push) Has been cancelled
nightly build / build-linux-aarch64 (push) Has been cancelled
nightly build / build-macos-aarch64 (push) Has been cancelled
nightly build / build-macos-x86_64 (push) Has been cancelled
wpt / web platform tests json output (push) Has been cancelled
wpt / perf-fmt (push) Has been cancelled
e2e-integration-test / zig build release (push) Has been cancelled
e2e-integration-test / demo-integration-scripts (push) Has been cancelled
Remove unused Page.wait and Page._wait
2026-02-26 07:19:40 +08:00
Karl Seguin
ee2caff46e Merge pull request #1577 from lightpanda-io/selection-modify
Add `modify` to Selection
2026-02-26 07:03:37 +08:00
Karl Seguin
db8fb8b05d Merge pull request #1646 from lightpanda-io/url_encoding
Add url encoding option to URL.resolve
2026-02-26 07:02:49 +08:00
Karl Seguin
bec7e141dc Remove unused Page.wait and Page._wait
These exist in Session since iframes. The code isn't currently being used, I
must have pulled it back in during a rebase.
2026-02-26 06:58:56 +08:00
Karl Seguin
ab85b4b129 Merge pull request #1653 from lightpanda-io/dummy-performance-timing
add dummy PerformanceTiming
2026-02-26 06:50:19 +08:00
Karl Seguin
b030049b40 Merge pull request #1652 from lightpanda-io/dump_with_frames
Add a --with_frames argument to fetch
2026-02-26 06:49:53 +08:00
Karl Seguin
1338a3d89d Merge pull request #1647 from lightpanda-io/fix_event_leak_on_disaptch
fix event leak on dispatchEvent
2026-02-26 06:49:29 +08:00
Pierre Tachoire
181178296f set empty_with_no_proto for performance timing and navigation 2026-02-25 21:14:09 +01:00
Pierre Tachoire
df7888d6fb use bridge.property for performance timing and navigation 2026-02-25 21:10:27 +01:00
Muki Kiboigo
dd15f5e052 fix selection modify on nextTextNodeAfter 2026-02-25 07:21:30 -08:00
Muki Kiboigo
f348d85b11 add tests for walking past element on selection modify 2026-02-25 07:21:16 -08:00
Adrià Arrufat
8c8a05b8c1 mcp: consolidate tests and cleanup imports 2026-02-26 00:02:49 +09:00
Adrià Arrufat
34d2fc1503 mcp: support notifications and improve error handling
Make Request id optional for JSON-RPC notifications and handle the
initialized event. Improve thread safety, logging, and error paths.
2026-02-25 23:14:06 +09:00
Adrià Arrufat
9b3fa809bf mcp: add search, markdown, links, and over tools 2026-02-25 20:27:49 +09:00
Karl Seguin
59535c112e Add FileReader 2026-02-25 19:03:24 +08:00
Karl Seguin
04e5a6425a Merge pull request #1655 from lightpanda-io/crash_report_args
Some checks failed
e2e-test / zig build release (push) Has been cancelled
e2e-test / demo-scripts (push) Has been cancelled
e2e-test / cdp-and-hyperfine-bench (push) Has been cancelled
e2e-test / perf-fmt (push) Has been cancelled
e2e-test / browser fetch (push) Has been cancelled
zig-test / zig test using v8 in debug mode (push) Has been cancelled
zig-test / zig test (push) Has been cancelled
zig-test / perf-fmt (push) Has been cancelled
Include assertion args in crash report
2026-02-25 18:36:24 +08:00
Karl Seguin
424dddf67b Merge pull request #1656 from lightpanda-io/dump_attribute
Dump Attribute to empty string
2026-02-25 18:31:19 +08:00
Pierre Tachoire
f0d6ae2a00 Merge pull request #1654 from lightpanda-io/dynamic_import_undefined_resource
Handle dynamicModuleCallback being called with undefined/null resourc…
2026-02-25 11:22:53 +01:00
Karl Seguin
25298a32fa Dump Attribute to empty string
This is normally not called in "normal" dump-usage, but with
XMLSerializer.serializeToString an Attr node _can_ be provided. The spec says,
and FF agrees, this should return an empty string.
2026-02-25 18:16:13 +08:00
Karl Seguin
ba28bf01b7 Include assertion args in crash report
Add more parameters to mysterious/persistent/infrequent
ScriptManager.Header recall failed assertion.
2026-02-25 18:05:33 +08:00
Pierre Tachoire
d15c29b1a3 add dummy Performance.Navigation 2026-02-25 10:52:17 +01:00
Karl Seguin
b083910a51 Handle dynamicModuleCallback being called with undefined/null resource_name
Fixes WPT test:
/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-of-promise-result.html
2026-02-25 17:05:40 +08:00
Pierre Tachoire
235aad32a6 add dummy PerformanceTiming 2026-02-25 08:35:53 +01:00
Karl Seguin
a818560344 Add a --with_frames argument to fetch
When set (defaults to not set/false), --dump will include iframe contents.

I was hoping I could add a mode to strip_mode to this, but since dump is used
extensively (e.g. innerHTML), this is something that has to be off by default
(for correctness).
2026-02-25 15:29:27 +08:00
Nikolay Govorov
8f179becf7 Merge pull request #1639 from lightpanda-io/wp/mrdimidium/cleanup-io-layer
Some checks failed
e2e-test / zig build release (push) Has been cancelled
e2e-test / demo-scripts (push) Has been cancelled
e2e-test / cdp-and-hyperfine-bench (push) Has been cancelled
e2e-test / perf-fmt (push) Has been cancelled
e2e-test / browser fetch (push) Has been cancelled
zig-test / zig test using v8 in debug mode (push) Has been cancelled
zig-test / zig test (push) Has been cancelled
zig-test / perf-fmt (push) Has been cancelled
Separates network and the browser specific t
2026-02-25 06:12:56 +00:00
Nikolay Govorov
e1695a0874 Strict visibility for Net functions 2026-02-25 05:58:08 +00:00
Karl Seguin
af7498d283 Run the MessageLoop [a lot] more.
Depends on: https://github.com/lightpanda-io/zig-v8-fork/pull/152

We previously ran the message loop every 250ms. This commit changes it to run on
every tick (much more frequently). It also runs microtasks after draining the
message loop (since it can generate microtasks).

Also, we use to run microtasks after each script execution. Now we drain the
message Loop + microtasks.

We still only drain the microtasks when executing v8 callbacks.

As part of this change, we also adjust our wait time based on whether or not
there are pending background tasks in v8 in order to try to execute them (in
general) and in a timely manner.

The goal is to ensure that tasks v8 enqueued on the foreground thread are
executed promptly.

This change is particularly useful for calls to webassembly as compilation
happens in the background and eventually requires the message loop to be drained
to continue.

Previously, if a script did `await WebAssembly.instantiate(....)`, there was
a good chance we'd never finish the code - we'd wait too long to run the
message loop AND, after running it, we wouldn't necessarily resolve the promise.
2026-02-25 13:55:35 +08:00
Nikolay Govorov
3e2a4d8053 Move curl_multi to Net layer 2026-02-25 05:31:28 +00:00
Nikolay Govorov
29982e2caf Move all curl_easy ops to Connection 2026-02-25 05:31:24 +00:00
Nikolay Govorov
5fea1df42b Move Net staff to clean network module 2026-02-25 05:31:19 +00:00
Nikolay Govorov
a041162b32 Merge pull request #1649 from ireydiak/fix/cdp-json-version-trailing-slash
fix: handle trailing slash on /json/version CDP endpoint
2026-02-25 05:20:33 +00:00
Nikolay Govorov
32cd3981d8 Update libcurl version, use build based on config file 2026-02-25 05:05:00 +00:00
Nikolay Govorov
ca5af87196 Build C libs in isolated modules 2026-02-25 05:04:58 +00:00
Nikolay Govorov
a8164f612f Use zig package manager instead of submodules 2026-02-25 05:04:57 +00:00
ireydiak
d3bb0b6ff0 fix: handle trailing slash on /json/version CDP endpoint
Some CDP clients (e.g. playwright-go) request /json/version/ with a
trailing
slash. Added handling for this variant to match the exact same behavior
as /json/version
2026-02-24 22:23:11 -05:00
Karl Seguin
0ef10c1e13 fix event leak on dispatchEvent 2026-02-25 09:36:13 +08:00
Karl Seguin
4017911373 Merge pull request #1643 from lightpanda-io/nikneym/invalid-timer-test
Add a test for invalid timer/timer-like remove
2026-02-25 09:00:53 +08:00
Karl Seguin
048034d4b1 Merge pull request #1645 from lightpanda-io/fix-empty-struct
fix: add _pad to IdleDeadline to avoid identity_map pointer aliasing
2026-02-25 08:58:58 +08:00
Karl Seguin
fcb3f08bcb Add url encoding option to URL.resolve
Given:

a.href = "over 9000!"

Then:

a.href === BASE_URL + '/over%209000!';

This commits adds an escape: bool option to URL.resolve which will escape the
path, query and fragment when true.

Also changes the Anchor, Image, Link and IFrame getSrc to escape. Escaping is
also used when navigating a frame.
2026-02-25 08:17:05 +08:00
Karl Seguin
d2a05bb622 Merge pull request #1642 from lightpanda-io/html-noscript-no-escape
Some checks failed
e2e-test / zig build release (push) Has been cancelled
e2e-test / demo-scripts (push) Has been cancelled
e2e-test / cdp-and-hyperfine-bench (push) Has been cancelled
e2e-test / perf-fmt (push) Has been cancelled
e2e-test / browser fetch (push) Has been cancelled
zig-test / zig test using v8 in debug mode (push) Has been cancelled
zig-test / zig test (push) Has been cancelled
zig-test / perf-fmt (push) Has been cancelled
nightly build / build-linux-x86_64 (push) Has been cancelled
nightly build / build-linux-aarch64 (push) Has been cancelled
nightly build / build-macos-aarch64 (push) Has been cancelled
nightly build / build-macos-x86_64 (push) Has been cancelled
wpt / web platform tests json output (push) Has been cancelled
wpt / perf-fmt (push) Has been cancelled
e2e-integration-test / zig build release (push) Has been cancelled
e2e-integration-test / demo-integration-scripts (push) Has been cancelled
don't escape noscript content on html dump
2026-02-25 07:31:26 +08:00
Karl Seguin
f7254ee169 Merge pull request #1641 from lightpanda-io/contexts_no_realloc
Store Env.Contexts in an [fixed-length] array.
2026-02-25 07:30:42 +08:00
Pierre Tachoire
a0e5c9d570 add padding field for some other webapi 2026-02-24 21:36:38 +01:00
Pierre Tachoire
8291e4ba73 fix: add _pad to IdleDeadline to avoid identity_map pointer aliasing 2026-02-24 21:31:41 +01:00
Pierre Tachoire
b324be3b0b Merge pull request #1638 from lightpanda-io/performance-mark-name
accept more performance mark name and return dummy 0
2026-02-24 19:15:04 +01:00
Halil Durak
6ba0ba7126 add a test for invalid timer removal
We cover such cases; yet its better to have a test.
2026-02-24 18:25:26 +03:00
Pierre Tachoire
1d8e0629af don't escape noscript content on html dump 2026-02-24 15:22:43 +01:00