LibDevTools: Pass request initiator type to network panel

Propagate the request initiator type (e.g., "xmlhttprequest", "fetch",
"script", "stylesheet") from LibWeb through the IPC layer to DevTools.

This enables Firefox DevTools to correctly identify XHR/fetch requests
and display appropriate cause types in the Network panel's "Initiator"
column.
This commit is contained in:
Andreas Kling
2026-01-14 23:24:51 +01:00
committed by Andreas Kling
parent 31ffd2e8e5
commit 681d00c218
Notes: github-actions[bot] 2026-01-15 19:11:36 +00:00
15 changed files with 50 additions and 20 deletions

View File

@@ -436,11 +436,11 @@ void WebContentClient::did_output_js_console_message(u64 page_id, ConsoleOutput
}
}
void WebContentClient::did_start_network_request(u64 page_id, u64 request_id, URL::URL url, ByteString method, Vector<HTTP::Header> request_headers, ByteBuffer request_body)
void WebContentClient::did_start_network_request(u64 page_id, u64 request_id, URL::URL url, ByteString method, Vector<HTTP::Header> request_headers, ByteBuffer request_body, Optional<String> initiator_type)
{
if (auto view = view_for_page_id(page_id); view.has_value()) {
if (view->on_network_request_started)
view->on_network_request_started(request_id, url, method, request_headers, move(request_body));
view->on_network_request_started(request_id, url, method, request_headers, move(request_body), move(initiator_type));
}
}