mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-31 07:22:50 +00:00
This allows the user to store custom search engines via about:settings. Custom engines will be displayed below the builtin engines in the drop- down to select the default engine. A couple of edge cases here: 1. We currently reject a custom engine if one with the same name already exists. In the future, we should allow editing custom engines. 2. If a custom engine which was the default engine is removed, we will disable search rather than falling back to any other engine.
25 lines
483 B
C++
25 lines
483 B
C++
/*
|
|
* Copyright (c) 2023-2025, Tim Flynn <trflynn89@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Span.h>
|
|
#include <AK/String.h>
|
|
#include <AK/StringView.h>
|
|
|
|
namespace WebView {
|
|
|
|
struct SearchEngine {
|
|
String format_search_query_for_display(StringView query) const;
|
|
String format_search_query_for_navigation(StringView query) const;
|
|
|
|
String name;
|
|
String query_url;
|
|
};
|
|
|
|
ReadonlySpan<SearchEngine> builtin_search_engines();
|
|
|
|
}
|