diff --git a/Userland/Applications/Browser/Tab.cpp b/Userland/Applications/Browser/Tab.cpp index eb0e3cb1fc..fb281995ec 100644 --- a/Userland/Applications/Browser/Tab.cpp +++ b/Userland/Applications/Browser/Tab.cpp @@ -128,7 +128,7 @@ Tab::Tab(BrowserWindow& window) m_web_content_view->set_proxy_mappings(g_proxies, g_proxy_mappings); if (!g_web_driver_connection.is_null()) - m_web_content_view->set_is_webdriver_active(true); + enable_webdriver_mode(); auto& go_back_button = toolbar.add_action(window.go_back_action()); go_back_button.on_context_menu_request = [&](auto&) { @@ -665,4 +665,9 @@ void Tab::hide_event(GUI::HideEvent&) m_web_content_view->set_visible(false); } +void Tab::enable_webdriver_mode() +{ + m_web_content_view->set_is_webdriver_active(true); +} + } diff --git a/Userland/Applications/Browser/Tab.h b/Userland/Applications/Browser/Tab.h index ba37fcd625..b2886d0068 100644 --- a/Userland/Applications/Browser/Tab.h +++ b/Userland/Applications/Browser/Tab.h @@ -75,6 +75,7 @@ public: Function on_take_screenshot; WebDriverEndpoints& webdriver_endpoints() { return m_webdriver_endpoints; } + void enable_webdriver_mode(); enum class InspectorTarget { Document, diff --git a/Userland/Applications/Browser/main.cpp b/Userland/Applications/Browser/main.cpp index 2d6d4e6678..85126f7a3d 100644 --- a/Userland/Applications/Browser/main.cpp +++ b/Userland/Applications/Browser/main.cpp @@ -152,7 +152,7 @@ ErrorOr serenity_main(Main::Arguments arguments) // The first tab is created with the BrowserWindow above, so we have to do this // manually once after establishing the connection. - window->active_tab().view().set_is_webdriver_active(true); + window->active_tab().enable_webdriver_mode(); } auto content_filters_watcher = TRY(Core::FileWatcher::create());