DEV Community

Cover image for Ladybird Browser in an Embedded Web Runtime
Jani Hautakangas
Jani Hautakangas

Posted on

Ladybird Browser in an Embedded Web Runtime

Originally posted on Medium


In my previous blog post, I showed how to build and create an experimental web runtime using Isar, Debian Bookworm, and WPEWebKit. In that post, I also mentioned that I had a Ladybird version incubating. Now it’s time to reveal it.

Ladybird is a completely new browser, built from scratch instead of relying on any existing browser codebases. It has its roots in SerenityOS, but has since diverged into its own project. The project is still in its early phases, so I didn’t expect much to work. To my surprise, it’s already rendering pages quite well. Even WebGL works!

Integrating Ladybird

Ladybird depends on components that aren’t available in Debian Bookworm, such as the Skia and ANGLE graphics libraries. For those, I created dedicated recipes.

It also requires newer versions of some Debian libraries that aren’t in Bookworm or its backports repository (e.g. libpng with APNG support). For those, I ended up creating a backports repository of my own.

Custom Debian Backports

I created a new GitHub repository, debian-backports, which includes a GitHub Actions workflow that downloads package source tarballs from upstream repositories and overlays Debian build rules.

The workflow uses QEMU to build both amd64 and arm64 versions of the Debian packages. Finally, it publishes the APT repository (created with reprepro) to GitHub Pages.

The repository is available at: kodegood.github.io/debian-backports

Isar/BitBake Recipes

As mentioned, I wrote new recipes for some dependencies like Skia and ANGLE, and then for Ladybird itself.

I also applied a couple of patches on top of Ladybird. The main one strips out the browser chrome from Ladybird’s UI, since that’s not needed in a web runtime.

Ladybird uses Qt as its UI library on Linux and Windows. For now, I simply commented out parts of the code, but since Ladybird has a web content view API, a better long-term approach would be to implement a separate lightweight Qt content view.

Isar image flow

Demo

The demo setup is similar to what I had with the WPE version

  • Debian Bookworm as the base platform
  • A slightly customized Weston IVI-shell
  • Ladybird browser, built from source
  • Hardware: Raspberry Pi 5

Known issues:

  • IME integration is not working, meaning no virtual keyboard
  • YouTube is not working. For now, Big Buck Bunny plays via a local page and local file using the video tag

Results

From the build configuration menu you can select Ladybird to be built.

KAS build menu

Finally, after flashing the image to the Raspberry Pi 5:

Note: This is just a tech demo, not a full production web runtime

If you’d like to try it, the project’s README has setup instructions.

The project is available on GitHub as webruntime-debian.

Top comments (0)