diff options
author | Timothy Flynn <trflynn89@pm.me> | 2023-03-16 08:50:22 -0400 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-03-16 15:02:41 +0000 |
commit | 700ad6bf350f9e74044c015157f8ad7072c7f04c (patch) | |
tree | 6d9957d55b42f72a7b1122ab286c34fdd8922cd0 /Ladybird/WebContent/main.cpp | |
parent | 3a7257c9fe24f1c21a744a76e97f3ee7a2f42f7e (diff) | |
download | serenity-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 'Ladybird/WebContent/main.cpp')
-rw-r--r-- | Ladybird/WebContent/main.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Ladybird/WebContent/main.cpp b/Ladybird/WebContent/main.cpp index d1ab62ad9b..f30f672378 100644 --- a/Ladybird/WebContent/main.cpp +++ b/Ladybird/WebContent/main.cpp @@ -83,11 +83,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) dbgln("Failed to load content filters: {}", maybe_content_filter_error.error()); int webcontent_fd_passing_socket { -1 }; - DeprecatedString webdriver_content_ipc_path; Core::ArgsParser args_parser; args_parser.add_option(webcontent_fd_passing_socket, "File descriptor of the passing socket for the WebContent connection", "webcontent-fd-passing-socket", 'c', "webcontent_fd_passing_socket"); - args_parser.add_option(webdriver_content_ipc_path, "Path to WebDriver IPC for WebContent", "webdriver-content-path", 0, "path"); args_parser.parse(arguments); VERIFY(webcontent_fd_passing_socket >= 0); @@ -100,11 +98,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) proxy_socket_through_notifier(*webcontent_client, webcontent_notifier); QSocketNotifier webdriver_notifier(QSocketNotifier::Type::Read); - RefPtr<WebContent::WebDriverConnection> webdriver_client; - if (!webdriver_content_ipc_path.is_empty()) { - webdriver_client = TRY(WebContent::WebDriverConnection::connect(webcontent_client->page_host(), webdriver_content_ipc_path)); - proxy_socket_through_notifier(*webdriver_client, webdriver_notifier); - } + webcontent_client->page_host().on_webdriver_connection = [&](auto& webdriver) { + proxy_socket_through_notifier(webdriver, webdriver_notifier); + }; return app.exec(); } |