From 036f2106dced2e2c19643acace56ce3b6fb9cf45 Mon Sep 17 00:00:00 2001 From: ldm0 Date: Tue, 22 Sep 2026 13:28:37 +0800 Subject: [PATCH] fix(navigation): let renderer requests supersede pending loads 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. --- .../tests/websocket/navigation_and_load_progress.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/moli-protocol-server/src/protocol_server/tests/websocket/navigation_and_load_progress.rs b/moli-protocol-server/src/protocol_server/tests/websocket/navigation_and_load_progress.rs index 192a2dcfdca..b1a81ba2502 100644 --- a/moli-protocol-server/src/protocol_server/tests/websocket/navigation_and_load_progress.rs +++ b/moli-protocol-server/src/protocol_server/tests/websocket/navigation_and_load_progress.rs @@ -688,6 +688,17 @@ async fn websocket_cdp_renderer_navigation_replaces_pending_response_without_cli ["about:blank", source_url.as_str(), replacement_url.as_str()] ); assert_eq!(history["result"]["currentIndex"], json!(2)); + let history = cdp_runtime_evaluate_string( + &mut socket, + &session.session_id, + 8, + "JSON.stringify(navigation.entries().map(entry => entry.url))", + ) + .await; + assert_eq!( + serde_json::from_str::(&history).unwrap(), + json!([source_url, replacement_url]) + ); let _ = socket.close(None).await; abort_test_cdp_server(protocol_server).await;