Now You Can Play Half-Life 2 In Your Browser While Waiting For Half-Life 3
Here's the story: "slqnt", pronounced "slant", is the handle of an industrious high-school-aged hacker who says he's been programming for "about five years now." As a learning project, he decided to port Half-Life 2 to browsers. That sounds like an insane endeavor for a highschooler to tackle as a hobby project, but the mad lad pulled it off, so apparently not. That said, he didn't do everything himself.

As he explains in his blog post, much of the hardest work was already done for him. Github user "weliveinhell" had already ported the original Portal to browsers, and that work was in turn based on the 2018 Team Fortress 2 source engine code leak. Our HL2 hacker, slqnt, simply started by taking the Portal code and trying to load the HL2 assets into it. That didn't actually work, but like any good hacker, he dug in his heels and put in the time to diagnose and fix the issues one by one.
His blog post (linked below) goes into more detail, but the short version is that after fixing a succession of annoying bugs and asset problems (including that the assets from the current build of HL2 on Steam are too new to use in this old engine version, broken water shaders, and things like medkits not working), he has a mostly functional port of Half-Life 2 that runs in modern browsers with WebGL2 support with great performance; the integrated graphics on my Ryzen 9 9900X are able to propel it to a nearly locked 160 FPS vsync in 1080p, even with 2x MSAA.

I say "mostly functional" because the port does have some issues. For example, face morphing isn't enabled, so there's none of the impressive facial animations, and characters are creepily missing their eyes due to "broken shaders that [slqnt is] too lazy to actually fix." All of the in-game videos are broken, too, so for example, when Barney calls Dr. Kleiner in the intro sequence, nothing actually appears on screen. The iconic giant screens showing Dr. Breen around City 17 are nonfunctional, too, as are basically any surface that relies on a Bink video; browsers can't play back Bink videos, so the videos simply don't play.
Still, it's kind of impressive that it works at all, and it does mostly work. You can absolutely play the game, apparently all the way through. Slqnt fixed numerous issues in later parts of the game, like a problem where Alyx wouldn't actually give you the gravity gun in the junkyard, soft-locking the story at that point. Of course, there's still no key binding support, and audio playback was also kind of buggy in Brave browser for me.
The "legally dubious" part we mentioned earlier comes from the fact that the web server is serving players the Half-Life 2 assets, all of which are obviously copyrighted, as well as from the fact that this port, like the Portal port before it, is based on leaked (read: stolen) source code. Valve hasn't taken action against the leaked TF2 engine source yet, which has been up on Github for at least six years, but it might feel differently about this project since it actually contains and distributes the Half-Life 2 assets.
You can head over to slqnt's website if you'd like to fool around with HL2 in your browser, or head over here if you want to read his blog post detailing his troubles in porting the game. He says he's working on Half-Life 2 Episodes 1 and 2 next, which is admirable, but this gamer thinks that maybe he should get the rest of HL2 working before he moves on.
