Tobias Alexander Franke

Redirect everything

The web is terrible: Redux

The screams are getting louder, but the solutions keep getting dumber.

I know that my background as a graphics programmer is adding heavy bias to my point of view, but I really do not send data-oriented design lectures from Mike Acton to random Electron-app developers because I think their code is slow. Nevertheless, corporate web programmers have collectively given up on the notion that there is something called efficiency. (No time for a good rant? Go to the TL;DR!)

Case in point: Most news websites have tiny irrelevant content that hides between full-screen ads, newsletter popups, cookie warnings, autoplaying videos, and Javascript yanking mouse control away from you to add custom scrolling behavior. Look, for instance, at the following capture from Andrej Karpathy.

Browsing the web, 2021

Of course this browser-violation is just the tip of the iceberg, as there is more code that is running in the background, streaming ever more useless stuff to the machine. Here is a sample captured by Lunasorcery.

Imagine getting paid for writing software like this!

Think about just how much all of this, per tab, eats into your CPU time for no good reason, heats up the machine and drains battery of your mobile device, even if you do absolutely nothing on that page. Soon mobile 4G won’t provide adequate bandwidth to load a simple news article anymore. Part of the problem here is that modern web design is a lazy pieced together conglomerate of hilarious libraries such as the is-odd node module.

A modulo operation, web-style! A modulo operation, web-style!

The pyramid-scheme continues with an even greater absurdity, also known as the is-even node module, which relies on - you guessed it - is-odd. To put that into perspective: is-even loads 254 bytes in addition to is-odd loading another 543 bytes for essentially this operation (n % 2) == 0 (12 bytes), or 6641% of the necessary bytes to load. You can imagine how the rest of your average page looks like. If you believe this is just an elaborate prank or a contrived example, I present to you a sample of this being used in a glob matcher/parser before someone had the decency to remove it, make a mistake in the process and summon the comment from hell.

So here we are, with your browser wading through mountains of garbage, to display a simple piece of text to you. One way to deal with this is to fully embrace Stockholm-syndrome and just pay the ransom some of these sites demand from you to make the pain go away. Then there are a variety of tools that have been introduced to combat these issues, ranging from reader-views built into browsers, using Readability services (just read that out loud) such as Wallabag, Pocket or Instapaper, or simply adding dozens of plugins into your browser to make pages look sane such as user scripts like GreaseMonkey and user stylesheets like Stylus to, and I quote:

Redesign your favorite websites

However, all of this trickery will still not get the major problem under control: Browsers need ever more powerful machinery to display the most mundane content to you.

Never fear, the age of cloud is here! So why not put the browser on a different machine that is 10x more powerful and STREAM what you see to your machine, that extra-layer will solve it!

Architecture Astronaut hard at work Architecture Astronaut hard at work

Turns out that this idea is still a tad bit too ludicrous to be implemented these days, so lucky for us this project is dead.

RIP ... and may you stay dead forver RIP ... and may you stay dead forver

Let’s recap where we are right now:

  • Your browser is as complex as an operating system
  • Browser complexity is the source of many security issues
  • (Corporate) websites abuse browser complexity at every opportunity
  • Even if you counter the abuse with layers and layers of tools, the issue is getting worse over time
  • There is no incentive for cooperations to reverse course
  • New programmers are born into habits of being as inefficient as possible

The alternative

My number one suggestion is to leave most of the web entirely and pipe as much content as you can through RSS.

However, that doesn’t take care of individual URLs and sites that simply don’t have an RSS feed. Every day someone sends me a link to one of the various horrible social media sites that I need to then open in a browser.

This is where a new open-source trend comes to the rescue: The Alternative Frontend movement. Alternative frontends, as the name suggest, are websites that provide a different frontend to an existing webpage.

For instance, Invidious is a popular alternative frontend for Youtube. It provides access to anything on Youtube, however in a much cleaner interface with much less clutter, no ads, zero tracking and directly downloadable MP4s in place of the video streaming.

Right now there are many frontends to popular websites that extract their content and present it in a much saner way. These include Youtube, Twitter, Reddit, Tiktok, Imgur, Reuters, Quora, IMDB, Medium, Google, Stack Overflow, Fandom Wiki, Snopes… the list keeps growing, because most of the original pages are terrible.

A lot of these alternatives will use either public APIs or scraping to fetch the content of the original page and display it to you, but those details are not important.

This way please

One key question for me is how to use these frontends in a manner that is not intrusive, easy to use and allows me to open random links and get the best possible result.

