From 0a5f68eba6cf165f875177360d8db374714be70a Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Fri, 14 Mar 2025 08:59:38 -0400 Subject: [PATCH] LibWebView: Disable site isolation and spare processes when debugging These features make it difficult to debug a single WebContent instance. --- Libraries/LibWebView/Application.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Libraries/LibWebView/Application.cpp b/Libraries/LibWebView/Application.cpp index e301be9d346..ab2aba6a137 100644 --- a/Libraries/LibWebView/Application.cpp +++ b/Libraries/LibWebView/Application.cpp @@ -145,6 +145,10 @@ void Application::initialize(Main::Arguments const& arguments, URL::URL new_tab_ if (profile_process.has_value()) profile_process_type = process_type_from_name(*profile_process); + // Disable site isolation when debugging WebContent. Otherwise, the process swap may interfere with the gdb session. + if (debug_process_type == ProcessType::WebContent) + disable_site_isolation = true; + m_chrome_options = { .urls = sanitize_urls(raw_urls, new_tab_page_url), .raw_urls = move(raw_urls), @@ -220,6 +224,10 @@ ErrorOr> Application::launch_web_content_process void Application::launch_spare_web_content_process() { + // Disable spare processes when debugging WebContent. Otherwise, it breaks running `gdb attach -p $(pidof WebContent)`. + if (chrome_options().debug_helper_process == ProcessType::WebContent) + return; + if (m_has_queued_task_to_launch_spare_web_content_process) return; m_has_queued_task_to_launch_spare_web_content_process = true;