Send WillNavigate earlier during navigation startup (#37778)

The will-navigate message tells the devtools client to expect a
navigation for a browsing context. This makes the network monitor clear
any previous entries and show the requests for the new page that is
loaded. In order to support this correctly, we need to send the
navigation notification from the constellation instead of the script
thread, otherwise we silently ignore navigations triggered by the
browser URL bar.




Testing: Ran servo in devtools mode , now the requests appear for new
loaded page
Fixes: https://github.com/servo/servo/issues/37334

---------

Signed-off-by: Uthman Yahaya Baba <uthmanyahayababa@gmail.com>
This commit is contained in:
Usman Yahaya Baba 2025-07-05 12:35:37 +01:00 committed by GitHub
parent 864c877be5
commit 2ad5b24225
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 197 additions and 112 deletions

View file

@ -596,7 +596,6 @@ impl ScriptThread {
/// Step 13 of <https://html.spec.whatwg.org/multipage/#navigate>
pub(crate) fn navigate(
browsing_context: BrowsingContextId,
pipeline_id: PipelineId,
mut load_data: LoadData,
history_handling: NavigationHistoryBehavior,
@ -639,13 +638,6 @@ impl ScriptThread {
.dom_manipulation_task_source()
.queue(task);
} else {
if let Some(ref sender) = script_thread.senders.devtools_server_sender {
let _ = sender.send(ScriptToDevtoolsControlMsg::Navigate(
browsing_context,
NavigationState::Start(load_data.url.clone()),
));
}
script_thread
.senders
.pipeline_to_constellation_sender