mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 09:17:45 +00:00
WebContent+Friends: Add IPC and plumbing for WebDriver endpoint
To use the `GET /session/{id}/element/{id}/css/{property name}` WebDriver endpoint, two new IPC calls through the Browser are implemented: - get_active_documents_type returns the type of the active document, which is either "xml" or "html" - get_computed_value_for_element returns the computed CSS value (as String) for the given element and CSS property name
This commit is contained in:
parent
eda566d112
commit
202b2be1f2
7 changed files with 70 additions and 0 deletions
|
@ -598,6 +598,14 @@ void BrowserWindow::create_new_tab(URL url, bool activate)
|
|||
return active_tab().view().get_element_property(element_id, name);
|
||||
};
|
||||
|
||||
new_tab.on_get_active_documents_type = [this]() {
|
||||
return active_tab().view().get_active_documents_type();
|
||||
};
|
||||
|
||||
new_tab.on_get_computed_value_for_element = [this](i32 element_id, String const& property_name) {
|
||||
return active_tab().view().get_computed_value_for_element(element_id, property_name);
|
||||
};
|
||||
|
||||
new_tab.load(url);
|
||||
|
||||
dbgln_if(SPAM_DEBUG, "Added new tab {:p}, loading {}", &new_tab, url);
|
||||
|
|
|
@ -72,6 +72,8 @@ public:
|
|||
Function<Optional<Vector<i32>>(i32 start_node_id, String const&)> on_query_selector_all;
|
||||
Function<Optional<String>(i32 element_id, String const&)> on_get_element_attribute;
|
||||
Function<Optional<String>(i32 element_id, String const&)> on_get_element_property;
|
||||
Function<String()> on_get_active_documents_type;
|
||||
Function<String(i32 element_id, String const&)> on_get_computed_value_for_element;
|
||||
|
||||
enum class InspectorTarget {
|
||||
Document,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue