mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-25 03:36:36 +00:00
WebContent: Return the handle of the newly opened window from New Window
We were returning the handle of the already opened window, rather than the handle of the window we just opened.
This commit is contained in:
parent
981aaba96c
commit
6cba55893e
Notes:
github-actions[bot]
2024-10-20 15:42:09 +00:00
Author: https://github.com/trflynn89
Commit: 6cba55893e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1881
Reviewed-by: https://github.com/tcl3 ✅
1 changed files with 4 additions and 5 deletions
|
@ -487,13 +487,12 @@ Messages::WebDriverClient::NewWindowResponse WebDriverConnection::new_window(Jso
|
|||
// context is presented to the user are implementation defined.
|
||||
auto* active_window = current_browsing_context().active_window();
|
||||
VERIFY(active_window);
|
||||
{
|
||||
Web::HTML::TemporaryExecutionContext execution_context { active_window->document()->relevant_settings_object() };
|
||||
MUST(active_window->window_open_steps("about:blank"sv, ""sv, "noopener"sv));
|
||||
}
|
||||
|
||||
Web::HTML::TemporaryExecutionContext execution_context { active_window->document()->relevant_settings_object() };
|
||||
auto [target_navigable, no_opener, window_type] = MUST(active_window->window_open_steps_internal("about:blank"sv, ""sv, "noopener"sv));
|
||||
|
||||
// 6. Let handle be the associated window handle of the newly created window.
|
||||
auto handle = current_browsing_context().top_level_traversable()->window_handle();
|
||||
auto handle = target_navigable->traversable_navigable()->window_handle();
|
||||
|
||||
// 7. Let type be "tab" if the newly created window shares an OS-level window with the current browsing context, or "window" otherwise.
|
||||
auto type = "tab"sv;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue