Karl Seguin
42bb2f3c58
Merge pull request #1823 from lightpanda-io/remove_double_free
...
e2e-test / zig build release (push) Has been cancelled
e2e-test / demo-scripts (push) Has been cancelled
e2e-test / wba-demo-scripts (push) Has been cancelled
e2e-test / wba-test (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 / zig build release (push) Has been cancelled
wpt / build wpt runner (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 frame double-free on navigate error
2026-03-14 19:36:27 +08:00
hobostay
68337a6989
Fix compilation errors: add missing log import and remove duplicate
...
- Add missing `const log = @import("../../log.zig");` in network.zig
- Remove duplicate `log` declaration inside setCdpCookie in storage.zig
(already declared at file scope)
Fixes compilation errors:
- src/cdp/domains/network.zig:124:9: error: use of undeclared identifier 'log'
- src/cdp/domains/storage.zig:135:15: error: local constant shadows declaration of 'log'
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-14 17:32:48 +08:00
sjhddh
a204f40968
fix(dom): return parsererror document on XML parse failure
2026-03-14 08:36:06 +00:00
Karl Seguin
39d5a25258
Merge pull request #1820 from hobostay/fix-tracking-allocator-stats
...
Fix TrackingAllocator reallocation_count being incremented on failed operations
2026-03-14 15:48:13 +08:00
sjhddh
c4176a282f
fix: resolve memory leak in Option.getText() by using page arena
2026-03-14 06:50:26 +00:00
Karl Seguin
1352839472
Remove frame double-free on navigate error
...
The explicit deinit isn't needed as here's already an errdefer in play.
2026-03-14 14:02:58 +08:00
hobostay
099550dddc
Ignore partitionKey in cookie operations to support Puppeteer page.setCookie()
...
Puppeteer's page.setCookie() internally calls Network.deleteCookies twice
before setting a cookie. The second call includes a partitionKey field for
CHIPS (partitioned cookies), which caused Lightpanda to return NotImplemented.
Since Lightpanda doesn't support partitioned cookies, we now silently ignore
the partitionKey parameter and proceed with the cookie operation based on
name/domain/path matching.
This change affects:
- Network.deleteCookies: no longer rejects requests with partitionKey
- Network.setCookie (via setCdpCookie): no longer rejects cookies with partitionKey
Fixes #1818
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-14 13:18:42 +08:00
hobostay
7fe26bc966
Fix TrackingAllocator reallocation_count being incremented on failed operations
...
The reallocation_count counter was being incremented regardless of whether
the resize/remap operations succeeded. This led to inaccurate memory
allocation statistics.
- resize: Only increment when rawResize returns true (success)
- remap: Only increment when rawRemap returns non-null (success)
This fixes the TODO comments that were present in the code.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-14 13:10:11 +08:00
Halil Durak
cc6587d6e5
make body.onload getter/setter alias to window.onload
2026-03-13 18:49:26 +03:00
Halil Durak
8b310ce993
add failing body.onload tests
2026-03-13 17:23:26 +03:00
Karl Seguin
be8ba53263
Merge pull request #1811 from lightpanda-io/script_handling
...
e2e-test / zig build release (push) Has been cancelled
e2e-test / demo-scripts (push) Has been cancelled
e2e-test / wba-demo-scripts (push) Has been cancelled
e2e-test / wba-test (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 / zig build release (push) Has been cancelled
wpt / build wpt runner (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
Better script handling.
2026-03-13 21:40:19 +08:00
Karl Seguin
867745c71d
Tweak CDP startup messages.
...
1 - When Target.setAutoAttach is called, send the `Target.attachedToTarget`
event before sending the response. This matches Chrome's behavior and
it stops playwright from thinking there's no target and making extra calls,
e.g. to Target.attachedToTarget.
2 - Use the same dummy frameId for all startup messages. I'm not sure why we
have STARTUP-P and STARTUP-B. Using the same frame (a) makes more sense to
me (b) doesn't break any existing integration tests, and (c) improves this
scenario: https://github.com/lightpanda-io/browser/issues/1800
2026-03-13 19:07:47 +08:00
Karl Seguin
a1a7919f74
Better script handling.
...
Dynamic scripts have script.async == true by default (we handled this correctly
in the ScriptManager, but we didn't return the right value when .async was
accessed).
Inline scripts only consider direct children, not the entire tree.
Empty inline scripts are executed at a later time if text is inserted into them
2026-03-13 19:05:23 +08:00
Pierre Tachoire
c3de47de90
Merge pull request #1810 from lightpanda-io/fix_cookie_loading
...
Ensure valid cookie isn't interpreted as null
2026-03-13 11:26:24 +01:00
Karl Seguin
07c3aec34f
Ensure valid cookie isn't interpreted as null
...
Use an explicit type when @ptrCast() is assigned to an optional to ensure the
value isn't interpreted as null.
2026-03-13 17:00:59 +08:00
Karl Seguin
bce3e8f7c6
Fix a flaky frame test
...
Loading `sub 1.html` has a side effect - it increments window.top..sub1_count).
So it should be used careful. It was being used in `about_blank_renavigate` as
a placeholder which _should_ not get navigated, but there's no strict guarantee
about when it gets canceled.
2026-03-13 15:39:34 +08:00
Pierre Tachoire
ba9777e754
Merge pull request #1609 from lightpanda-io/web-bot-auth
...
e2e-test / zig build release (push) Has been cancelled
e2e-test / demo-scripts (push) Has been cancelled
e2e-test / wba-demo-scripts (push) Has been cancelled
e2e-test / wba-test (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
Web Bot Auth
2026-03-13 08:31:25 +01:00
Karl Seguin
4f8a6b62b8
Add window.structuredClone
...
Depends on https://github.com/lightpanda-io/zig-v8-fork/pull/156
Uses V8::Serializer and V8::Deserializer which handles built-in types, e.g.
regex. But it doesn't handle Zig types by default. This is something we need
to hook in, using the delegate callbacks. Which we can do after.
Meant to replace https://github.com/lightpanda-io/browser/pull/1785
2026-03-13 07:28:33 +08:00
Karl Seguin
944b672fea
Merge pull request #1792 from lightpanda-io/Canvas_getImageData
...
Add dummy getImageData to canvas
2026-03-13 07:23:05 +08:00
Karl Seguin
b1c54aa92d
Merge pull request #1795 from lightpanda-io/navigate_blob_url
...
Allow navigation from a blob URL.
2026-03-13 07:22:50 +08:00
Pierre Tachoire
51e90f5971
parse cookies on redirection during header callback
...
THe change to handle bot `\n` and `\r\n` for end HTTP headers skip the
cookie parsing in case of redirection.
2026-03-12 18:42:51 +01:00
Muki Kiboigo
8db64772b7
add URL getHost test
2026-03-12 09:04:13 -07:00
Muki Kiboigo
c6c0492c33
fix request authentication with web bot auth
2026-03-12 09:04:13 -07:00
Muki Kiboigo
fca29a8be2
add WebBotAuth unit tests
2026-03-12 09:04:13 -07:00
Muki Kiboigo
d365240f91
fix cli argument for WebBotAuth domain
2026-03-12 09:04:12 -07:00
Muki Kiboigo
1ed61d4783
simplify parsePemPrivateKey
2026-03-12 09:04:12 -07:00
Muki Kiboigo
a1fb11ae33
make pem private key buffers smaller with comments
2026-03-12 09:04:12 -07:00
Muki Kiboigo
9971816711
use transfer arena to sign webbotauth request
2026-03-12 09:04:12 -07:00
Muki Kiboigo
c38d9a3098
auth challenge only on use_proxy
2026-03-12 09:04:12 -07:00
Muki Kiboigo
02198de455
add support for WebBotAuth in Client
2026-03-12 09:04:10 -07:00
Muki Kiboigo
6cd8202310
add WebBotAuth and support for ed25119 to crypto
2026-03-12 09:03:15 -07:00
Muki Kiboigo
4d7b7d1d42
add web bot auth args
2026-03-12 09:03:15 -07:00
Karl Seguin
e4e21f52b5
Allow navigation from a blob URL.
...
These are used a lot in WPT test.
2026-03-12 18:58:10 +08:00
Karl Seguin
880205e874
Add dummy getImageData to canvas
...
Probably doesn't solve many (if any) WPT tests, but it moves them further along.
2026-03-12 17:53:00 +08:00
Karl Seguin
aa246c9e9f
Merge pull request #1788 from lightpanda-io/range_cleanup
...
Add cleanup to Range
2026-03-12 16:45:05 +08:00
Karl Seguin
f1d311d232
Merge pull request #1781 from lightpanda-io/wp/mrdimidium/telemetry-network
...
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
Use global connections poll
2026-03-12 13:46:51 +08:00
Adrià Arrufat
3d6d669a50
testing: add LogFilter utility for scoped log suppression
2026-03-12 13:56:53 +09:00
Nikolay Govorov
c4097e2b7e
remove dead-code
2026-03-12 03:55:48 +00:00
Karl Seguin
619d27c773
Add cleanup to Range
...
In https://github.com/lightpanda-io/browser/pull/1774 we started to track Ranges
in the page in order to correctly make them "live". But, without correct
lifetime, they would continue to be "live" even if out of scope in JS.
This commit adds finalizers to Range via reference counting similar to Events.
It _is_ possible for a Range to outlive its page, so we can't just remove the
range from the Page's _live_range list - the page might not be valid. This
commit gives every page an unique id and the ability to try and get the page
by id from the session. By capturing the page_id at creation-time, a Range
can defensively remove itself from the page's list. If the page is already
gone, then there's no need to do anything.
2026-03-12 10:38:07 +08:00
Karl Seguin
1522c90294
Merge pull request #1787 from lightpanda-io/dummy-filelist
...
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 / zig build release (push) Has been cancelled
wpt / build wpt runner (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
Add FileList Web API stub
2026-03-12 06:37:00 +08:00
Karl Seguin
794e15ce21
Merge pull request #1786 from lightpanda-io/fontfaceset-load
...
FontFaceSet is now an EventTarget
2026-03-12 06:36:22 +08:00
Karl Seguin
34771b835e
Merge pull request #1783 from lightpanda-io/custom_element_dynamic_markup_handling
...
Throw on dynamic markup in custom element callbacks during parsing
2026-03-12 06:27:22 +08:00
Karl Seguin
8df51b232a
Merge pull request #1784 from lightpanda-io/origin_arena
...
Use origin.arena for values that are tied to the origin
2026-03-12 06:26:20 +08:00
Karl Seguin
13b8ce18b2
Merge pull request #1780 from lightpanda-io/anchor_and_form_target
...
Add support for target attribute on anchors and forms
2026-03-12 06:26:08 +08:00
Pierre Tachoire
448386e52b
Add FileList Web API stub
...
Next.js hydration references FileList as a global for feature detection.
Register a minimal stub (length=0, item()→null) so the type exists in
the global scope and the reference check doesn't throw.
2026-03-11 22:31:12 +01:00
Pierre Tachoire
bf07659dd5
FontFaceSet is now an EventTarget
...
Dispatch loading and loaddone events on load() call
2026-03-11 22:18:42 +01:00
Karl Seguin
16dfad0895
Use origin.arena for values that are tied to the origin
...
Of note, the TAO and identity map entry has to use the origin arena, not
the context arena, as those can outlive the context.
2026-03-11 21:55:58 +08:00
Adrià Arrufat
60699229ca
Merge branch 'main' into semantic-tree
2026-03-11 20:52:39 +09:00
Karl Seguin
e1dd26b307
Throw on dynamic markup in custom element callbacks during parsing
...
Custom element callbacks aren't allowed to call document.open/close/write while
parsing.
Fixes WPT crash:
/custom-elements/throw-on-dynamic-markup-insertion-counter-reactions.html
2026-03-11 18:41:06 +08:00
Pierre Tachoire
7d835ef99d
Merge pull request #1778 from lightpanda-io/wp/mrdimidium/libcurl-malloc
...
Use zig allocator for libcurl
2026-03-11 10:13:13 +01:00