Commit Graph
7830 Commits
Author SHA1 Message Date
Halil Durak 7a4e21cc82 Updater: gracefully handle known status codes 2026-07-08 13:00:31 +03:00
Halil Durak 3b73a5e0e7 Updater: free X509_STORE in deinitializer 2026-07-08 13:00:31 +03:00
Halil Durak affd1c279a Updater: refactor Updator for new version check endpoint 2026-07-08 13:00:30 +03:00
Halil Durak cf00ef100c Network: mark createX509Store as pub 2026-07-08 13:00:30 +03:00
Halil Durak 8673fbb489 lp.update -> lp.checkVersion + honor --check in version 2026-07-08 13:00:30 +03:00
Halil Durak d8184dc462 move update command to version --check 2026-07-08 13:00:30 +03:00
Halil Durak be8628f235 update: add help command entry for update 2026-07-08 13:00:29 +03:00
Halil Durak 94239e123b Updater: finalize inform 2026-07-08 13:00:29 +03:00
Halil Durak 32fefeaa7a update: remove nightly channel check 2026-07-08 13:00:29 +03:00
Halil Durak 4c62337cfa Updater: prefer JSON structures specific to update channel 2026-07-08 13:00:29 +03:00
Halil Durak 6acb58eff4 Updater: continue on implementing Updater.inform 2026-07-08 13:00:28 +03:00
Halil Durak bbd53e4d83 Updater: prefer arbitrary JSON union for parsing versions.json 2026-07-08 13:00:28 +03:00
Halil Durak 7bea3319e8 Updater: update versions.json URL 2026-07-08 13:00:28 +03:00
Halil Durak 6919400c42 add update command and make it runnable in main 2026-07-08 13:00:28 +03:00
Halil Durak a716279e30 Updater: introduce Updater
Updater is a simple interface that does web requests for version comparison without needing `App` instance.
2026-07-08 13:00:27 +03:00
Halil Durak 03c51052b0 Config: add update command 2026-07-08 13:00:27 +03:00
Halil Durak b97ca18dcb Network: mark globalInit and globalDeinit as pub 2026-07-08 13:00:24 +03:00
Karl Seguin cc7d319ea5 Merge pull request #2874 from lightpanda-io/agent-regression
Add agent regression suite to CI (consumed from lightpanda-io/demo)
2026-07-08 09:19:00 +08:00
Karl Seguin 789929ba1e Merge pull request #2895 from lightpanda-io/lazy_loading_iframes
perf: Iframes with loading=lazy don't delay parent's "load" event
2026-07-08 08:51:21 +08:00
Karl Seguin 62edeb506a Merge pull request #2897 from lightpanda-io/v8_max_memory
v8, mem: Add v8 configuration option + heap limit protection
2026-07-08 08:33:07 +08:00
Adrià Arrufat f3f731ffb1 fix: setChecked double-toggled checkables via click activation
actions.setChecked set the input state and then dispatched a trusted
click, but the click's activation behavior (EventManager's
ActivationState) toggles a checkbox on every click dispatch — undoing
the state just set — and its commit path fires input/change, which
setChecked then fired a second time. Checkboxes always landed in the
opposite of the requested state with doubled events; radios only
appeared to work because radio activation always checks. It survived
because existing tests asserted the tool's report string, never the
resulting DOM state.

setChecked is now a no-op when the state already matches, otherwise it
performs the click (reusing actions.click) and verifies the state
landed — erroring before the click for radio+false (a click can never
uncheck a radio, and the click has observable page side effects) and
after it when a listener preventDefault()ed the toggle.

Caught by the checked.js golden in the demo agent regression suite.
The Runtime test now asserts DOM state and idempotency instead of
trusting the report string.
2026-07-07 15:43:28 +02:00
Karl Seguin 4253bd852d update v8 dep 2026-07-07 20:41:12 +08:00
Adrià Arrufat 52a8779f2a Merge branch 'main' into agent-regression 2026-07-07 11:43:12 +02:00
Karl Seguin 7184c45ee6 improve variables/comments 2026-07-07 17:14:48 +08:00
Karl Seguin 03f542006d v8, mem: Add v8 configuration option + heap limit protection
The main addition in this commit is that we hook into the Isolate's
AddNearHeapLimitCallback callback and try to force the isolate to shutdown
rather than letting v8 hit an OOM which would take down the entire process.

