Commit Graph
268 Commits
Author SHA1 Message Date
ldm0 9464659788 refactor(server): route browser shutdown through instance control
Expose protocol-independent InstanceCommand and BrowserInstanceControl with a
native serve_with_control entry. Keep shutdown coordination in the server and
CDP session validation and response flush in a dedicated adapter, bypassing
renderer work without creating another actor or shutdown state.

Parse each CDP envelope once and check live frontend-owned session routes
through a weak registry view. Match Chromium Browser.close on browser, page,
tab, and worker sessions; ignore params and reject null or foreign session IDs.
Update optional-session test requests to omit absent routes.

Add native and pending-promise lifecycle regressions and cross-engine smoke
coverage for acknowledgment ordering, natural process exit, and isolation.
2026-10-20 20:47:16 +08:00
ldm0 1bfa5ce0cb fix(cdp): match Chromium intercepted response body encoding 2026-10-20 03:06:51 +08:00
ldm0 d75c82c30a perf(fetch): share immutable request bodies with Bytes 2026-10-19 11:22:56 +08:00
ldm0 258bb29ba2 fix(fetch): preserve worker continuation upload bytes 2026-10-19 05:27:10 +08:00
ldm0 dbeb411f4e fix(fetch): preserve intercepted binary request bodies 2026-10-19 05:27:10 +08:00
ldm0 ca22988ad7 fix(navigator): freeze and cache languages per realm 2026-10-18 05:51:05 +08:00
ldm0 deb111966a refactor(cdp): consolidate optional owner Page access 2026-10-16 21:21:28 +08:00
ldm0 6c0e8caebc fix(cdp): complete Fetch configuration updates during navigation 2026-10-16 19:26:39 +08:00
ldm0 9ee1fdf27f refactor(renderer): remove legacy print screenshot entry point 2026-10-16 17:48:09 +08:00
ldm0 581c58d06c test(protocol): run timer navigation setup on its local lane 2026-10-15 18:15:54 +08:00
ldm0 6f0e9631ef fix(fetch): bound authentication retries per logical request 2026-10-14 15:59:24 +08:00
jfarcand 6d1496a149 refactor(storage): report cookie priority through effective_priority 2026-10-14 01:05:10 +08:00
jfarcand 32ca66995f fix(storage): always report CDP cookie priority
CDP's Network.Cookie declares `priority` as a required field, and Chrome
always emits it: a cookie set without a Priority attribute reports
Chromium's default, `Medium`. Moli omitted the field in that case, so
clients that deserialize cookies strictly reject every such cookie.
chromiumoxide (0.9), for one, fails Network.getCookies / Storage.getCookies
with "missing field `priority`".

Report `Medium` when the stored cookie carries no priority, and pin it
with a Storage.getCookies regression test.
2026-10-14 01:05:10 +08:00
ldm0 53d16780d5 feat(pdf): render searchable PDFs with Krilla
Route CDP Page.printToPDF and CLI PDF dumps through an owned snapshot PDF
backend with embedded subset fonts and logical text cluster mappings.

Preserve print layout isolation, page selection, and bounded local raster
fallbacks. Pin Krilla to upstream Git and share its font parsing dependencies
with the existing rendering stack where version constraints allow.

Add PDF extraction, pagination, graphics, and print lifecycle regressions,
fixed font fixtures, and reader and CDP smoke checks.

Refs #279.
2026-10-12 21:33:26 +08:00
ldm0 5d2295c86c refactor(browser): preserve typed permission and download errors 2026-10-12 02:11:12 +08:00
ldm0 2187555959 fix(runtime): defer child-frame evaluation through the Inspector owner
Extracted from wpt-misc-fix.

Source-commit: 2ff2732b61
2026-10-12 01:02:29 +08:00
ldm0 d7c8967f1d fix(browser): preserve permission replies when page owners retire
Extracted from wpt-misc-fix.

Source-commit: b34d515d88
2026-10-12 00:26:31 +08:00
ldm0 cfc97efe51 fix(fetch): preserve received HTTP status text
Carry received HTTP reason phrases from the parser through buffered and streaming responses, disk and memory caches, page responses, Fetch, and XHR. Preserve custom and empty HTTP/1 phrases and report empty text for HTTP/2 and HTTP/3. Synthesized responses retain canonical fallback. Regressions cover whitespace, non-ASCII bytes, and cache round trips.
2026-10-11 21:19:08 +08:00
ldm0 876de3b64a fix(window): queue initial javascript URLs on the target page
Validation on this branch: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings.
Nextest and WPT reruns omitted at the user's request.
2026-10-11 21:06:06 +08:00
ldm0 fd2ed360cc fix(accessibility): preserve NBSP in accessible names 2026-10-11 17:34:34 +08:00
ldm0 07c09b138e fix(webdriver): scope dialog load waits to the target page
Query dialogs on the addressed Page when waiting for navigation lifecycle milestones. Allow independent page load completions to advance while another page has a blocked load.

