Commit Graph

5810 Commits

Author SHA1 Message Date
Karl Seguin
fc636d4e36 Merge pull request #2247 from lightpanda-io/small_fixes
Various small fixes
2026-04-26 08:25:41 +08:00
Karl Seguin
ed5bc09951 Merge pull request #2241 from lightpanda-io/fix/bound-memory-growth-long-waits-main
browser: bound per-tick memory growth on JS-heavy pages
2026-04-25 14:53:10 +08:00
Adrià Arrufat
093555b374 browser: hint v8 gc during long waits
Runner._wait can iterate for the full opts.ms budget (up to 30s in
fetch, longer in agent tool-use loops). V8 was only nudged to GC on
session/page teardown (Browser.deinit, Page.deinit), so a page that
stays alive while running heavy JS accumulates wrappers and
external-ref'd Zig allocations V8 has no reason to drop. Fire
memoryPressureNotification(.moderate) once per second from the wait
loop.
2026-04-25 08:19:49 +02:00
Karl Seguin
8509b112b8 Various small fixes
Extracted from https://github.com/lightpanda-io/browser/pull/2242
2026-04-25 13:22:41 +08:00
Karl Seguin
25cec9bd82 Merge pull request #2233 from lightpanda-io/custom_elements
Custom elements
2026-04-25 10:12:09 +08:00
Karl Seguin
5ec7c660da update v8 dep 2026-04-25 09:51:58 +08:00
Karl Seguin
3cdb7ee91c Merge pull request #2239 from lightpanda-io/test_only_use_after_free
Fix a test-only use-after-free
2026-04-25 07:41:17 +08:00
Karl Seguin
8a08d1b407 Fix a test-only use-after-free
Only surfaced if an individual test was ran. When running multiple tests, the
bucket reuse of the underlying arena hides the issue.
2026-04-24 21:51:50 +08:00
Pierre Tachoire
b2b1302fa2 Merge pull request #2234 from lightpanda-io/empty_redirect_user_after_free
Fix a use-after-free on an empty (and invalid) location
0.2.9
2026-04-24 14:52:07 +02:00
Pierre Tachoire
d2fc963640 Merge pull request #2231 from lightpanda-io/pkg
ci: refacto release workflow and add Arch linux package build
2026-04-24 14:50:55 +02:00
Nikolay Govorov
8b2b5ddff4 Merge pull request #2226 from lightpanda-io/wp/mrdimidium/fix-timeout
Setup timeout via tcp keepalive
2026-04-24 13:21:13 +01:00
Nikolay Govorov
999f57b729 Remove timeout flag 2026-04-24 12:40:25 +01:00
Karl Seguin
87a99749b7 Use TCP_KEEPALIVE instead of TCP_KEEPIDLE on MacOS
See: https://github.com/nginx/nginx/issues/336
2026-04-24 12:40:24 +01:00
Nikolay Govorov
c7d004fefb Setup timeout via tcp keepalive 2026-04-24 12:40:21 +01:00
Adrià Arrufat
46f8fc5a13 Merge pull request #2236 from lightpanda-io/fix/optional-positional-args
cli: allow optional positional arguments in command builder
2026-04-24 13:36:38 +02:00
Pierre Tachoire
5b9c05753c Merge pull request #2232 from lightpanda-io/axtree-nodeid-string 2026-04-24 13:22:37 +02:00
Adrià Arrufat
6a65801527 cli: allow optional positional arguments in command builder 2026-04-24 13:08:40 +02:00
Karl Seguin
7b50dff956 Fix a user-after-free on an empty (and invalid) empty location
Improves WPT: /fetch/api/redirect/redirect-empty-location.any.html
2026-04-24 18:31:45 +08:00
Karl Seguin
957f2d9c92 Merge pull request #2229 from lightpanda-io/wpt_extensions_action
Update WebDriver to use Page
2026-04-24 18:21:57 +08:00
Pierre Tachoire
368bbc75e0 ci: refacto build step into 1 job per os + CPU matrix 2026-04-24 11:43:48 +02:00
Pierre Tachoire
ce541fbc63 ci: add arch linux package generation 2026-04-24 11:43:47 +02:00
Karl Seguin
802ae55cc1 Update WebDriver to use Page
Don't use pre-built snapshot for wpt action (the snapshot needs the WebDriver
added, which is not normally added). Instead, rely on runtime snapshot creation
(this just adds a bit of startup time and peak memory, neither or which should
be an issue for WPT runs).
2026-04-24 17:33:16 +08:00
Karl Seguin
757c70b6db Add adoptedCallback for CustomElements
Fired when elements are moved from one document to another. I don't think this
is really used much, but it helps pass a number of WPT cases.

This required tweaking insertAdjacentHTML as it was creating a full document
and trigger spurious callbacks in the new code. A DocumentFragment is now used
instead.
2026-04-24 17:26:39 +08:00
Pierre Tachoire
f63b8ae004 cdp: AXNodeId is a string per spec
AXNodeId is defined as string in CDP spec.
This this a difference with DOM.NodeId which is an int.

https://chromedevtools.github.io/devtools-protocol/tot/Accessibility/#type-AXNodeId
https://chromedevtools.github.io/devtools-protocol/tot/DOM/#type-NodeId
2026-04-24 11:24:16 +02:00
Pierre Tachoire
9bb6c3ca32 rename nightly.yml into release.yml 2026-04-24 10:59:16 +02:00
Karl Seguin
2c4179f1ad Support direct instantiation of custom element
Support `new MyElement()` syntax to create custom element. The implementation
for this is pretty straightforward, but it depends on:
https://github.com/lightpanda-io/zig-v8-fork/pull/173.

Also modify the `attributeChangedCallback` and pass a missing parameter: the
namespace. Currently, we pass `null`, but this is less likely to cause issues
than not passing anything.
2026-04-24 16:48:24 +08:00
Karl Seguin
3f0cc7a0df Merge pull request #2227 from lightpanda-io/better_errdefer_cleanups
Improve various errdefer flows
2026-04-24 16:37:28 +08:00
Karl Seguin
ae24343dce Merge pull request #2220 from lightpanda-io/performance_observer_functions
Add getEntriesByType and getEntriesByName to PerformanceObserver entr…
2026-04-24 16:35:32 +08:00
Karl Seguin
b15a40adc4 Merge pull request #2224 from lightpanda-io/console_own_properties
Define v8 functions directly on console instance.
2026-04-24 16:34:46 +08:00
Karl Seguin
308a9a8ccd Merge pull request #2230 from lightpanda-io/update_ws_main
Update go run ws/main.go to new go run runner/main.go -serve
2026-04-24 16:08:40 +08:00
Karl Seguin
a9e4ee41e3 Update go run ws/main.go to new go run runner/main.go -serve 2026-04-24 15:56:46 +08:00
Karl Seguin
402981fc55 Improve various errdefer flows
This possibly addresses some release overflows that could happen during various
failures. For example, if Frame.init fails during a navigation event, this will
make sure to remove the frame from the parent list preventing a double-free
on the frame.
2026-04-24 11:04:17 +08:00
Karl Seguin
a18b5deed1 Merge pull request #2222 from lightpanda-io/flaky_test_maybe_fix
try to make a flaky test more robust
2026-04-24 06:50:17 +08:00
Karl Seguin
813c7d2aa0 Merge pull request #2219 from lightpanda-io/unused_imports
Remove unused imports
2026-04-24 06:49:58 +08:00
Nikolay Govorov
bf72f57f65 Merge pull request #2223 from lightpanda-io/wp/mrdimidium/fix-canadaca-problem
Fix canada.ca problem
2026-04-23 14:07:23 +01:00
Karl Seguin
f450bddcc3 Define v8 functions directly on console instance.
functions should be defined directly on the window.console (and window.CSS)
instances. This is necessary for being able to iterate their "own" properties.
businessinsider.com has code that proxies console via such an iterator (through
Object.entries(console)). This commit allows types to declare that they own
their properties (as opposed to the prototype).

Also fixed HTMLDocument.location. This was using Document._location, but that
field wasn't always set. The new code removes the _location field and changes
the getter to get window._location. (Also an issue on businessinsider.com)
2026-04-23 20:16:28 +08:00
Halil Durak
c8d45af112 Merge pull request #2221 from lightpanda-io/cli_default_serve 2026-04-23 14:54:23 +03:00
Nikolay Govorov
c964604c7a Fix canada.ca problem 2026-04-23 12:15:57 +01:00
Karl Seguin
f883084406 try to make a flaky test more robust 2026-04-23 18:08:42 +08:00
Karl Seguin
6ca9208260 Default command 'serve' for backwards compatibility 2026-04-23 17:31:25 +08:00
Karl Seguin
f15561d531 Add getEntriesByType and getEntriesByName to PerformanceObserver entry list
Seen on dropbox.com
2026-04-23 17:25:38 +08:00
Karl Seguin
b6fbf01203 Merge pull request #2218 from lightpanda-io/user_agent_data
Adds navigator.userAgentData
2026-04-23 17:05:31 +08:00
Karl Seguin
859a41ab4e Adds navigator.userAgentData
This API isn't supported by FireFox (yet), so it isn't a huge priority, but I
did notice that its used across many Google properties. It uses the same value
as Sec-Ch-Ua (https://github.com/lightpanda-io/browser/pull/2100) to provide
consistent data.

Smaller changes:
1 - Allow `OffscreenCanvas` to be used with Worker (noticed this error too)
2 - Don't like JS execution errors at "error" level for "load" and
    "DOMContentLoaded". "error" should be reserved for things we can fix and
    should never be triggered from invalid a bug in JavaScript.
2026-04-23 16:24:42 +08:00
Karl Seguin
0a8f4ff75f Remove unused imports
As a general rule, I keep `std` if its there and unused, mostly for debug.print
debugging.
2026-04-23 16:21:56 +08:00
Halil Durak
7aca1732fe Merge pull request #2098 from lightpanda-io/nikneym/cli-parser 2026-04-23 11:17:44 +03:00
Karl Seguin
1c62d90e23 Merge pull request #2211 from lightpanda-io/page_container
Introduce Page (container)
2026-04-23 16:06:18 +08:00
Karl Seguin
4fdf04972e zig fmt 2026-04-23 15:48:15 +08:00
Karl Seguin
550fb58f3f Introduce Page (container)
Follow up to https://github.com/lightpanda-io/browser/pull/2200

This change is actually pretty mundane, but a bunch of files that used to
take a *Session (e.g. every WebAPI releaseRef and deinit) now take a *Page.

This aims to separate the 2 lifetimes currently managed by Session by moving
the "Page" lifetime to a dedicated container: Page. Ultimately, the goal is to
remove the 1-page-per-session limit of the current design. Not to explicitly
support multiple pages per session (though, that's more possible now), but
in order to better emulate Chrome where, during a navigation event, the old and
new page both exist.
2026-04-23 15:48:13 +08:00
Karl Seguin
553b32b3b8 Merge pull request #2217 from lightpanda-io/css_insert_rule_index_clamp
Clamp insert index
2026-04-23 15:39:16 +08:00
Karl Seguin
3d052794d5 Merge pull request #2216 from lightpanda-io/cdp_audit_placeholder
Add placeholder handlers for Audit enable/disable CDP methods
2026-04-23 15:39:01 +08:00