diff options
author | Tobias Christiansen <tobyase@serenityos.org> | 2022-10-18 12:44:21 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-10-18 19:18:33 +0200 |
commit | 5d762bd4484ba80f6e1bcffbde0f60ea5acf6d61 (patch) | |
tree | 57189cb30b84a0d3c9447c0c7e3e3541f349e34d /Userland/Libraries | |
parent | 281991057c84c15509282fe55b1e7c07c3189fc5 (diff) | |
download | serenity-5d762bd4484ba80f6e1bcffbde0f60ea5acf6d61.zip |
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.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibWebView/OutOfProcessWebView.cpp | 10 | ||||
-rw-r--r-- | Userland/Libraries/LibWebView/OutOfProcessWebView.h | 3 |
2 files changed, 13 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp b/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp index f51b8a0a52..dc934da070 100644 --- a/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp +++ b/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp @@ -515,6 +515,16 @@ OrderedHashMap<String, String> OutOfProcessWebView::get_session_storage_entries( return client().get_session_storage_entries(); } +Optional<i32> OutOfProcessWebView::get_document_element() +{ + return client().get_document_element(); +} + +Optional<Vector<i32>> OutOfProcessWebView::query_selector_all(i32 start_node_id, String const& selector) +{ + return client().query_selector_all(start_node_id, selector); +} + void OutOfProcessWebView::set_content_filters(Vector<String> filters) { client().async_set_content_filters(filters); diff --git a/Userland/Libraries/LibWebView/OutOfProcessWebView.h b/Userland/Libraries/LibWebView/OutOfProcessWebView.h index d8a2878696..90765ef547 100644 --- a/Userland/Libraries/LibWebView/OutOfProcessWebView.h +++ b/Userland/Libraries/LibWebView/OutOfProcessWebView.h @@ -58,6 +58,9 @@ public: OrderedHashMap<String, String> get_local_storage_entries(); OrderedHashMap<String, String> get_session_storage_entries(); + Optional<i32> get_document_element(); + Optional<Vector<i32>> query_selector_all(i32 start_node_id, String const& selector); + void set_content_filters(Vector<String>); void set_proxy_mappings(Vector<String> proxies, HashMap<String, size_t> mappings); void set_preferred_color_scheme(Web::CSS::PreferredColorScheme); |