Browser hacking: Let's make "Cookie Clicker" playable in Ladybird!

Andreas Kling · 14K views · 2022 · 1:44:18

Open on YouTube

Web developmentSoftware practice, open source & careersCompilers, interpreters & program analysistutorial

Why Hacker News recommends it

HN loves the Browser hacking series for its clear debugging method of reducing bugs to minimal reproductions, which people say influenced their own testing.

What it is

In a long live-coding session, Andreas Kling works on making the Cookie Clicker game playable in the Ladybird browser from SerenityOS. He tracks down bugs in the browser engine and fixes them.

Recommended by 2 HN commenters across 2 different months, 2022 to 2024.

What Hacker News said

Strong rec hopfog · 2022-11 · on “Early stages of Google Docs support in the Ladybird browser”

I love Andreas Kling's "Browser hacking" series on YouTube where he fixes various issues Ladybird has with specific websites. E.g: Fixing a CSS layout bug found by chessboard.js - [LINK] Let's make "Cookie Clicker" playable in Ladybird! - [this video] He's very good at articulating his thought progress and it's always really interesting to see how he reduces the bug down into a minimal reproducible example.

Recommends jonhermansen · 2023-04 · on “We're building a browser when it's supposed to be impossible”

Of course you are correct that supporting Twitter or any service is a moving target, so long as it changes. But that doesn't mean specific bugs can't be captured in a test case. Watch this video of Andreas doing exactly this, albeit for a simpler web app [this video] At one point, he deletes half the HTML file to isolate where in the site the problematic code is. In a way doing a kind of binary search. After a few iterations of this, he comes up with a very small case that exhibits the problem he's trying to solve. It's clear he knows his way around the codebase and where to make changes, but isolating these test cases is probably as important. And presumably if you fixed enough of these issues (

Cites _gabe_ · 2024-08 · on “How I Program in 2024”

I can sympathize with the authors love/hate relationship with tests, but I can’t help feeling like it’s because we as developers so often test the completely wrong things. I don’t typically write tests, but they do make sense for a few cases (specifically end to end tests that look for well defined outputs from well defined inputs). I was inspired by Andreas Kling’s method of testing Ladybird, where he would find visual bugs, recreate the bug in a minimum reproducible example, fix the bug, then codify the example into a test and make sure the regression was captured in his test suite[0]. This led to a seemingly large suite of tests that enabled him to continue modifying the browser without f