Commit Graph
217 Commits
Author SHA1 Message Date
ldm0 d6046d2725 fix(bidi): own document admission in pending Runtime commands
Keep the socket actor responsive while a context-targeted Runtime command waits for its Document. Retain the original host and session binding until admission can validate and dispatch in one finite owner turn. Cover close, replacement, navigation completion, session end and disconnect in standalone and Classic-attached BiDi, including exact-once responses and revoked identities.
2026-11-13 00:42:01 +08:00
ldm0 3e3bee3d75 fix(bidi): keep unrelated contexts live during navigation 2026-11-13 00:42:01 +08:00
ldm0 0967c3654a refactor(protocol): scope scheduler navigation prerequisites 2026-11-13 00:42:01 +08:00
ldm0 69d80ea742 refactor(protocol): remove source-owned Native insertion graphs 2026-11-12 20:44:39 +08:00
ldm0 b4abe33fc8 fix(protocol): preserve output order for overlapping insertions 2026-11-12 20:44:39 +08:00
ldm0 2fac328780 fix(protocol): unblock three-stream nested insertions 2026-11-12 20:44:39 +08:00
ldm0 ebf62d93b1 fix(cdp): finish accepted browser close despite reply failure 2026-11-12 20:44:39 +08:00
ldm0 97bb57bed0 fix(downloads): progress independently of command replies 2026-11-12 20:44:39 +08:00
ldm0 12dc4ba261 fix(protocol): preserve inserted Native stream successor order 2026-11-12 20:44:39 +08:00
ldm0 accf74494a refactor(protocol): remove redundant permission turns 2026-11-12 20:44:39 +08:00
ldm0 5c7a045b1b refactor(protocol): limit response barriers to explicit Inspector messages 2026-11-12 20:44:39 +08:00
ldm0 c7f75ceb7b fix(protocol): preserve native insertion order in source publications 2026-11-12 20:44:39 +08:00
user.email e8f6242344 fix(cdp): wait for pending frontend detach before reconnect 2026-11-12 20:10:31 +08:00
ldm0 02eb87a216 test(protocol): wait for asynchronous popup observations 2026-11-12 04:42:48 +08:00
ldm0 b20ff14ff9 refactor(inspector): derive response IDs and make parsing explicit 2026-11-12 03:32:12 +08:00
ldm0 613d7c22ff refactor(cdp): clarify response settlement and deferred completion 2026-11-12 03:13:09 +08:00
ldm0 69d71c70c6 refactor(cdp): own published work independently of command output 2026-11-12 03:13:09 +08:00
ldm0 53f6fca31c perf(cdp): keep unrelated navigation and trace events opaque 2026-11-12 02:01:08 +08:00
ldm0 edf75c38e5 fix(inspector): compare JSON carriers by wire representation 2026-11-12 02:01:08 +08:00
ldm0 82f159c708 Preserve raw Inspector payloads through renderer and CDP routing 2026-11-12 02:01:08 +08:00
ldm0 c67597a1c1 Introduce shared raw Inspector JSON envelopes 2026-11-12 02:01:08 +08:00
ldm0 cd3682f0df refactor(protocol): separate popup creation from target initialization 2026-11-12 00:29:40 +08:00
ldm0 f4effc1022 fix(protocol): announce popup contexts before initial adoption 2026-11-12 00:29:40 +08:00
ldm0 f88f8f142d fix(bidi): acknowledge alert closures after dismissal 2026-11-12 00:29:40 +08:00
ldm0 bc5a256afc fix(bidi): honor prompt handlers and preserve modal execution
Apply negotiated per-type policies through Page-owned one-shot dialog completion, including Classic-attached BiDi sessions. Publish required auxiliary Page predecessors only at a modal wait, keep normal popup completion ordering, and resolve dialogs against their captured Page owner.
2026-11-12 00:29:40 +08:00
ldm0 951d54ab86 fix(ace): retain input effects when page tasks fail
Require explicit task kinds and reject input from read-only tasks. Collect each input outcome in the host and settle retained effects independently of the task result. Report ordinary pending navigations and cover multiple effects, task errors, and screenshots.
2026-11-10 20:26:30 +08:00
guojinghua afd5b8fae3 feat(ace): expose typed page tasks and browser runtime hooks
Add opt-in ace-protocol support with AcePageTask and PageExtensionHost
for renderer-owner-thread inspection, native input, and screenshots.
Expose BrowserRuntimeHandle through a runtime-ready callback so embedders
can discover targets and submit tasks without CDP request/response envelopes.

