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>
Route intercepted Window and dedicated Worker XHR through shared native
request, authentication and response decisions. One-shot pause ports let the
existing protocol/session machinery continue, fail or fulfill a request
without queueing a Page command behind its suspended JavaScript stack.
Publish native network facts across an explicit synchronous-wait scope, preserve
normal asynchronous streaming delivery, and cancel loads before owner
teardown. Remove the synchronous-only URL-rule copy and retain the canonical
protocol matcher, session chains and request identities.
Cover Page task suspension, independent protocol decisions, binary overrides,
CORS preflight, authentication, redirects, streaming, multi-session cleanup,
Worker termination and target close. Await actual callback/command identities
where network acknowledgements no longer imply Page delivery has finished.