mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 15:43:20 +00:00
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:
parent
c2365653a5
commit
ce331cbcd5
Notes:
github-actions[bot]
2025-09-18 11:28:58 +00:00
Author: https://github.com/trflynn89
Commit: ce331cbcd5
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6221
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/konradekk
20 changed files with 62 additions and 170 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue