From 700ad6bf350f9e74044c015157f8ad7072c7f04c Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Thu, 16 Mar 2023 08:50:22 -0400 Subject: WebContent+LibWebView: Consolidate the way browsers connect to WebDriver Currently, on Serenity, we connect to WebDriver from the browser-side of the WebContent connection for both Browser and headless-browser. On Lagom, we connect from within the WebContent process itself, signaled by a command line flag. This patch changes Lagom browsers to connect to WebDriver the same way that Serenity browsers do. This will ensure we can do other initializers in the same order across all platforms and browsers. --- Userland/Utilities/headless-browser.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Userland/Utilities') diff --git a/Userland/Utilities/headless-browser.cpp b/Userland/Utilities/headless-browser.cpp index 498a23104f..5ce84c9c39 100644 --- a/Userland/Utilities/headless-browser.cpp +++ b/Userland/Utilities/headless-browser.cpp @@ -53,12 +53,9 @@ public: #if defined(AK_OS_SERENITY) view->m_client_state.client = TRY(WebView::WebContentClient::try_create(*view)); - - if (!web_driver_ipc_path.is_empty()) - view->client().async_connect_to_webdriver(web_driver_ipc_path); #else auto candidate_web_content_paths = TRY(get_paths_for_helper_process("WebContent"sv)); - view->m_client_state.client = TRY(view->launch_web_content_process(candidate_web_content_paths, web_driver_ipc_path)); + view->m_client_state.client = TRY(view->launch_web_content_process(candidate_web_content_paths)); #endif view->client().async_update_system_theme(move(theme)); @@ -67,6 +64,9 @@ public: view->client().async_set_viewport_rect({ { 0, 0 }, window_size }); view->client().async_set_window_size(window_size); + if (!web_driver_ipc_path.is_empty()) + view->client().async_connect_to_webdriver(web_driver_ipc_path); + return view; } -- cgit v1.2.3