LibWebView+UI: Add an Application method to open a URL in a new tab

This lets us avoid each UI needing to handle link clicks directly, and
lets actions stored in LibWebView avoid awkwardly going through the link
click callbacks to open URLs.
This commit is contained in:
Timothy Flynn 2025-09-13 09:08:24 -04:00 committed by Tim Flynn
parent c2365653a5
commit ce331cbcd5
Notes: github-actions[bot] 2025-09-18 11:28:58 +00:00
20 changed files with 62 additions and 170 deletions

View file

@ -278,6 +278,12 @@ ErrorOr<void> Application::initialize(Main::Arguments const& arguments)
return {};
}
void Application::open_url_in_new_tab(URL::URL const& url, Web::HTML::ActivateTab activate_tab) const
{
if (auto view = open_blank_new_tab(activate_tab); view.has_value())
view->load(url);
}
static ErrorOr<NonnullRefPtr<WebContentClient>> create_web_content_client(Optional<ViewImplementation&> view)
{
auto request_server_socket = TRY(connect_new_request_server_client());