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.
This commit is contained in:
Aliaksandr Kalenik 2023-03-15 17:00:00 +03:00 committed by Tim Flynn
parent 126fa7df14
commit bb98ae08b8
Notes: sideshowbarker 2024-07-17 03:19:14 +09:00

View file

@ -324,6 +324,9 @@ ErrorOr<NonnullRefPtr<WebDriverConnection>> 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));
}