Forward lossless CDP wire messages through native ownership workflows. Preserve exact earlier console output before terminal replies, and let old Inspector commands receive context-destruction results before their response routes retire.
Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast. Checks cover the integrated workspace with 32-way concurrency and no automatic retries.
Cache canonical object-store and index wrappers in their owner realms, release caches with native lifetimes, and retain pending-request AbortError ordering when cloning aborts a transaction. Exercise real auxiliary-page connection retirement.
Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast. Checks cover the integrated workspace with 32-way concurrency and no automatic retries.
Reuse the native InspectorJson transport and schema-specific handle ownership. Preserve independent frontend IDs/session routing, bounded raw wire output, pause balance and automation sidecars with complete additional regressions.
Decode binding error text strictly for the scalar consumer while preserving its original error code and avoiding success state updates. Keep opaque Inspector payloads unchanged.
Check enforced and report-only script URLs against the policy's retained self URL while preserving the protected Document URL in violation reports. This lets initial about:blank popup script elements load same-origin modules without widening cross-origin policy.
Strengthen the real auxiliary-target regression with inherited script-src/connect-src self and an unchanged about:blank URL. Cover positive and negative script policies plus reporting for blank, srcdoc and data Documents.
Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast (23552 passed, 18 existing skips; 32 threads, no retries).
Preserve shared listener registry identity across document.open, use explicit target/ancestor listener filters, and retain canonical EventTarget inheritance after the main rebase. Drive font and streamed-navigation tests through their native completion queues and align event-order expectations with pinned Chromium 152 observations.
Classify a bounded response prefix before replacing the active Document. Replay original chunks exactly once through the shared raw-document pipeline, retaining raw headers separately from computed MIME. Apply the same decision to streaming, captured and complete child responses.
Keep the old owner running while MIME is undecided. Cancel provisional navigation on stopLoading, propagate transport errors and route unsupported content to downloads before reporting navigation success. Allocate streaming-response navigation state lazily.
Add 13 native regressions for split signatures, replay and observer ownership, cancellation, old-document liveness, inert text, computed metadata and binary text downloads. Make the existing NUL literal-text fixture explicitly nosniff, preserving its assertions, and separately cover browser-confirmed binary download behavior.
Validation: fmt; all-target/all-feature workspace clippy; 22634 nextest passes with 32 threads and zero retries; original WPT 245/251 retained plus 3/3 added coverage. Pinned Chromium controls verify 12 MIME cases and 38 commit phases, 32 navigation cases, 36 frame metadata cases and 5 binary text/nosniff cases. No new original-WPT passes are claimed. Response-stage MIME overrides, image document.open DOM and Blob child-origin gaps remain follow-up work.
Queue unconstrained replies behind earlier frozen output from the same
renderer stream. Keep exact load barriers when draining Runtime fences
and allow independent streams to advance without overtaking their own
output. Regress timer console ordering for root and child evaluate and
callFunctionOn through real flattened WebSockets.
Preserve shared document.domain state and retired-realm token invalidation
when initial document environments cross Page hosts. Restore the bootstrap
fallback state and cover retained auxiliary functions after navigation.
Remove duplicate interface registrations introduced by the overlapping main
changes and retain both existing and new interface regression modules.
Use the upstream owner-settlement API and publish nested command output at
the shared completion boundary. Inspector callbacks can already publish the
pending prefix while an owner remains paused; fence the concrete published
tail even when settlement has no new batch. This keeps beforeunload output
ahead of navigation fetch without closing the suspended command recorder.
Include before-fetch messages and completion details in the existing
paused-navigation regression assertions, and format replayed imports.
Validation: cargo fmt --all; workspace/all-target/all-feature Clippy with
warnings denied; nextest 20,797 passed, 16 skipped, 32 threads, zero retries.
Both paused beforeunload regressions also passed 10 consecutive rounds.
Run tree beforeunload from the existing Inspector scope so navigation can
start its request while the old script remains paused. Bind the active
Page per owner-task poll and preserve the beforeunload output prefix and
navigation fence without completing a suspended Runtime command.
Keep document-replacement termination pauses internal while preserving
real output and balancing pauses already reported to frontend sessions.
Keep intentional pagehide/unload callbacks debuggable during replacement.
Cover root/child lifecycle ordering, 204 recovery, resumable unload,
multiple sessions and cancellation between pause notification and loop entry.
Run browser-initiated main-document checks through the existing asynchronous
lifecycle scheduler before Fetch interception or network loading. Project the
source turn first, reject superseded navigation tokens, and share navigation
finalization so failed checks retain the committed document and release state.
Foreground DevTools callers remain pending through the check and load, preserving
typed navigation results and the captured target owner.
Keep beforeunload and commit unload commands out of nested non-V8 Page-agent
dispatch while the owner is debugger-paused. Cover real navigate/reload/history
responses, retained documents, pause/resume, supersession, and Fetch ordering.
Join child candidates to their active top-level Document's queue in connection
order. Revalidate ownership and ancestor fragments when flushing, and preserve
blocked candidates until their own Document's stylesheet readiness settles.
Construct focus transitions in the target Document's realm using the intrinsic
FocusEvent with its view, without consulting author constructors or inherited
initialization getters. Cover queue ownership, retirement, policies, stylesheet
wakes, and cross-realm focus event behavior.
Keep submit and formdata events synchronous while navigation runs as a
DOM-manipulation task. Capture the request, submitter, target and history
handling; coalesce replaced submissions without extra task turns.
Preserve popup POST requests, cross-origin and sandbox boundaries, and
javascript URL replacement ordering. Follow form navigation that starts
during document creation and cover reentrant, adopted and same-URL forms.
Validation: cargo fmt --all; workspace all-target/all-feature clippy with
warnings denied; cargo nextest run --no-fail-fast (20,002 passed, 16 skipped).
Two additional official WPT cases pass with no passing-case regressions
across the form and Navigation API suites.
Allow top-level navigation owner actions from the current Document through
the in-flight navigation gate so they can cancel the previous request.
Keep exact scheduler predecessors and Page residence validation in place.
Cover an unresponsive first request replaced by page JavaScript without
further client commands, and ensure only the replacement enters history.
Carry committed renderer history through browser navigation requests and
restore structured state, entry identities, and activation before new
Document scripts execute. Read the latest committed source entries when
creating the destination so state updates made during a pending response
are retained.
Keep browser traversals aligned with native Document identities, rebuild
private history ordinals for restored top-level entries, and use native
entry indices for fragment mutations after a cross-origin history prefix.
Cover structured-state restoration, pending-navigation source updates,
fragment indices, browser-owned back/forward traversal, and same-Document
realm and element preservation after WebDriver history restoration.
execCommand("copy") previously returned the user-activation flag without
firing an event or updating the clipboard. Dispatch trusted beforecopy and
copy events, honor cancellation, and copy the receiver document's selection.
Keep text-control selections per document across focus changes and reject
nested editing commands per native document. Share Window activation state
with navigator.userActivation so copying remains available after the
activating call and expires without clearing sticky activation. Read fresh
layout for DOM selection text, preserve preformatted whitespace, and use
the browser profile's clipboard line endings.
Add nine regression tests and correct the BiDi activation regression test.
Validate 38 copy-command cases, 38 existing native shortcut cases, and nine
activation-state cases against Chromium. The copy-event WPT and all 32
selection line-break subtests now pass, with no regressions in 65 WPT cases.
Retain admission cookie metadata in the typed automation event for BiDi, while deferring CDP Cookie headers and ExtraInfo to observed transport data.
Verify a Service Worker supplied iframe script executes without an HTTP script request or invented CDP Cookie header, and keep the prepared metadata available to BiDi.
Close admission under the load mutex when the last consumer retires, before signalling transport cancellation. Reserve new consumers during cache lookup so callback installation cannot race the last cancellation, and discard late completion from cancelled downloads.
Cover cancellation before transport acknowledgement, late success, reserved consumers and same-turn iframe removal followed by a parent script using the same URL.
Prepare initial headers and cookie metadata through the child Document's
request client, including credentials and browser site-context policy.
BiDi beforeRequestSent and terminal events retain this request metadata.
Defer CDP ExtraInfo separately so admission cookie metadata does not consume
the single later transport ExtraInfo event. Test HTTP 200, HTTP 404 and
cross-origin anonymous script requests.
Finish and cancel announced parser-script consumers before transferring
surviving Window loads into the replacement Document registry. Preserve
the original network request identity and ignore late source callbacks.
Test replacement content and networkIdle while the old response is held.
Use Document resource-load leases and shared cache consumer cancellation
for announced child parser scripts. Finish the original request on
retirement, ignore late callbacks, and publish completion independently
of parser-runner lifetime when navigation is cancelled.
Track request ExtraInfo publication separately from enriched cookie
metadata so HTTP-error responses preserve one Cookie ExtraInfo event.
Cover held-response retirement, cancelled srcdoc, late source callbacks,
and repeated metadata enrichment with regression tests.
Commit Browser attachment and withdrawal independently of native Page and
Inspector initialization. Keep shared initial builds on the target and bind
queued Main/IO work to its admitted session connection and native agent.
Separate minimum Inspector connect from ordered binding replay, and publish
unobserved initialization facts without snapshots or completion fences.
Retire Browser contributions immediately and supervise cleanup using the
original native authority, including failed or replaced connections.
The deferred attachment binding completion channel is owned by the
connection, so it closes as soon as the connection goes away (and in
tests, as soon as a hand-built receivers struct drops the sender). The
new receive arms sat ahead of the background-event and
renderer-publication arms in the biased select order without a
closed-channel guard, so a closed channel returned None immediately and
starved every input behind it.
Guard the arms with the same is_closed() check the protocol-work
completion arm already uses: a closed deferred channel cannot produce
further completions, so skipping it loses nothing.
Chromium resolves Target.attachToTarget in ~0 ms even when the target
shows a modal alert/confirm/prompt; moli parked the attach response
behind the renderer's modal wait because the attachment binding apply
was awaited before the commit.
Defer the binding apply instead: a dialog that is already published for
the target (or one that opens while the apply waits) hands the
still-queued dispatch to a supervised background wait, and the attach
commits immediately. The apply settles once the renderer frees up and
its completion is consumed by the scheduler with the same failure
tolerance as the synchronous path, minus the response predecessor
fence that no longer orders anything after publication. Renderer FIFO
still keeps the new session's first command behind the bindings.
createTarget/setAutoAttach share the broader dispatch path and remain
follow-up work.
Notify the embedder after the shared CDP owner is initialized and before
waiting for pipe input. Describe readiness in terms of the protocol
transport so the contract covers both TCP and pipe sessions.
Exercise the public pipe API with ace-protocol enabled: publish one usable
handle before any incoming CDP command, then revoke it after EOF. Repeat
for a second serving invocation. The new case times out without the hook.
`moli serve --remote-debugging-pipe` reads NUL-terminated CDP messages from
inherited file descriptor 3 and writes replies to descriptor 4, like
Chromium's flag of the same name. No listener is bound, so a parent process
can drive a private browser without choosing or exposing a port. The session
ends at EOF on the input pipe or on Browser.close.
- The CLI claims descriptors 3 and 4 once, after checking that both are pipes
or sockets, and hands them to `ProtocolServer::serve_pipe` as `OwnedFd`.
- The WebSocket writer is generic over any message sink, so the pipe shares
its bounded queue and stall handling.
- Shutdown follows `serve_listener`: stop the CDP owner, drain, then flush
storage on a blocking worker inside the shared shutdown budget, reporting a
failed flush.
- An inbound message is limited to the WebSocket transport's 64 MiB and is
rejected as soon as it exceeds that.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>