Reuse supervised page workflows for output ordering, input effects, and
target/document lifetime checks. Recover lost waiters without replaying
admitted tasks, and revoke runtime access on browser shutdown.
2026-11-10 20:26:30 +08:00
ldm0 ebd5dbd2f9 refactor(bidi): share channel message envelopes
The BiDi adapter and protocol server duplicate channel-envelope insertion. Own it in the BiDi protocol implementation and reuse it from the server, preserving optional channels, object-only insertion and replacement of an existing goog:channel field.
2026-11-09 18:56:20 +08:00
ldm0 48fa7e9aef fix(bidi): ignore typed CDP dialog opening projections 2026-11-07 01:22:11 +08:00
ldm0 5b7b330fba test(dialogs): discover browser endpoints after rebase 2026-11-07 01:22:11 +08:00
ldm0 8d2b995e5a fix(protocol): own native dialog handlers in frontend adapters
Native discovery and rejected commands could leave a dialog handler marked
available indefinitely. Register Classic and BiDi handlers explicitly at
session setup or attachment, and release them on session end, disconnect,
and runtime shutdown before waiting for renderer cleanup.

Keep adapter registrations independent and distinguish handler availability
from modal waiting. Apply waiting policy to existing and newly created browser
contexts. Releasing the final native handler settles dialogs without an
original Page observer.

Centralize Page subscription release while preserving the distinct disable
and detach cancellation policies. Cover command purity, independent adapter
lifetimes, context initialization, abandoned completions, and Classic dialog
handling after a real BiDi disconnect or session.end.
2026-11-07 01:22:11 +08:00
ldm0 802ee1f298 fix(protocol): settle orphaned dialogs and deduplicate native events
Dismiss queued dialogs when their final original Page subscriber detaches,
before waiting for session cleanup. Late Page subscribers cannot inherit an
existing dialog. Preserve dialogs that still have a native automation handler
or another original subscriber, without introducing renderer waits on detach.

Cancel every dialog observed by a disabling Page subscription, including
queued entries behind an unobserved head. Also settle renderer dialog prefixes
that arrive after the last handler has left.

Emit one native opening/closing fact per physical dialog and project CDP wire
events independently for each subscribed session. Track native handler
availability separately from renderer modal waiting so Classic and BiDi retain
their existing behavior.

Cover detach and disconnect over independent WebSockets, queued cancellation,
late subscriptions, native handler preservation, and event fanout counts.
2026-11-07 01:22:11 +08:00
ldm0 b5d120f103 fix(protocol): keep shared dialogs independent of DevTools sessions
Own pending dialogs and prompt text on PageTargetHost so disposing Primary
cannot lose a renderer completion. Settle dialogs when their document is
replaced or their target closes or drops.

Capture Page subscription generations when a dialog opens. Only those CDP
observers may handle or cancel it, and Page.disable consistently dismisses
the shared dialog from either session. Keep native automation independent
of Page.enable and send CDP dialog events only to enabled Page sessions.

