mirror of
https://github.com/lexmount/moli.git
synced 2026-11-13 16:10:01 +00:00
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.
moli-history
Native per-Window history storage. This crate has no dependency on V8 or JavaScript objects.
WindowHistoryowns the entry list, current index, and state cache revision. Push and replace operations preserve forward-entry and scroll-restoration semantics.HistoryEntrystores URL and identity metadata, scroll position and restoration mode, and immutable serialized History/Navigation state.- Entry references can outlive their membership in a history, so a retained
NavigationHistoryEntryremains readable after replacement or pruning.
moli-session-history coordinates the traversable's joint history across documents and frames. moli-history stores each Window's native view of those entries. moli-page-types transports serialized snapshots across document or VM replacement.
The renderer provides the structured-clone codec and JS bindings. World-specific History wrappers share the same native WindowHistory; each caches its own deserialized history.state. Weak V8 wrapper registrations lease native records without keeping JS contexts alive. Serialized values contain immutable bytes and trusted native attachments such as Blob data, never realm-local JS handles.