mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 23:59:49 +00:00
LibWebView: Don't provide autocomplete suggestions for file:// URLs
This commit is contained in:
parent
4e51e585a2
commit
e7f0126c2e
Notes:
github-actions[bot]
2025-07-18 09:59:11 +00:00
Author: https://github.com/treyshaffer 🔰
Commit: e7f0126c2e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5495
Reviewed-by: https://github.com/AtkinsSJ ✅
1 changed files with 4 additions and 1 deletions
|
@ -18,6 +18,8 @@
|
|||
|
||||
namespace WebView {
|
||||
|
||||
static constexpr auto file_url_prefix = "file://"sv;
|
||||
|
||||
static constexpr auto builtin_autocomplete_engines = to_array<AutocompleteEngine>({
|
||||
{ "DuckDuckGo"sv, "https://duckduckgo.com/ac/?q={}"sv },
|
||||
{ "Google"sv, "https://www.google.com/complete/search?client=chrome&q={}"sv },
|
||||
|
@ -46,7 +48,8 @@ void Autocomplete::query_autocomplete_engine(String query)
|
|||
m_request.clear();
|
||||
}
|
||||
|
||||
if (query.bytes_as_string_view().trim_whitespace().is_empty()) {
|
||||
auto trimmed_query = query.bytes_as_string_view().trim_whitespace();
|
||||
if (trimmed_query.is_empty() || trimmed_query.starts_with(file_url_prefix)) {
|
||||
invoke_autocomplete_query_complete({});
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue