1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:37:35 +00:00

Ladybird/AppKit: Support searching with a search engine in the URL bar

The setting for the search engine to use is currently ephemeral. Once we
have a settings dialog, we can implement this setting there, and persist
that setting.
This commit is contained in:
Timothy Flynn 2023-10-20 09:28:53 -04:00 committed by Tim Flynn
parent e7d977f58d
commit f885839ba5
3 changed files with 54 additions and 1 deletions

View file

@ -5,6 +5,7 @@
*/
#include <LibWebView/History.h>
#include <LibWebView/SearchEngine.h>
#include <LibWebView/URL.h>
#import <Application/ApplicationDelegate.h>
@ -638,8 +639,9 @@ enum class IsHistoryNavigation {
}
auto url_string = Ladybird::ns_string_to_string([[text_view textStorage] string]);
auto* delegate = (ApplicationDelegate*)[NSApp delegate];
if (auto url = WebView::sanitize_url(url_string); url.has_value()) {
if (auto url = WebView::sanitize_url(url_string, [delegate searchEngine].query_url); url.has_value()) {
[self loadURL:*url];
}