From bb98ae08b85659731cc8f5b0ecd3cce20202cb8d Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Wed, 15 Mar 2023 17:00:00 +0300 Subject: [PATCH] WebContent: Allow pop-ups when WebDriver is connected Currently we have `m_should_block_pop_ups` set to true by default which means `choose_a_browsing_context` will early return if new top-level browsing context is requested and write `Pop-up blocked!` in console. It is good but when WebDriver is connected we want it to be able to actually open a new window if one is requested. --- Userland/Services/WebContent/WebDriverConnection.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Userland/Services/WebContent/WebDriverConnection.cpp b/Userland/Services/WebContent/WebDriverConnection.cpp index 74da18d6b5..8f36ee54c8 100644 --- a/Userland/Services/WebContent/WebDriverConnection.cpp +++ b/Userland/Services/WebContent/WebDriverConnection.cpp @@ -324,6 +324,9 @@ ErrorOr> WebDriverConnection::connect(Web::Pa dbgln_if(WEBDRIVER_DEBUG, "Trying to connect to {}", webdriver_ipc_path); auto socket = TRY(Core::LocalSocket::connect(webdriver_ipc_path)); + // Allow pop-ups, or otherwise /window/new won't be able to open a new tab. + page_client.page().set_should_block_pop_ups(false); + dbgln_if(WEBDRIVER_DEBUG, "Connected to WebDriver"); return adopt_nonnull_ref_or_enomem(new (nothrow) WebDriverConnection(move(socket), page_client)); }