Commit Graph

5502 Commits

Author SHA1 Message Date
Pierre Tachoire
bd4e88cec8 ci: typo fix 2026-04-10 10:13:27 +02:00
Pierre Tachoire
90069f6ab8 ci: use a dedicated action for v8 snapshot 2026-04-10 10:13:27 +02:00
Pierre Tachoire
ca78bd7786 ci: invalidate snapshot cache on src/browser/js/Snapshot.zig 2026-04-10 09:52:43 +02:00
Pierre Tachoire
075a660b2f ci: use cache for snapshots
Add a cache for v8 snapshot file.
Use a cache key for v8 snapshot with the last hash changing
src/browser/js/bridge.zig
eg. v8-snapshot-4dcb2c997e01e4367ca6118629fb4ac712f9692c
2026-04-10 09:26:32 +02:00
Pierre Tachoire
a4617390de Merge pull request #2104 from lightpanda-io/feat/add-ip-filter
Feat/add ip filter
2026-04-10 08:46:06 +02:00
Karl Seguin
0b6f099f43 Merge pull request #2117 from lightpanda-io/startup_order_tweak
Initialize snapshot before network
2026-04-10 08:30:54 +08:00
Karl Seguin
101107d63c Merge pull request #2115 from lightpanda-io/gc-v8
move memoryPressureNotification call on session.resetPage
2026-04-10 08:14:27 +08:00
Pierre Tachoire
91e366cb71 move memoryPressureNotification call on session.resetPage
Run V8 GC with memoryPressureNotification directly into
session.resetPage to be sure to save free right after resources are
removed.
2026-04-10 08:12:51 +08:00
Karl Seguin
2e8a7e59c4 Merge pull request #2105 from lightpanda-io/no-context-handling
Better handle v8 callback with no valid context
2026-04-10 08:11:36 +08:00
Karl Seguin
e8fbaeb2d9 Initialize snapshot before network
When the snapshot isn't baked-into the binary, it requires more memory to
initialize and load. By changing the initializing order from: network, isolate,
snapshot to: isolate, snapshot, network we can reduce the peak startup memory.
This is because the short-live snapshot intermediary data and the long-lived
network data (certs) no longer overlap.
2026-04-10 07:08:13 +08:00
Karl Seguin
96736d440d Merge pull request #2112 from lightpanda-io/reduce_telemetry_size
Reduces the size of Telemetry.Lightpanda
2026-04-10 07:07:55 +08:00
Karl Seguin
26253874de Merge pull request #2111 from lightpanda-io/typos
Fix a lot of typos.
2026-04-10 07:07:43 +08:00
Karl Seguin
cec9628e37 zig fmt 2026-04-10 06:51:50 +08:00
Karl Seguin
255fa247c3 Reduces the size of Telemetry.Lightpanda
32920 -> 8344

We buffer [1024]Telemetry.Event, and the event is unnecessarily large.
2026-04-10 06:51:50 +08:00
Karl Seguin
8eaeafe16c Fix a lot of typos.
I used https://github.com/crate-ci/typos, it worked well.

Also, make sure cdp-initiated KeyboardEvent is freed when no element is in focus
2026-04-10 06:51:10 +08:00
Karl Seguin
4dcb2c997e Better handle v8 callback with no valid context
In https://github.com/lightpanda-io/browser/pull/1885 we added fallback to the
incumbent context when the current context had be released (by us, but not by
v8).

This now handles the case where there is no incumbent context. It's not clear
exactly why this can happen, but we do see it in some WPT tests (e.g.
/html/browsers/the-window-object/named-access-on-the-window-object/navigated-named-objects.window.html)
2026-04-10 06:50:47 +08:00
Karl Seguin
a9e7d75272 Merge pull request #2120 from lightpanda-io/memory_test3
run e2e-test with pre-generated snapshot
2026-04-10 06:47:35 +08:00
Karl Seguin
5c7a665d11 run e2e-test with pre-generated snapshot 2026-04-09 18:54:31 +08:00
Pierre Tachoire
afbad07f0f Merge pull request #2114 from lightpanda-io/update-README
Update readme
2026-04-09 11:03:43 +02:00
Pierre Tachoire
9eba3c1463 Merge pull request #2113 from lightpanda-io/add-ip-filters-2
Improvements to IpFilters
2026-04-09 11:01:31 +02:00
Pierre Tachoire
0905306c79 Add skill link in README 2026-04-09 10:57:25 +02:00
Pierre Tachoire
cb3cc9cd8c update benchmark 2026-04-09 10:56:08 +02:00
Pierre Tachoire
2d2b1584cf update contribution and why section 2026-04-09 10:56:08 +02:00
Pierre Tachoire
d1883ad211 cleanup README, add MCP 2026-04-09 09:56:39 +02:00
Karl Seguin
0253092f20 Improvements to IpFilters
The main change is changing how CidrV4 and CidrV6 are stored, by pre-calculating
their mask and storing their address as integer.

