summaryrefslogtreecommitdiff
path: root/Userland/Utilities
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2023-03-16 08:50:22 -0400
committerLinus Groh <mail@linusgroh.de>2023-03-16 15:02:41 +0000
commit700ad6bf350f9e74044c015157f8ad7072c7f04c (patch)
tree6d9957d55b42f72a7b1122ab286c34fdd8922cd0 /Userland/Utilities
parent3a7257c9fe24f1c21a744a76e97f3ee7a2f42f7e (diff)
downloadserenity-700ad6bf350f9e74044c015157f8ad7072c7f04c.zip
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.
Diffstat (limited to 'Userland/Utilities')
-rw-r--r--Userland/Utilities/headless-browser.cpp8
1 files changed, 4 insertions, 4 deletions
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;
}