In support of this, we now support a `--v8-max-heap-mb` command line option to
set an explicit heap limit. As a simple way to test this feature, load a
relatively heavy JS page with `--v8-max-heap-mb 1`.

There's also a `--v8-flags-unsafe` which is a mechanism to pass arbitrary
flags to v8 via its `SetFlagsFromString`. The parameter is called `unsafe`
because some [of the many] configurable flags could conflict with how the
snapshot is built and result in crashes. The snapshot creator also gains a
`--v8-flags-unsafe` flag, so advance users COULD create their snapshot and
run lightpanda with the same set of flags.
2026-07-07 12:40:23 +08:00
Karl Seguin 032cbc3846 perf: Iframes with loading=lazy don't delay parent's "load" event
When an iframe has "loading=lazy" it no longer delays the parent's "load" event.
It's still loaded (subject to `--disable-subframes` parameter).

Many sites use loading=lazy for non-critical content (e.g. ads). On Chrome/
Firefox, these are only loaded when they're in the viewport, so sites usually
can't depend/rely on them being loaded.
2026-07-07 11:17:36 +08:00
Karl Seguin c1dfb09f04 Merge pull request #2883 from lightpanda-io/response-static
webapi: Add static Response.json, Response.error and Response.redirect
2026-07-07 07:19:19 +08:00
Karl Seguin 2b1f7f78ad Merge pull request #2881 from lightpanda-io/DOMPoint
webapi: Add DOMPoint and DOMPointReadOnly
2026-07-07 07:17:23 +08:00
Karl Seguin 9621f5edf7 Merge pull request #2890 from lightpanda-io/domexception
minor: remove DOMException WebAPI flag (make it always on).
2026-07-07 07:17:09 +08:00
Karl Seguin 4a31784901 Merge pull request #2893 from lightpanda-io/replaceable
webapi: more (and better) replaceable proeprties.
2026-07-07 07:16:52 +08:00
Pierre Tachoire 6982ff95f0 Merge pull request #2894 from lightpanda-io/nested_timer_protection
perf, mem, uaf: Enforce minimum timer delay on nested timers
2026-07-06 16:52:28 +02:00
Pierre Tachoire b1458da04c Merge pull request #2892 from lightpanda-io/getComputedStyle-width-height
fix, render: CSS getPropertyValue special width/height handling
2026-07-06 16:49:26 +02:00
Karl Seguin 0067fe8996 Merge pull request #2884 from lightpanda-io/goto_error_path_isolate
script: reject failed goto starts outside the browser isolate
2026-07-06 22:31:57 +08:00
Karl Seguin fd8ee52e1f perf, mem, uaf: Enforce minimum timer delay on nested timers
Per spec, nested timers eventually (5-level deeps) enforce a minimum timeout
(4ms).

This commit also fixes 2 UAFs in module loading where a map entry would become
invalid through nested mutations.

All issues were encountered on https://111skin.com/.
2026-07-06 22:05:12 +08:00
Karl Seguin 3d92b2d01a webapi: more (and better) replaceable proeprties.
Window.event, screen, visualViewport and crypto are all [Replaceble]. This
should be all the one's we're missing.

Also, apply the repleceable on the correct v8 global's context in the case where
a caller reaches into an iframe to replace a property on the iframe's window.

Fixes endless loop on https://100500dobavok.ua/ which replaces window.event.
2026-07-06 19:06:36 +08:00
Karl Seguin 38b008976d fix, render: CSS getPropertyValue special width/height handling
When CSSStyleDeclaration.getPropertyValue is called for width or height, and the
inline style isn't found, return the elements actual width/height. Without this
we return "" which is wrong and can cause script error/hangs.
2026-07-06 18:18:46 +08:00
Karl Seguin ea4f2ed5c8 Merge pull request #2882 from lightpanda-io/cleanup-help
minor: standardize help options
2026-07-06 17:48:54 +08:00
Karl Seguin c31a5fd243 minor: remove DOMException WebAPI flag (make it always on).
This change touches a lot of files, but it's pretty minor. Most files simply
have .dom_exception = true  removed from their WebAPI binding.

The only reason NOT to have this on is in the case where a Zig function returns
an error that incorrectly gets mapped to a DOMException. But this hasn't
happened yet, none of the base errors (e.g. OutOfMemory) map to a DOMException,
but the opposite DOES happen: we don't flag an API as dom_exception = true that
we should.
2026-07-06 14:37:20 +08:00
Karl Seguin 9f791498ae Merge pull request #2866 from lightpanda-io/nikneym/linux-bsd-cert-loading
networking: faster certificate loading for Linux and BSDs
2026-07-06 09:57:45 +08:00
Halil Durak 90387b401d Network: check if cert store is empty 2026-07-05 11:40:39 +03:00
Karl Seguin e71cd94582 Merge pull request #2886 from lightpanda-io/loader_feature_detect
webapi: implement HTMLScriptElement.supports and DOMTokenList.supports
2026-07-05 08:02:59 +08:00
Karl Seguin 83c412765c call_arena -> local_arena 2026-07-05 07:49:07 +08:00
Adrià Arrufat 3dcbb46834 webapi: implement HTMLScriptElement.supports and DOMTokenList.supports
Module loaders (Vite legacy plugin, Shopify themes) feature-detect
HTMLScriptElement.supports("module") and
link.relList.supports("modulepreload"). Both were missing, so themes
fell back to fetch()-based legacy chunk loading: on allbirds.com that
meant 676 requests instead of 305 for two page loads, the same module
fetched 9x per page by page JS, and a ~4% CDP driver flake from the
legacy path replacing the document mid-query (0/50 repro with this
change, vs failing within 3 iterations without).

HTMLScriptElement.supports returns true for the types this engine
loads (classic, module, importmap). DOMTokenList.supports implements
the rel supported-tokens set and throws TypeError for attributes that
define none, per spec.
2026-07-04 20:27:26 +02:00
Adrià Arrufat 985e7ded06 script: reject failed goto starts outside the browser isolate
startGoto runs under the browser's isolate; its error path rejected the
script-isolate resolver via a `return` inside that block, i.e. before
the deferred isolate exit — v8::Exception::Error on the wrong isolate,
SIGSEGV. Reached by any goto that fails to start: page.goto(null) (an
extract miss flowing into goto), malformed arguments.

Yield null from the isolate block and settle the resolver after it.
2026-07-04 15:25:21 +02:00
Adrià Arrufat 1c9acfa6bc Merge pull request #2878 from lightpanda-io/agent-vertex
agent: add Google Vertex AI support
2026-07-04 12:10:32 +02:00
Halil Durak a2fae6b0eb Network: remove check for 0-sized bundle buffer 2026-07-04 12:19:10 +03:00
Halil Durak c192303bf7 Network: faster cert store creation on Linux and BSDs
There was a `TODO` comment about this; nicer to actually have it. There's still stdlib's certificate bundle scanner for platforms we can't do this (like macOS).
2026-07-04 12:19:10 +03:00
Halil Durak c967469c49 libcrypto: bind X509_STORE_load_locations 2026-07-04 12:19:09 +03:00
Karl Seguin c204623755 webapi: Add static Response.json, Response.error and Response.redirect 2026-07-04 16:28:50 +08:00
Karl Seguin 37033003dd Merge pull request #2867 from lightpanda-io/nikneym/curl-easy-setopt-refactor
`libcurl`: refactor `curl_easy_setopt`
2026-07-04 15:43:26 +08:00