Cover normal and eager navigation with gated two-window regressions, eager recovery after accepting an alert, and dialog ownership across DevTools attachments.
2026-10-11 06:48:09 +08:00
ldm0 60ad884d00 fix(runtime): preserve active bindings on disable 2026-10-10 17:51:54 +08:00
ldm0 0b11db6cd2 fix(runtime): order binding mutations with subscription delivery
A delayed addBinding adapter could repersist and reapply bindings after a
later Runtime.disable had cleared them. Commit persistent add/remove
mutations in the renderer turn and project their frozen state with the
NativeTerminal, alongside enable/disable. Adapter completion no longer
writes a stale binding snapshot back to either owner.

Unregister V8 bindings during disable as well as clearing restore metadata,
so re-enabling cannot reactivate a removed binding. Include the retained
binding output and metadata in transport memory accounting.

Cover delayed addBinding, unpolled and reversed binding completions, and
binding calls after re-enabling. Document and test the existing committed
SessionSink disable success policy after owner retirement, including
ordered delivery and no duplicate terminal on late adapter completion.
2026-10-10 17:51:54 +08:00
ldm0 8d58d0fd59 fix(runtime): unify turn output and Runtime subscription delivery
Append ready command records directly to the Page journal and publish them
at the common owner-turn settlement boundary. Replace continuation-owned
record batches with exact cursors for internal completion dependencies.

Publish loaded-page frontend Runtime.enable/disable, frozen Inspector output,
and session updates through NativeTerminal. Apply subscriptions and replay
at ordered ingress so delayed adapters cannot reverse newer enable/disable
state. Complete disable binding updates in the originating renderer turn.
Retain exact predecessors for internal/collector completion success and
projection errors, and charge replay/V8 state to the transport memory budget.

Cover unpolled and reversed completions, cancellation after publication,
owner retirement, unresolved Promise output and concurrent ready replies,
and navigation handoff with controlled regression tests.
2026-10-10 17:51:54 +08:00
ldm0 4997e6d0d3 fix(accessibility): project computed visibility and composed names 2026-10-10 11:53:21 +08:00
ldm0 37e8bf746c fix(accessibility): include shadow controls in AX snapshots 2026-10-10 11:53:21 +08:00
ldm0 66e7c693fe fix(navigation): keep ignored response metadata on terminal gate 2026-10-08 21:42:07 +08:00
ldm0 f32553ed04 fix: clarify renderer exports and preserve allocation-free error handoffs 2026-10-08 19:56:33 +08:00
ldm0 c31404d801 refactor: use stable atomic updates and fixed-size slice chunks 2026-10-08 19:56:33 +08:00
ldm0 d63da2d76c fix(accessibility): resolve AX object IDs in their owning session 2026-10-08 19:33:01 +08:00
ldm0 00e18d6aef build(deps): update indexmap to 2.14.2 2026-10-07 18:23:02 +08:00
ldm0 0f2892533f fix(cdp): bound renderer navigation future stack usage 2026-10-07 17:53:16 +08:00
ldm0 e790a88a66 test(target): heap-allocate background navigation fixtures 2026-10-06 01:46:40 +08:00
ldm0 91aec378a4 refactor(cdp): search resource content on the renderer owner
Native CDP replies can expose resources before the protocol adapter consumes
its Page snapshot. Resolve, decode, and search sources in one renderer command
instead of refreshing a snapshot and selecting cached content in the adapter.

Pass the immutable main response body by committed loader and preserve frame
matching, decoding, byte limits, and the attachment check before settlement.
Require a single renderer turn in the held-native-publication regression.
2026-10-06 01:01:03 +08:00
ldm0 70b4b1eb15 fix(cdp): refresh resource sources before searching
Native Page replies can reach the frontend before the adapter updates the cached resource report. Capture a current renderer snapshot before selecting root frame subresources and reject completions from replaced renderer attachments.

Add regressions for resource searches before native adapter settlement and for navigation before consuming a resource snapshot.
2026-10-06 01:01:03 +08:00
ldm0 30e36e64a3 fix(cdp): preserve auxiliary Page ownership through document navigation
Create script auxiliary Pages synchronously and let their CDP targets adopt
those exact Pages. Preserve Page and WindowProxy identity through document
navigation, sharing browsing-context names, opener references, message endpoints
and close state with related windows.

Commit browser responses into the existing Page with exact document admission,
cancellation and failure disposition. Capture accepted navigation origin, base,
policy, storage and referrer, preserve auxiliary history and restore related
browsing-context groups without issuing duplicate popup requests.

Reuse the initial same-origin Window while replacing its Document, and centralize
Document owner transitions, descendant retirement and Inspector publication.
Give related Pages independent Inspector routes and shared per-Page startup
pause state, route isolate foreground work through surviving Pages, and cache
cross-origin Window functions in each accessing realm with receiver-aware access.

Cover actual popup state, navigation and parser rebinding, accepted environments,
history, cross-origin access, multiple frontends, cancellation and task retirement.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast.
2026-10-06 01:01:03 +08:00
ldm0 f1c5bf6618 fix(cdp): separate browser window selection from document activity
Track each window's selected tab and browser focus independently of protocol
page routing. Keep window bounds, adjacent-tab close selection, discovery and
target metadata consistent with their owning windows and documents.

Queue renderer activity updates outside the CDP actor, preserve their output
fences and remember admitted activity so focus reversals survive a busy page.
Cover window selection, focus-event state and busy-context activation.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast.
2026-10-06 01:01:03 +08:00
ldm0 c345a594f4 feat(webmcp): implement document tools and CDP integration
Expose secure Document.modelContext APIs with document-owned registrations,
callback realm and input validation, task-based result delivery, and independent
caller cancellation and target completion. Preserve cancellation reasons and
emit lifecycle events only for live owners.

Register native declarative forms in light and shadow trees through indexed
mutation candidates. Track schema changes to valid forms even before a
registration succeeds, including controls associated through a form attribute.
Use changed containers only for ancestor and form-owner checks; inspect added
and removed subtrees for discovery. Retire registrations at actual removal and
owner transitions while preserving submit handling and captured pending responses. Apply validated
fill intents to current options and checkable values in control event order.

Compute tools delegation from committed security origins, ancestor header
allowlists, container declarations, redirects, and combined sandbox policies.
Carry invocation identity, original origin, and resolved target through form
navigation; accept same-origin JSON-LD results and reject cross-origin commits.

Connect typed renderer observations to CDP discovery, invocation, cancellation,
and Runtime result projection. Include renderer and protocol regression coverage
for document lifetime, reentrancy, permissions, dynamic controls, and cancellation.

Validation on this commit tree: cargo fmt --all;
cargo clippy --workspace --all-targets --all-features -- -D warnings;
cargo nextest run --no-fail-fast.
Summary [ 100.619s] 19320 tests run: 19320 passed, 16 skipped
2026-10-05 15:25:06 +08:00
ldm0 3063134daf test(cdp): enable Runtime before replaying child navigation bindings 2026-10-05 05:20:01 +08:00
ldm0 5b7984973f fix(cdp): abort no-content navigations before document preparation 2026-10-04 15:34:09 +08:00
ldm0 7106a4e4b6 fix(cdp): initialize scrollbar overrides before navigation scripts 2026-10-04 05:20:17 +08:00
ldm0 674a2fd9df refactor(renderer): unify document settings application 2026-10-04 05:20:17 +08:00
ldm0 ff70590d7f refactor(runtime): share document settings snapshots 2026-10-04 05:20:17 +08:00
ldm0 a789da8a0d feat(cdp): support Emulation.setScrollbarsHidden
Apply scrollbar hiding to the live Page before acknowledging the command, preserve the startup flag, and replay the target setting before navigation scripts. Validate the required boolean and layout mode, track per-session state, and clear overrides on detach.

Refs #1081
2026-10-04 05:20:17 +08:00
ldm0 df410aeeb7 feat(layout): add --hide-scrollbars for fetch and serve
Hide native scrollbars and automatic gutters while preserving scrolling and explicit stable gutters. Require layout mode and retain the setting across navigation, frames, and protocol sessions.

Refs #1081
2026-10-04 05:20:17 +08:00
ldm0 32de272640 fix(cdp): keep current renderer notifications live during navigation 2026-10-04 03:12:50 +08:00
ldm0 059cc9d04e test(cdp): wait for fulfilled Fetch body consumption 2026-10-04 02:37:24 +08:00
ldm0 9cbdd35da5 refactor(emulation): apply navigator and activity policy together 2026-10-03 03:30:39 +08:00
ldm0 828658d9d4 refactor(renderer): resolve scoped nodes within owner-only DOM operations 2026-10-03 03:30:39 +08:00
ldm0 330b8c6381 refactor(renderer): resolve scoped nodes within read operations 2026-10-03 03:30:39 +08:00