Sweep link candidates by full target and reject impossible containment using polygon bounds. Keep the original clipped regions when optional deduplication exhausts its work budget. Cover dense HTML printing, PDF annotations, partial-work fallback, and target identity.
`moli serve --cookie-file` imported the file on startup but never wrote it
back, so every cookie the session accepted — network-stack Set-Cookie
responses, CDP Network.setCookie, and document.cookie writes — was lost
when the server exited. Fetch mode already exports its cookie jar at
exit; serve now mirrors that: after ProtocolServer::serve() returns, the
storage partition's cookies are written back to every cookie-file
argument loaded from a path (literal --cookie data and stdin stay
input-only).
Export failures are logged and do not replace the serve result, matching
fetch mode's exit-time export. Signal-driven exits keep their immediate
termination contract (moli-process-signal), so the export runs on the
graceful shutdown paths — Browser.close and the instance shutdown
command.
The serve cookie-file integration tests drive a real `moli serve` over
CDP: network Set-Cookie, Network.setCookie, and document.cookie cookies
must all land in the file on graceful exit and be restored by a
restarted server.
Keep the Window fixture alive through the negative cases and assert the exact credentials error. Exercise real Worker fetch forwarding for native Request variants, including POST bodies, and reject converted URLs before networking.
Replace the preparation error enum with anyhow::Result. Preserve context error messages, direct URL/WebIDL error propagation, and the existing Promise rejection path.
Extracted from development commit b0e803695e.
Adapted to the target branch APIs. Validated with cargo fmt --all, full workspace Clippy (-D warnings), and cargo nextest run --no-fail-fast before committing.
Keep captured policy origins ahead of native-origin and Document URL
fallbacks without cloning and mutating a shared parsed policy for each
check. Reuse the same connect check entry point for the top Document.
Cover fallback priority, per-check isolation, and report attribution and
relative endpoint resolution for both policy dispositions.
Resolve iframe creators through owner_dispatch_scope_for_node for initial
policy inheritance, CSP parent lookup, and inherited secure-context checks.
Preserve the existing initial-policy fallback during auxiliary-page
handoff and popup retirement, when dispatch mappings can be unavailable.
Pass DocumentPolicyContainer directly into connect CSP checks.
Preserve the first accepted header spelling through Header mutations, Request copies and network serialization while keeping public iteration lowercase and case-insensitive lookup. Include twelve real HTTP request cases in both Window and Worker.
Extracted from development commit 55e94176e33e801bb4ca96fe805c3771d153d577.
Base: main (b30f39c580).
Validation (32 build jobs and test threads): cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast.
Summary [ 147.813s] 22171 tests run: 22171 passed (9 slow), 20 skipped