mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
WebContent+WebDriver: Get window handle from WebContent process
This change makes window handles on WebDriver process side be consistent with handles returned by /window/new.
This commit is contained in:
parent
f287165823
commit
126fa7df14
Notes:
sideshowbarker
2024-07-17 03:27:40 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: 126fa7df14
Pull-request: https://github.com/SerenityOS/serenity/pull/17855
Reviewed-by: https://github.com/linusg
Reviewed-by: https://github.com/trflynn89 ✅
5 changed files with 11 additions and 5 deletions
|
@ -50,12 +50,11 @@ ErrorOr<NonnullRefPtr<Core::LocalServer>> Session::create_server(NonnullRefPtr<S
|
|||
dbgln("WebDriver is connected to WebContent socket");
|
||||
auto web_content_connection = maybe_connection.release_value();
|
||||
|
||||
auto handle_name = String::formatted("window-{}"sv, m_next_handle_id).release_value_but_fixme_should_propagate_errors();
|
||||
m_next_handle_id++;
|
||||
m_windows.set(handle_name, Session::Window { handle_name, move(web_content_connection) });
|
||||
auto window_handle = web_content_connection->get_window_handle();
|
||||
m_windows.set(window_handle, Session::Window { window_handle, move(web_content_connection) });
|
||||
|
||||
if (m_current_window_handle.is_empty())
|
||||
m_current_window_handle = handle_name;
|
||||
m_current_window_handle = window_handle;
|
||||
|
||||
MUST(promise->resolve({}));
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue