1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:37:43 +00:00

Browser+LibWebView: Add WebDriver IPC plumbing for executing scripts

This commit is contained in:
Linus Groh 2022-11-02 18:08:48 +00:00
parent b572a91a6f
commit 747ba2a88f
7 changed files with 40 additions and 0 deletions

View file

@ -42,6 +42,7 @@
#include <LibWeb/Layout/InitialContainingBlock.h>
#include <LibWeb/Loader/ResourceLoader.h>
#include <LibWebView/OutOfProcessWebView.h>
#include <LibWebView/WebContentClient.h>
namespace Browser {
@ -630,6 +631,10 @@ void BrowserWindow::create_new_tab(URL url, bool activate)
return active_tab().view().get_element_tag_name(element_id);
};
new_tab.webdriver_endpoints().on_execute_script = [this](String const& body, Vector<String> const& json_arguments, Optional<u64> const& timeout, bool async) {
return active_tab().view().webdriver_execute_script(body, json_arguments, timeout, async);
};
new_tab.load(url);
dbgln_if(SPAM_DEBUG, "Added new tab {:p}, loading {}", &new_tab, url);