Did you know...? LWN.net is a subscriber-supported publication; we rely on subscribers to keep the entire operation going. Please help out by buying a subscription and keeping LWN on the net. |
By Joe Brockmeier
June 7, 2024
Ladybird is an open-source project aimed at building an independent web browser, rather than yet another browser based on Chrome. It is written in C++ and licensed under a two-clause BSD license. The effort began as part of the SerenityOS project, but developer Andreas Kling announced on June 3 that he was "forking" Ladybird as a separate project and stepping away from SerenityOS to focus his attention on the browser completely. Ladybird is not ready to replace Firefox or Chrome for regular use, but it is showing great promise.
Kling started working on SerenityOS in 2018 as a therapy project after completing a substance-abuse rehabilitation program. The SerenityOS name is a nod to the serenity prayer. Prior to working on the project, he had worked on WebKit-based browsers at Apple and Nokia. Eventually he made SerenityOS his full-time job, and funded the work through donations, sales of SerenityOS merchandise, and income from YouTube. (Kling posts monthly updates to his YouTube channel about Ladybird, as well as hacking videos where he walks through working on various components in the browser, such as the JavaScript JIT compiler.)
Taking flight
Kling announced the Ladybird project in September 2022. He said that the project started while creating a Qt GUI for SerenityOS's LibWeb browser engine. He decided to target Linux as well as SerenityOS so it would be easier for people to work on and debug while in Linux. In the post announcing his intent to work solely on Ladybird, he noted that he had been focusing all of his attention on the Linux version of Ladybird. With that realization, he decided to step down as "benevolent dictator for life" (BDFL) of SerenityOS so its development would not be held back:
Before anyone asks, there is no drama behind this change. It's simply recognizing that there have been two big projects packed uncomfortably into a single space for too long, and I'm doing what I believe will make life better for everyone involved.
Ladybird's governance is similar to SerenityOS. Kling is the
BDFL, with a group of maintainers (currently ten) who can
approve and merge pull requests. The contributing
guide notes that maintainership is "by invitation only and does not
correlate with any particular metric
". Project development
discussions are held on a Discord server
(account required).
Now independent, Ladybird has dropped SerenityOS as a development target, and has moved to its own GitHub repository. In addition, Kling has relaxed his self-imposed policy of excluding "not invented here" (NIH) code that had applied to SerenityOS, which means that the Ladybird project will be able to make use of existing libraries rather than writing from scratch.
Comparing the README file in the standalone Ladybird repository
against the README
file in the SerenityOS repository, the goal has
evolved from creating "a standards-compliant, independent web browser with
no third-party dependencies
" to developing an independent browser "using a
novel engine based on web standards
".
The changes to the section that enumerates the core libraries for Ladybird
provide some hints about Kling's plans
to use existing libraries rather than continuing to reinvent the
wheel. The core support libraries for the project include homegrown
libraries for cryptography, TLS, 2D-graphics rendering, archive-file
format support, Unicode, as well as audio and video playback.
In the pre-fork documentation, they are described
as alternatives to other software. For example, Ladybird's TLS (LibTLS)
and cryptography (LibCrypto) libraries are "Cryptography primitives
and Transport Layer Security (rather than OpenSSL)
". The "rather
than" language has been removed in the journey to the standalone
repository, and the LibSQL library from SerenityOS has already
been stripped out in favor of sqlite3.
In a discussion in the project's Discord instance on June 5, Kling indicated that font rendering would likely be replaced with a third-party library. A user asked on June 6 what would determine whether a component would be developed in-house versus using a third-party library. Kling responded that if it implements a web standard, "i.e DOM, HTML, JavaScript, CSS, Wasm, etc. then we build it in house." Otherwise, the project would look to alternatives "unless we believe we can build something better ourselves".
Status
Ladybird is still in early development ("pre-alpha") today. It currently runs on Linux, macOS, and other UNIX-like operating systems. It's also possible to use on Windows with Windows Subsystem for Linux (WSL) version 2, but there appears to be no effort to target Windows independently at this time. At the moment, the project does not provide binaries for any platform. Interested users will need to grab the source and follow the build instructions. Users will need GCC 13+ or Clang 17, and Qt6 development packages to play along at home. Ladybird compiles and runs on, for example, Fedora 40 without a problem, but it is a long way from being suitable for regular use.
One might expect that the browser would be more usable with sites with simpler layouts and little to no JavaScript (e.g. LWN) than those with complex layouts and a fair amount of JavaScript (e.g. GitHub). However, this isn't always the case—Ladybird rendered GitHub and many other sites well, if slowly. Browsing LWN anonymously worked well, but logging into LWN, however, consistently proved to be too much for the application. Each time, it basically froze on the front page and clicking links to articles did nothing.
Somewhat ironically, it was not possible to log into Discord using Ladybird. It does a fair job of rendering pages, but speed and stability are still wanting. Each Ladybird tab has its own render process, which is sandboxed as a security measure to prevent any malicious pages from affecting the rest of the system. However, it doesn't seem to suffice to keep a single page from crashing the browser entirely. That's to be expected from a project that's still considered pre-alpha, though.
The current feature set is, not surprisingly, minimal. Ladybird has a URL/search bar, reload, tabs, can zoom in/out on content, take screenshots, and (of course) has backward and forward navigation. It does not, however, have bookmarks, a history display, extensions, password management, printing, or even the ability to save an image. WebRTC does not seem to be supported yet. CSS support seems relatively robust. Ladybird passes 100% of the CSS Selectors tests for levels 1-3, for example, using this test. It gets a 53% score for level 4, while Firefox gets 71%, so not a terrible showing at all. JavaScript support seems solid, but slow: the examples here work, but they load slowly.
On the other hand, Ladybird does have tools for developers, such as inspectors for the document object model (DOM) tree and accessibility trees, as well as the ability to create dumps of various things: the DOM tree and layout tree, computed styles, and so forth. It also has the ability to spoof the User-Agent sent by the browser so that testers can try to get around sites that refuse to work with "unknown" browsers. However, toggling the User-Agent wasn't enough to get past Google's gatekeeping to sign into Gmail—but it's unclear if that meant Ladybird wasn't sending the string correctly or if Google is using other means to fingerprint non-approved browsers.
Suffice it to say, Ladybird is not ready for mainstream use but it does show potential. In the past month, the project has had more than 880 commits from 49 authors. If the project maintains that kind of momentum, or picks up steam, it could become a usable alternative to mainstream browsers before too long.
(Log in to post comments)