Commit graph

3280 commits

Author SHA1 Message Date
Luke Wilde
8dc8835b64 LibWeb+LibWebView+WebContent: Allow muted media to autoplay by default
The autoplay setting was binary and its default blocked all media,
including muted video, leaving sites that rely on muted autoplay
visibly broken. Replace it with a tri-state user-agent autoplay
policy (allow audio and video, block audio, or block audio and video)
defaulting to allowing only inaudible media to autoplay.

This is enforced through the media element's "allowed to play" check,
so unmuting a muted autoplay or calling `play()` cannot slip audio
past the policy; audible playback is permitted once the document has
been activated by the user. The policy lives in a dedicated
AutoplaySettings consulted from HTMLMediaElement instead of the
Permissions Policy "allowed to use feature" check it was previously
conflated with.
2026-06-19 09:41:32 +02:00
Jelle Raaijmakers
d819152b4e LibGfx+LibWeb: Preserve text color for selections
Selecting text without custom ::selection styling changed the
foreground color of the selected content. This was especially visible
for links, where the text changed color but the underline did not.

The default selection style supplied both a selection background and a
foreground color from the palette or HighlightText system color. That
made ordinary selections behave as if the page had explicitly styled
::selection color.

Only provide a default selection background, so selected content keeps
its own foreground color unless CSS overrides it. Remove the now-unused
SelectionText palette role.
2026-06-18 22:43:26 +02:00
Tim Ledbetter
61bba95948 UI/Qt: Autofocus the about:history search input 2026-06-17 12:31:07 +02:00
Timothy Flynn
66c93b5288 LibWebView: Elide overflowed title text on about:history
If the title was one long string without any whitespace, it would have
previously "escaped" its content box.
2026-06-11 09:18:17 -04:00
Timothy Flynn
7f9f01b4d8 LibWebView: Change the hover color of about:history rows
After some cleanup, this accidentally ended up being the same color as
the hover color of the 3-dot menu to the right of the row. That made
hovering the menu button appear to have no distinction.
2026-06-11 09:18:17 -04:00
Timothy Flynn
496c88d0c9 LibWebView: Add about:history to view, query and mangage browser history
This adds a WebUI to view the local browsing history, with controls to
search and delete entries. The APIs used to search history are paginated
to prevent excessive query sizes.
2026-06-10 20:27:36 +02:00
Timothy Flynn
e9fb8afb21 LibWebView: Extract 3-dot menu styling to webui.css
This will be used by an about:history page.
2026-06-10 20:27:36 +02:00
Timothy Flynn
3b46b0bf09 UI/Qt: Add a setting to expand collapsed vertical tabs on hover
This as a pesudo third mode to vertical tabs. Now when the vertical tabs
are collapsed, users can enable a setting that will expand the vertical
tab area on hover. Unlike full expansion, the hovered vertical tab area
will cover the web content area to avoid pushing the web content area
around.
2026-06-02 07:57:05 -04:00
Timothy Flynn
aa017ef980 Base: Add a favicon to all internal about: pages
The UI no longer uses the Ladybird icon as a fallback for pages with a
missing favicon. That included our own internal pages, where it makes
sense to use the icon. So let's specify it explicitly.
2026-06-01 21:10:31 -04:00
Timothy Flynn
f0ac723539 LibWebView: Add settings and actions to control vertical tabs
This adds a setting to enable vertical tabs and to expand/collapse them
if enabled. This setting is hidden for UIs that do not support them
(which is every UI as of this commit).
2026-05-31 21:24:57 +02:00
Andreas Kling
2ace898858 UI/Qt: Stop using TVG icons
Draw the remaining Qt chrome icons through the existing generated icon
path instead of loading TinyVG resources. Add generated folder and
chevron icons for menus, the bookmarks bar, and find-in-page controls,
and use the generated globe icon for bookmarks without favicons.

Remove the Qt TinyVG icon engine and drop the unused TVG resources from
the Qt resource file.
2026-05-31 19:20:59 +02:00
Timothy Flynn
d41099d204 LibWebView: Show the advanced config title above its full key path
Subjective, but this reads slightly better.
2026-05-29 10:46:27 -04:00
Andreas Kling
ff26662256 UI: Remove unused menu icon resources
Drop the PNG resources that were only used for menu action icons.
Keep the app icons and directory listing icons that still have direct
resource references, and stop copying the now-empty browser icon set.
2026-05-27 22:05:54 +02:00
Timothy Flynn
6c24e536ba LibWebView: Use the same search box styling for setting and bookmarks
We have a nicely styled search bar on about:bookmarks; let's extract and
use that for about:settings#advanced.

In the future, it'd be nice if we could avoid the SVG duplication here,
perhaps with some templating, but it's not a huge deal.
2026-05-27 15:52:10 -04:00
Timothy Flynn
a3e6335afa LibWebView: Properly hide filtered advanced settings
The gap between card groups and their separators would still paint when
one of the groups were hidden. We now only add the gap/separator between
unhidden groups.

