Commit graph

28 commits

Author SHA1 Message Date
Sam Atkins
0ed2e71801 LibWeb/CSS: Move and rename PseudoElement types to prep for code gen
The upcoming generated types will match those for pseudo-classes: A
PseudoElementSelector type, that then holds a PseudoElement enum
defining what it is. That enum will be at the top level in the Web::CSS
namespace.

In order to keep the diffs clearer, this commit renames and moves the
types, and then a following one will replace the handwritten enum with
a generated one.
2025-03-24 09:49:50 +00:00
Timothy Flynn
b169a98495 LibWeb+LibWebView+WebContent: Introduce a basic about:settings page
This adds a basic settings page to manage persistent Ladybird settings.
As a first pass, this exposes settings for the new tab page URL and the
default search engine.

The way the search engine option works is that once search is enabled,
the user must choose their default search engine; we do not apply any
default automatically. Search remains disabled until this is done.

There are a couple of improvements that we should make here:

* Settings changes are not broadcasted to all open about:settings pages.
  So if two instances are open, and the user changes the search engine
  in one instance, the other instance will have a stale UI.

* Adding an IPC per setting is going to get annoying. It would be nice
  if we can come up with a smaller set of IPCs to send only the relevant
  changed settings.
2025-03-22 17:27:45 +01: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
Timothy Flynn
daca9f5995 LibDevTools+LibWebView+WebContent: Selectively fetch DOM node properties
When we inspect a DOM node, we currently serialize many properties for
that node, including its layout, computed style, used fonts, etc. Now
that we aren't piggy-backing on the Inspector interface, we can instead
only serialize the specific information required by DevTools.
2025-03-20 09:01:26 +01:00
Timothy Flynn
942f26a846 LibWebView: Remove now-unused ProcessManager HTML generator 2025-03-19 10:03:17 -04:00
Timothy Flynn
843209c6a9 LibWeb+LibWebView+WebContent: Add an about:processes page
The intent is that this will replace the separate Task Manager window.
This will allow us to more easily add features such as actual process
management, better rendering of the process table, etc. Included in this
page is the ability to sort table rows.

This also lays the ground work for more internal `about` pages, such as
about:config.
2025-03-19 10:03:17 -04:00
Timothy Flynn
e00c0c176e LibWebView+UI: Rename ChromeOptions to BrowserOptions 2025-03-15 19:57:27 -04:00
Timothy Flynn
df7917d705 LibWebView: Change the DevTools server to be a runtime-enabled feature 2025-03-15 19:09:40 +01:00
Timothy Flynn
0b86bcfba7 LibDevTools+LibWebView: Implement getting document style sheets 2025-03-13 16:56:28 -04:00
Timothy Flynn
cbefa797d4 LibDevTools+LibWebView+WebContent: Implement moving DOM nodes
This allows for click-and-dragging DOM nodes in DevTools to move them.
2025-03-11 09:50:51 -04:00
Timothy Flynn
01c44a5c66 LibDevTools+LibWebView+WebContent: Implement getting DOM node inner HTML
This is used by DevTools to copy the inner HTML to the clipboard.
2025-03-11 09:50:51 -04:00
Timothy Flynn
d75eadc3c4 LibDevTools+LibWebView+WebContent: Implement editing DOM node HTML
These commands are used for the "Edit As HTML" feature in DevTools. This
renames our existing HTML getter IPC to indicate that it is for outer
HTML. DevTools will need a separate inner HTML getter.
2025-03-11 09:50:51 -04:00
Timothy Flynn
aca4385daf LibWebView: Create a spare WebContent process
Since cross-site navigation is a pretty frequent task, creating a spare
process is commonplace in other browsers to reduce the overhead of
directing the target site to a new process.

We store this process on the WebView application. If it is unavailable,
we queue a task to create it later.
2025-03-11 12:10:42 +01:00
Timothy Flynn
5f76324af5 LibDevTools+LibWebView: Take advantage of IPC encoding improvements 2025-03-09 11:14:20 -04:00
Timothy Flynn
c4b1d2382a LibDevTools+LibWebView: Implement requests to clone DOM nodes 2025-03-08 01:25:55 +01:00
Timothy Flynn
ffd48e1d45 LibDevTools+LibWebView: Implement requests to create DOM nodes
This requires a couple of amendments to the DOM node serialization.
Namely, we need to include the HTML namespace, otherwise the context
menu item to create a new node is disabled.
2025-03-08 01:25:55 +01:00
Timothy Flynn
29122786b9 LibDevTools+LibWebView: Implement requests to delete DOM nodes 2025-03-08 01:25:55 +01:00
Timothy Flynn
bdb31b029a LibDevTools+LibWebView: Implement requests to edit DOM node tags 2025-03-08 01:25:55 +01:00
Timothy Flynn
17fb21169f LibDevTools+LibWebView: Implement requests to edit DOM node attributes 2025-03-08 01:25:55 +01:00
Timothy Flynn
57e0a3f8b5 LibDevTools+LibWebView: Implement requests to edit DOM node text 2025-03-08 01:25:55 +01:00
Timothy Flynn
8bcc3d3797 LibDevTools+LibWebView: Inform the DevTools client about DOM mutations 2025-03-08 01:25:55 +01:00
Timothy Flynn
ffdce78b7b LibWebView+WebContent: Implement basic DevTools console support 2025-03-04 15:33:39 -05:00
Timothy Flynn
32bc2dc7b6 LibWebView+WebContent: Begin supporting the DevTools JavaScript console
This supports evaluating the script and replying with the result. We
currently serialize JS objects to a string, but we will need to support
dynamic interaction with the objects over IPC. This does not yet support
sending console messages to DevTools.
2025-02-28 13:08:33 +01:00
Timothy Flynn
a76d0867d1 LibWebView: Support DOM node highlighting and inspection for DevTools 2025-02-24 12:05:29 -05:00
Timothy Flynn
dba6401260 LibWebView: Integrate the DevTools server into the WebView application
This adds a command line option to enable the DevTools server. Here, we
make the application the DevToolsDelegate to reply to requests from the
DevTools server about the state of the application.
2025-02-19 08:45:51 -05:00
rmg-x
ece611718d LibWebView+UI: Read and set echo server port in HttpEchoServerFixture
This commit adds a "echo_server_port" property to `WebContentOptions`.

Additionally, it makes `Application::web_content_options()` return a
mutable reference instead of a const reference so that we can set the
port value from the fixture.
2024-12-05 17:02:57 -07:00
Timothy Flynn
bb7dff7dfe LibWebView+UI: Move ownership of application services to LibWebView
LibWebView now knows how to launch RequestServer and ImageDecoderServer
without help from the UI, so let's move ownership of these services over
to LibWebView for de-duplication.
2024-11-14 11:47:32 +01:00
Timothy Flynn
93712b24bf Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Renamed from Userland/Libraries/LibWebView/Application.h (Browse further)