The easiest way I have found is to use a redirector plugin for your browser. These plugins will detect a URL you enter into the browser, match it with a regular expression, and if a match has been found, replace it with another.

For instance, you might detect the pattern https://www.youtube.com/* and replace it with https://invidious.fdn.fr/$1.

A URL to https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw (the 3Blue1Brown channel) will therefore be redirected to https://invidious.fdn.fr/channel/UCYO_jab_esuFRV4b17AJtAw.

These plugins allow you to add multiple patterns for multiple webpages. I have created a configuration you can simply import without the need to add all these patterns by hand, which is available here.

Redirector plugins for Firefox/Librewolf/Torbrowser

  • Redirector - General purpose redirector you can customize yourself
  • LibRedirect - Redirector to popular alterantive frontends, highly configurable
  • Privacy Redirect - Redirector to popular alternative frontends, but limited in scope

Redirector plugins for Safari

  • Redirect Web for Safari - General purpose redirector you can customize yourself (can load exported Firefox Redirector JSON)
  • Privacy Redirect - Redirector to popular alternative frontends, but limited in scope

Load-Balancing

Many of the alternatives are hosted privately by volunteers and are called instances, which means there isn’t one URL for one alternative, but many. This decentralization acts as a safety net: Banning one doesn’t bring down the service itself and distributes the load.

As an example, there are many Invidious instances available. However, using one of them exclusively has two downsides:

  1. It might stop working, get banned, rate-limited or shut down
  2. If many users pile on one instance, it will be overloaded and most likely rate-limited more quickly

To solve this issue, ideally recognizing a pattern should redirect to a random instance instead of a fixed one, so that the load distributes equally across all hosted instances and prevents cases of rate-limiting or banning of an instance. This would need two things: For each alternative frontend a list of all available instances that is up to date, and the ability to forward to randomly selected URLs. The forwarding though is the problem.

A solution to this comes in the form of redirecting-gateways such as Farside. It’s a simple page that lists frontends and their instances. For each frontend, there is one link at the top of each section which will forward you randomly to one of the instances. You can configure your redirector to forward your URL to use those as targets instead.

As an example, instead of redirecting https://www.youtube.com/* to https://invidious.fdn.fr/$1, you may want to redirect it to https://farside.link/invidious/$1, which will select a random Invidious instance and attach your $1 parameters to it.

I provide a simplified, self-hostable redirector-gateway called Tzeentch which is heavily inspired by Farside, but simpler to deploy. You can check out a demo instance here. It also adds a feature absent in Farside, which is to create a ready-made configuration for your redirector for all the frontends you select.

LibRedirect on the other hand maintains an internal list of instances where you can select one or more favorite ones that it chooses from randomly, but this is connected to a bit of manual labor every now and then.

Conclusion

The battle for a cleaner, saner and less intrusive web is lost.

Alternative frontends remove the need for a barrage of plugins to sanitize the web, are privacy-friendly and just generally provide a better experience. Redirector plugins using gateways which distribute the requests among frontend-instances will ensure decentralization and reduce the likelyhood of instances getting rate-limited or banned.

I highly encourage you to redirect everything and check out this way of browsing! Just take a look at LibReddit and compare it with Reddit itself, for instance on a phone. Ask yourself: Is this better than the original?

2024-04-13
Commentary RSS

Engine Design as a Holistic Adventure

Most listeners know that Huawei isn’t just a mobile phone company. But many might not realize that it runs a global network of research institutes that are working on optimizing engine development. Tobias Alexander Franke, principal game engine architect at Huawei, talks with Royal about why the company prefers working...

Continue reading on external page

2022-10-21
O3DE Architecture Open Source

Interview with the Irish Times

I have been interviewed by the Irish Times on the topic of the Metaverse, what it is, why one would be interested in it, the big problem it is supposed to solve and how it will affect our lives. In this interview, I give a sober analysis of the Metaverse,...

Continue reading on external page

2022-07-21
Metaverse Crytpocurrency

A New Gaming Eco-system for Huawei

Cloud-based gaming services have seen varying success in practice. Where-as multiplayer games feature a wide variety of aspects which are hosted remotely, most games today run exclusively on one device and require the customer to adapt to new hardware requirements in regular cycles, usually tied to the current console generation....

Continue reading

2022-07-07
Conference Publication

Scalable Global Illumination for O3DE

Implementing global illumination for games at scale (on mobile devices and up to high end PCs) is a hard problem. O3DE currently uses DDGI as a solution to provide both baked and real-time global illumination. However several key issues need to be addressed before this system is ready for production....

Continue reading

2021-10-12
Conference Publication