Cover Primary disposal, disabled and late-enabled observers, Page.disable,
target drop, and dialog handling over independent WebSocket connections.
Synchronize the existing multi-session regression on specific events and
responses instead of elapsed time.
2026-11-07 01:22:11 +08:00
BibekPathak 2bd9ddb08d report JavaScript dialogs to every attached Page session 2026-11-07 01:22:11 +08:00
ldm0 06fb3a7afb fix(renderer): retain the Performance clock across initial Window reuse
Carry the retained Window's clock anchors into the new Document without inheriting lifecycle slots or rematerializing cached Performance objects. Add Chromium-backed timing and identity regressions with an intentionally delayed navigation response.
2026-11-06 02:11:13 +08:00
ldm0 ac803a7639 fix(input): honor Document execution contexts before default actions 2026-11-05 21:15:30 +08:00
ldm0 b917c3f377 test(service-worker): verify cache modes across a real page reload 2026-11-05 03:12:47 +08:00
ldm0 51c1be0f6f fix(cdp): keep post-load work behind its Load output 2026-11-05 00:18:07 +08:00
ldm0 f145d42a42 refactor(cdp): decouple load publication from lifecycle observers 2026-11-05 00:18:07 +08:00
ldm0 57da451d96 feat(protocol): expose Moli version in Browser.getVersion 2026-11-04 13:40:18 +08:00
ldm0 cd61e0ca93 fix(protocol): align browser version discovery metadata 2026-11-04 13:40:18 +08:00
ldm0 299cee39b0 fix(navigation): preserve pending location on noop history traversal 2026-11-03 18:42:59 +08:00
ldm0 b2a45e6129 fix(webdriver): unify Classic and BiDi node references 2026-11-03 11:04:27 +08:00
ldm0 ea1076e2db fix(cdp): preserve per-page output fences during Fetch teardown
Fix MOL-554 by keeping renderer output fences for different Pages as
independent predecessors of the existing protocol output work item.
Preserve command correlation when publishing cleanup and detach events
after every original renderer prefix has crossed protocol ingress.

Cover continued and outstanding Fetch requests across two Pages, and prove
that projecting one Page's cursor cannot release another Page's output.

Validation: cargo fmt --all; workspace all-target/all-feature Clippy;
Nextest 21,987 passed, 19 skipped; Playwright reproduction passes 3/3.
2026-11-03 10:48:27 +08:00
ldm0 6043f02345 fix(cdp): resume queued evaluations after history navigation 2026-11-03 10:46:29 +08:00
ldm0 24ad52ddd2 fix(webdriver): preserve node scope across Classic and BiDi 2026-11-03 09:09:03 +08:00
ldm0 b593f7e617 fix(webdriver): restore Classic opt-out and BiDi client workflows 2026-11-03 07:23:02 +08:00
ldm0 de4cc98f47 fix(serve): preserve startup scripts across protocol lifecycles
Capture startup scripts before creating navigation engines and install them when each BrowserContext is created. Keep CLI scripts outside mutable protocol preload registries so engine resets and protocol removals preserve startup policy.

Pass complete runtime configuration through BiDi and Classic entry points. Add six regression tests covering protocol navigation, iframes, late contexts, new windows, preload removal and engine reset.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast (22,197 passed, 20 skipped).
2026-11-03 07:13:38 +08:00
ldm0andneosun100 ac3bcc8db7 fix(fetch): apply request header guards before merging extra headers
Filter author-provided headers in Window and Worker fetch inputs for both
URL and Request override paths, using the guard selected by request mode.
Keep trusted extra HTTP headers separate from this filtering.

Add network coverage for header handling across fetch modes and input
forms, including Window/Worker behavior and trusted-header compatibility.

Co-authored-by: neosun100 <neosun100@users.noreply.github.com>
2026-11-03 05:53:28 +08:00
ldm0andneosun100 b6116eb8b8 fix(server): validate protocol Host and Origin before routing
Apply a shared guard before HTTP and WebSocket routing across CDP,
WebDriver Classic and BiDi. Accept any IP literal, or localhost and its
subdomains (including a trailing root dot). Treat an empty port as
unspecified.

Allow requests without Origin, from the bound server's HTTP origin, or
from explicitly allowlisted origins. Support repeated and comma-separated
--remote-allow-origins values and the '*' wildcard. Reject ambiguous
headers and keep Host validation independent of Origin exceptions.

Cover the HTTP routers, CDP and BiDi WebSocket handshakes, and WebDriver
text/plain session creation, including same-origin compatibility.

Co-authored-by: neosun100 <neosun100@users.noreply.github.com>
2026-11-03 05:53:28 +08:00