summaryrefslogtreecommitdiff
path: root/Userland/Services/WebDriver/Client.cpp
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2022-11-08 10:42:12 -0500
committerTim Flynn <trflynn89@pm.me>2022-11-08 19:58:34 -0500
commitf7c212a19dd9a3e33521f92ccb63ded27e72ab7c (patch)
treeb57dc3222d592f5ad7152c79bbfa08eb8cf1f53b /Userland/Services/WebDriver/Client.cpp
parent50ae1ad18a0fa0efa6fed6f10ab6c78e852c9b0a (diff)
downloadserenity-f7c212a19dd9a3e33521f92ccb63ded27e72ab7c.zip
WebContent+WebDriver: Set the navigator.webdriver flag from WebDriver
This moves setting the navigator.webdriver flag from after WebContent creates the WebDriver connection, to its own IPC to be triggered from WebDriver. This is closer to the spec, but mostly serves as an easy test to validate the connection.
Diffstat (limited to 'Userland/Services/WebDriver/Client.cpp')
-rw-r--r--Userland/Services/WebDriver/Client.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Userland/Services/WebDriver/Client.cpp b/Userland/Services/WebDriver/Client.cpp
index 1a614f4919..ad11fcb3bc 100644
--- a/Userland/Services/WebDriver/Client.cpp
+++ b/Userland/Services/WebDriver/Client.cpp
@@ -385,6 +385,8 @@ Web::WebDriver::Response Client::handle_new_session(Vector<StringView> const&, J
return Web::WebDriver::Error::from_code(Web::WebDriver::ErrorCode::SessionNotCreated, String::formatted("Failed to start session: {}", start_result.error().string_literal()));
}
+ auto& web_content_connection = session->web_content_connection();
+
// FIXME: 8. Set the current session to session.
// FIXME: 9. Run any WebDriver new session algorithm defined in external specifications,
@@ -405,7 +407,8 @@ Web::WebDriver::Response Client::handle_new_session(Vector<StringView> const&, J
// FIXME: 12. Initialize the following from capabilities:
// NOTE: See spec for steps
- // FIXME: 13. Set the webdriver-active flag to true.
+ // 13. Set the webdriver-active flag to true.
+ web_content_connection.async_set_is_webdriver_active(true);
// FIXME: 14. Set the current top-level browsing context for session with the top-level browsing context
// of the UA’s current browsing context.