Commit Graph

8 Commits

Author SHA1 Message Date
Timothy Flynn
fdbdb0ecd2 LibWebView+UI: Show an error page when we cannot sanitize a URL
Previously, if search was disabled, entering non-URL text would just
silently drop the search query (and on Qt, we would reload the current
URL). We now detect that the query did not result in a navigation and
load an error page instead, which directs the user to enable search.
2026-04-24 20:17:23 +02:00
Andreas Kling
bb9f789eae UI/Qt: Show rich, history-backed address bar autocomplete
Replace the old QCompleter-based popup with a custom list that renders
AutocompleteSuggestion rows with titles/URLs/section headers/favicons.

Parent the popup inside the window so it does not steal focus, route
keyboard and mouse activation through WebView::Autocomplete, and add
inline completion with backspace suppression and top-row selection.
2026-04-16 21:01:28 +02:00
sideshowbarker
16fd2ccee0 UI/Qt: Restore address bar URL when pressing Escape
When the user focuses the address bar and presses Escape, the original
URL is now restored. Previously, the address bar would show whatever
text the user had typed, or be empty if they had cleared it.

This matches the AppKit implementation and Chrome/Firefox behavior.

Fixes https://github.com/LadybirdBrowser/ladybird/issues/7264
2026-01-06 06:37:19 -05:00
Timothy Flynn
dbf4b189a4 LibWebView: Do not use AK::format to format search engine URLs
This is to prepare for custom search engines. If we use AK::format, it
would be trivial for a user (or bad actor) to come up with a template
search engine URL that ultimately crashes the browser due to internal
assertions in AK::format. For example:

    https://example.com/crash={1}

Rather than coming up with a complicated pre-format validator, let's
just not use AK::format. Custom URLs will signify their template query
parameters with "%s". So we can do the same with our built-in engines.
When it comes time to format the URL, we will do a simple string
replacement.
2025-04-06 13:45:10 +02:00
Timothy Flynn
60dd5cc4ef UI/Qt: Migrate to LibWebView's autocomplete engine
As a result, we now no longer depend on Qt::Network.
2025-04-02 08:52:45 -04:00
Timothy Flynn
e084a86861 LibWebView+UI: Introduce a persistent settings object
This adds a WebView::Settings class to own persistent browser settings.
In this first pass, it now owns the new tab page URL and search engine
settings.

For simplicitly, we currently use a JSON format for these settings. They
are stored alongside the cookie database. As of this commit, the saved
JSON will have the form:

    {
        "newTabPageURL": "about:blank",
        "searchEngine": {
            "name": "Google"
        }
    }

(The search engine is an object to allow room for a future patch to
implement custom search engine URLs.)

For Qt, this replaces the management of these particular settings in the
Qt settings UI. We will have an internal browser page to control these
settings instead. In the future, we will want to port all settings to
this new class. We will also want to allow UI-specific settings (such as
whether the hamburger menu is displayed in Qt).
2025-03-22 17:27:45 +01:00
Rok Povsic
026fc6c1ca UI/Qt: Add '.com' to the URL if CTRL is held while pressing return 2025-01-20 19:21:56 +00:00
Timothy Flynn
db47cc41f8 Everywhere: Move the Ladybird folder to UI 2024-11-10 12:50:45 +01:00