We must also add !important to the `hidden` class to ensure it overrides
other class rules (it was previously resolving with `display: flex`).
2026-05-27 15:52:10 -04:00
Timothy Flynn
082281da62 LibWebView+UI: Disable primary paste on unsupported systems
A selection clipboard is not available on all systems. The UI now
controls whether this feature is available.
2026-05-27 13:33:44 -04:00
Timothy Flynn
fcc5f5917a LibWebView: Use existing CSS rules for advanced setting inputs
We already have classes to govern most of how the advanced settings were
trying to behave. More-so, the advanced settings checkboxes were placed
too central compared to all other settings, which are positioned further
to the right.
2026-05-26 17:57:37 -04:00
Timothy Flynn
73a5c2a14c LibWebView: Embed setting descriptions inside their respective labels
It feels much more natural to be able to click the description (as well
as the primary label) to activate an input control. This move makes some
CSS classes require a bit of margin tweaking to maintain their current
look (i.e. to not add or remove too much spacing).
2026-05-26 17:57:37 -04:00
Andreas Kling
5fef343164 LibWebView: Load content blocker lists from settings
Add a content_blocking.list_paths advanced setting backed by a JSON
array. This lets content blocker list paths avoid splitting one string.
The about:settings editor presents array values as one path per line.
It persists them as arrays.

Load configured paths before command-line paths so temporary lists can
still be appended for a single browser session.
2026-05-24 16:59:59 +02:00
Andreas Kling
5b324718ec LibWebView: Add JSON-backed config variables
Add a small registry for config variables backed by JsonValue defaults.
Persist values under configVariables and expose the registry through the
Advanced tab in about:settings so every key remains visible and
filterable.

Use the default JsonValue type for validation instead of maintaining a
parallel type enum.
2026-05-24 13:11:17 +02:00
Andreas Kling
46e1a08742 LibWeb: Rename ContentFilter to ContentBlocker
Rename the local content blocking implementation and its tests from
ContentFilter to ContentBlocker while keeping the existing substring
matcher backend and behavior.

Update the WebContent IPC method, WebView option names, debug toggle,
and default config file name to use content blocker terminology.
2026-05-21 21:16:56 +02:00
Timothy Flynn
af7b2b5e8a LibWeb+LibWebView+WebContent: Add a setting to control primary pasting 2026-05-15 15:47:39 +02:00
Timothy Flynn
b221d7fe8b LibWeb+LibWebView+WebContent+UI: Add an action to cut text 2026-05-07 09:13:06 -04:00
mikiubo
01f8f86ab9 LibWebView: Add search functionality to the bookmark manager
Add a search bar to the about:bookmarks page that filters bookmarks
2026-05-07 09:12:42 -04:00
Johan Dahlin
1454e90c93 Meta: Add vcpkg overlay port for pdf.js 5.6.205 2026-04-30 07:46:12 +02:00
Timothy Flynn
e1f731a514 Base: Format internal Ladybird pages with prettier
These are currently not checked by CI.
2026-04-22 11:22:08 -04:00
Timothy Flynn
6d063e2aa4 Base: Add about:bookmarks to about:about 2026-04-22 11:22:08 -04:00
mikiubo
131014427c LibWebView: Add bookmark import/export to about:bookmarks
Implement bookmark import/export in about:bookmarks using Netscape
bookmark HTML in JavaScript.
Import parsed items into BookmarkStore under an "Imported Bookmarks"
folder, and treat internal WebUI about: pages as potentially
trustworthy so SecureContext APIs are available there.
2026-04-22 08:02:15 -04:00
Timothy Flynn
06796f5f7f LibURL+LibWeb+LibWebView: Convert about:version to a proper WebUI
Passing the browser command line and executable path to every WebContent
process just in case we load about:version always felt a bit weird. We
now use the WebUI framework to load this information on demand.
2026-04-21 06:59:11 -04:00
Nicolas Danelon
ea22c19ab3 Base: Improve about:version and about:processes
This patch updates the about:version page to use the shared Ladybird
WebUI styling and present version, build, and runtime details in cards.

It also adds the Ladybird logo and a page title to about:processes,
without otherwise changing the process table behavior.
2026-04-19 22:53:59 +02:00
Andreas Kling
c249f0324b LibWebView: Let Settings clear browsing history
Route the existing Clear Browsing Data dialog through HistoryStore's
time-range deletion path as well. That makes the Settings action
remove visited pages from persisted history and from history-backed
address bar suggestions instead of only touching cache and site data.

Add a history checkbox to the dialog, thread its state through the
Settings WebUI message, and cover remove_entries_accessed_since() for
both transient and persisted stores in TestHistoryStore.
2026-04-16 21:01:28 +02:00
Timothy Flynn
79893b9cef LibWeb+LibWebView+WebContent: Add a setting to control autoscrolling 2026-04-13 13:01:45 -04:00
Timothy Flynn
b544e42809 LibWebView+UI: Add an about:bookmarks page to manage bookmarks
This page renders the bookmarks as a tree and hook context menu events
up to the UI's bookmarks bar context menus to allow editing bookmarks.
Users can also drag-and-drop bookmark items around.
2026-04-09 10:08:06 -04:00
Timothy Flynn
6bf2279dfe Base: Extract some about:settings CSS classes to a common file
We will re-use the card classes in about:bookmarks.
2026-04-09 10:08:06 -04:00
James Raspass
a629317840 Base: Use native light dismiss for settings dialogs
Rather than rolling our own JavaScript to detect clicks outside of the
dialogs and close them we can set the closedby attribute to "any" which
will do the same thing.

This should also handle platform-specific user actions like pressing the
Escape key but this doesn't currently work so keep our JavaScript to
handle that and add a FIXME.
2026-04-07 21:27:50 -04:00
Timothy Flynn
746448f8e0 Base: Support opening a specific settings tab via anchors
For example, about:settings#privacy will now open the settings page to
the Privacy tab.
2026-03-05 10:00:32 -05:00
Timothy Flynn
57f7f22e91 Base: Add a button to reset the new tab page URL
This button resets the URL back to about:newtab.
2026-03-05 10:00:32 -05:00
Timothy Flynn
809ef1ac6e Base+LibWebView: Organize the settings page into tabs
The tabless page with an ever-growing list of vertical cards was getting
a bit disorganized. This moves each section of the settings page to be
its own tab, with buttons to switch tabs. Some of this presented the
opportunity to migrate settings from popup dialogs to be directly in the
tab, such as the disk cache settings.

The global "restore defaults" button has also been removed. The more
settings we have, the less sense such a button makes sense. Individual
settings can have a reset option where it makes sense.
2026-03-05 10:00:32 -05:00
Timothy Flynn
ae8181b467 LibWeb+LibWebView+UI: Add a context menu item to toggle fullscreen state 2026-03-01 15:41:43 -06:00
Jelle Raaijmakers
73658137b6 Documentation+Tests: Optimize PNGs using optipng
The wide gamut test file went unused, so it was deleted.
2026-02-23 13:45:04 +01:00
Timothy Flynn
7d60d0bfb7 LibHTTP+LibWebView+RequestServer: Allow users to set disk cache limits
This adds a settings box to about:settings to allow users to limit the
disk cache size. This will override the default 5 GiB limit. We do not
automatically delete cache data if the new limit is suddenly less than
the used disk space; this will happen on the next request. This allows
multiple changes to the settings in a row without thrashing the cache.

In the future, we can add more toggles, such as disabling the disk
cache altogether.
2026-02-13 10:20:52 -05:00
Timothy Flynn
c5d666ea7b Base: Use title case in settings button
Matches our HMI guidelines.
2026-02-13 10:20:52 -05:00
Timothy Flynn
0bfa5f3e52 Base: Close settings dialogs when the escape key is pressed 2026-02-12 18:29:19 -05:00
Timothy Flynn
25b701296c Base: Remove FIXME from settings UI that won't be addressed
The idea here was to use popovers, which natively support dismissal via
clicking outside the dialog and pressing the escape key. However, unlike
modals, popovers do not make the rest of the document inert. And there
isn't a handy way to achieve this. So while a popover is open, you could
interact with elements behind the dialog, which we don't want.
2026-02-12 18:29:19 -05:00
Tim Ledbetter
e9519b132f Base: Use the correct memory unit suffixes in about::processes
Previously the GB suffix was displayed as BB.
2025-12-01 07:30:23 -05:00
Timothy Flynn
c80b698589 LibWebView+UI: Remove some now-superfluous debug menu items
No need to keep these actions around, users can use the about:settings
page instead.
2025-11-12 09:06:21 -05:00
Timothy Flynn
c34119cb29 LibWebView: Add a settings section to manage browsing data caches
This adds a section to allow users to clear the HTTP disk cache and
cookies / local storage / session storage. There are a few options to
limit this action to a specific time range (e.g. "last hour"). The
user is informed how much disk space is being used currently, and how
much will be removed given the selected time range.

The idea is that in the future, we can add more settings here to auto-
delete data on exit, disable caching altogether, etc.
2025-11-12 09:06:21 -05:00
Timothy Flynn
019c529c07 Meta: Increase the line length enforced by prettier to 120
This matches our coding style recommendation in CodingStyle.md, and
matches our python formatting.
2025-10-31 19:55:50 -04:00
Timothy Flynn
b4df857a57 LibWeb+LibWebView+WebContent: Replace DNT with GPC
Global Privacy Control aims to be a replacement for Do Not Track. DNT
ended up not being a great solution, as it wasn't enforced by law. This
actually resulted in the DNT header serving as an extra fingerprinting
data point.

GPC is becoming enforced by law in USA states such as California and
Colorado. CA is further working on a bill which requires that browsers
implement such an opt-out preference signal (OOPS):

https://cppa.ca.gov/announcements/2025/20250911.html

This patch replaces DNT with GPC and hooks up the associated settings.
2025-09-16 10:38:20 +02:00
InvalidUsernameException
08162fb9af LibWebView+Base: Remove unnecessary scrollbar from error pages
I've been looking at the crash-page too much recently and the slight
scrollbar caused by the padding has been annoying me.
2025-09-08 12:02:44 +01:00