This allows significant simplification of matchesCidrV4 and matchesCidrV6.
2026-04-09 15:40:16 +08:00
Karl Seguin
689fb908ac Merge pull request #2110 from lightpanda-io/test-cache-filter
cache: add log filter to garbage file test
2026-04-09 07:55:07 +08:00
Karl Seguin
795b0affe2 Merge pull request #2102 from lightpanda-io/non-utf8-encoding
Use encoding_rs on non-UTF-8 html to convert to utf-8
2026-04-09 07:25:48 +08:00
Adrià Arrufat
182447c907 cache: add log filter to garbage file test 2026-04-08 19:36:29 +02:00
Pierre Tachoire
6ef518438b fix custom cidrs mem leak 2026-04-08 15:09:01 +02:00
Pierre Tachoire
e57b5c645b remove deadcode libcurl.CurlOpenSocketFunction 2026-04-08 14:06:17 +02:00
Karl Seguin
077b8b1481 Merge pull request #2106 from lightpanda-io/simplify_nodelist_foreach
Simplifies NodeList.foreach
2026-04-08 19:51:15 +08:00
Pierre Tachoire
9915f0f19d Merge pull request #2100 from lightpanda-io/osc/2029-user-agent-override
Allow user agent override with restrictions
2026-04-08 13:20:32 +02:00
Karl Seguin
077263bae4 Simplifies NodeList.foreach
Removes 2 layers of indirection (including 1 allocation) that is unnecessary for
an internal call.
2026-04-08 18:32:47 +08:00
Karl Seguin
763927c352 Use encoding_rs on non-UTF-8 html to convert to utf-8
Using our existing MIME type detection, this uses encoding_rs to convert non-
UTF-8 content to UTF-8, which can then be passed to html5ever.

Issue: https://github.com/lightpanda-io/browser/issues/2089
2026-04-08 18:32:08 +08:00
Pierre Tachoire
f884b562ba user-agent ovveride must not contain mozilla 2026-04-08 12:11:09 +02:00
Pierre Tachoire
efb2fa9c22 Send Sec-Ch-Ua http header 2026-04-08 12:11:09 +02:00
Pierre Tachoire
ae9b4d3fc6 stricter user-agent rule 2026-04-08 12:11:09 +02:00
Trevin Chow
f0aacad52e feat: add --user-agent flag for full User-Agent override
When --user-agent is set, the provided string replaces the entire
User-Agent header instead of appending to "Lightpanda/1.0".
The existing --user-agent-suffix behavior is unchanged.

Fixes #2029
2026-04-08 12:11:08 +02:00
Lucien Coffe
7f5abfc9cf fix: use dashes in CLI flag names for consistency
Rename --block_private_networks to --block-private-networks and
--block_cidrs to --block-cidrs to match the existing flag naming
convention (e.g. --http-proxy, --proxy-bearer-token).
2026-04-08 12:10:46 +02:00
Lucien Coffe
fb6c4e4978 feat: add allow-list exclusions to --block_cidrs
CIDRs prefixed with '-' are treated as allow rules that exempt matching
IPs from blocking. Allow rules take precedence over both
--block_private_networks and custom block CIDRs.

Example: --block_private_networks --block_cidrs -10.0.0.42/32
blocks all private ranges except 10.0.0.42.

Adds 3 new tests for allow-list behavior.
2026-04-08 12:10:46 +02:00
Lucien Coffe
f5cfc4d315 feat: add --block_private_networks and --block_cidrs CLI flags
Block outbound HTTP requests to specified IP ranges before TCP handshake
using libcurl CURLOPT_OPENSOCKETFUNCTION callback. Fires after DNS
resolution, reads resolved IP directly from sockaddr, does bitwise CIDR
comparison. Fail-closed: unknown address families are blocked.

--block_private_networks blocks RFC1918, localhost, link-local, ULA.
--block_cidrs blocks additional comma-separated CIDRs.
IPv4-mapped IPv6 (::ffff:x.x.x.x) is unwrapped to prevent bypass.
2026-04-08 12:10:42 +02:00
Pierre Tachoire
16685019d4 Merge pull request #2107 from lightpanda-io/bump-v8
update zig-v8 deps
2026-04-08 12:10:15 +02:00
Pierre Tachoire
cffb6976a4 update zig-v8 deps 2026-04-08 11:41:08 +02:00
Pierre Tachoire
1a285cc9ea Merge pull request #2099 from lightpanda-io/finalizer_order
Clear identity before forcing finalizers
2026-04-07 18:09:31 +02:00
Karl Seguin
def713db15 Clear identity before forcing finalizers
We need to remove v8 finalizer callbacks upfront so that, as we tear things down
there's no chance for v8 to try to finalize something which has already been
finalized or is gone.
2026-04-07 21:51:38 +08:00
Adrià Arrufat
67918f004b Merge pull request #2097 from lightpanda-io/simplify-cli-args
Config: remove mcp version flag and simplify usage
2026-04-07 14:41:56 +02:00
Adrià Arrufat
afd6c11b34 Config: remove mcp version flag and simplify usage 2026-04-07 12:24:19 +02:00
Karl Seguin
38e3b59ddb Merge pull request #2095 from lightpanda-io/fix_mo_record_release
Don't release pending MutationObserver records
2026-04-07 15:46:00 +08:00
Pierre Tachoire
8b8c659507 Merge pull request #2094 from lightpanda-io/readme-docker
README: expose browser on localhost w/ docker
2026-04-07 09:27:33 +02:00
Karl Seguin
6491ab84ea Don't release pending MutationObserver records
These have not been handed to v8 yet (hence the pending) and can be freed
directly. This is correctly handled in IntersectionObserver.
2026-04-07 15:23:30 +08:00