From 50ae1ad18a0fa0efa6fed6f10ab6c78e852c9b0a Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Tue, 8 Nov 2022 10:18:11 -0500 Subject: Browser+LibWebView+WebDriver: Connect WebDriver to WebContent First, this moves the WebDriver socket to the /tmp/websocket/ directory, as WebDriver now creates multiple sockets per session. Those sockets are now created with Core::LocalServer rather than manually setting up the listening sockets (this was an existing FIXME which resolved some issues I was hitting with creating a second listening socket). WebDriver passes both socket paths to Browser via command line. Browser continues to connect itself via one socket path, then forwards the other socket path to the WebContent process created by the OOPWV. WebContent then connects to WebDriver over this path. WebContent will temporarily set the navigator.webdriver flag to true after connecting to WebDriver. This will soon be moved to its own IPC to be sent by WebDriver. --- Userland/Applications/Browser/Tab.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Userland/Applications/Browser/Tab.cpp') diff --git a/Userland/Applications/Browser/Tab.cpp b/Userland/Applications/Browser/Tab.cpp index 8141f1c0d8..4559f7a3ad 100644 --- a/Userland/Applications/Browser/Tab.cpp +++ b/Userland/Applications/Browser/Tab.cpp @@ -126,8 +126,7 @@ Tab::Tab(BrowserWindow& window) m_web_content_view->set_content_filters({}); m_web_content_view->set_proxy_mappings(g_proxies, g_proxy_mappings); - - if (!g_web_driver_connection.is_null()) + if (!g_webdriver_content_ipc_path.is_empty()) enable_webdriver_mode(); auto& go_back_button = toolbar.add_action(window.go_back_action()); @@ -668,7 +667,7 @@ void Tab::hide_event(GUI::HideEvent&) void Tab::enable_webdriver_mode() { - m_web_content_view->set_is_webdriver_active(true); + m_web_content_view->connect_to_webdriver(Browser::g_webdriver_content_ipc_path); auto& webdriver_banner = *find_descendant_of_type_named("webdriver_banner"); webdriver_banner.set_visible(true); } -- cgit v1.2.3