mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:17:44 +00:00
WebDriver+Friends: Add IPC and plumbing for Element-getting
This extends the IPC calls `get_document_element` and `query_selector_all` to be usable by the WebDriver. For this the `WebDriverConnection` provides the same interfaces and takes care of routing the data through the Browser.
This commit is contained in:
parent
281991057c
commit
5d762bd448
7 changed files with 49 additions and 0 deletions
|
@ -582,6 +582,14 @@ void BrowserWindow::create_new_tab(URL url, bool activate)
|
|||
return active_tab().view().get_session_storage_entries();
|
||||
};
|
||||
|
||||
new_tab.on_get_document_element = [this]() {
|
||||
return active_tab().view().get_document_element();
|
||||
};
|
||||
|
||||
new_tab.on_query_selector_all = [this](i32 start_node_id, String const& selector) {
|
||||
return active_tab().view().query_selector_all(start_node_id, selector);
|
||||
};
|
||||
|
||||
new_tab.load(url);
|
||||
|
||||
dbgln_if(SPAM_DEBUG, "Added new tab {:p}, loading {}", &new_tab, url);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue