kbz.se - Compatibility
Modern web browsers do a great job allowing old sites to still work (websites from the 90s are still viewable in your browser today!), but modern websites rarely do the same work to make themselves viewable in old browsers. Which means that if you have an old device with an old web browser on it, the internet won't work for you - because the web developers don't care about you (you're just 1% in their statistics, even if you're 100% of a person like everyone else). I don't know if it's this way by purpose, but this is one of the ways technology companies and software producers abuse you as a user.
My goal is to try to make my games work with all web browsers who support WebGL 1 on all hardware that supports WebGL 1. That at least makes my games playable on most mobile devices and computers from 2012-2014 and onwards. Imagine that instead of buying a new game console for hundreds of dollars and games for almost a hundred dollars, you could get that old computer that has stopped functioning with modern software back from your basement, and turn it into a game machine that can play kbz.se games. Imagine how much less hardware we could buy and how much less material the world would waste if we didn't need to buy new devices to play interesting and fun games!
To achieve this, there are a couple of modern web browser features you have to live without. You have to rely on timeless and proven concepts in HTML and Javascript, and not use WebGL versions over 1. Some features will work in Chrome, Firefox and Edge, but maybe not in Safari (and the other way around), so we can't use those features either.
You can't follow what _should_ be the right thing to do in theory. The standards say one thing, and web browsers try (or don't try) to follow these standards, but they never follow them to 100%. What the web browsers actually end up implementing is the reality we have to adapt to. Web browsers don't want to break old websites, even if the old features these sites use are by definition "deprecated" in the standards, and it can take a long time for them to implement stuff from the standards, if they ever do it. And Google could suddenly add something to Chrome that no one asked for, and since Chrome (at least in 2025 when this was written) pretty much controls the web, the other browsers have to follow them and add that thing as well, even if it isn't technically in the standards. This for example results in some features that are technically deprecated (like the HTML tag "font") being among the most dependable features of all.
On this page I try to capture the reality of web browsers and what you can depend on and what you can't depend on. Here's what I've found not to work:
HTML
* "details" tag - use worse Javascript functions instead?
* "button" tag - use "div" instead. because of iPhone or something?
CSS
* image-rendering: pixelated - resize the image so it's bigger and looks pixelated naturally, or just render the image "normally"
* overflow-wrap - use word-wrap instead
Javascript
* let, const - use only "var" instead
* class, and other object oriented stuff - don't use it
* new URLSearchParams()
* document.createElement().href = "text" - use document.createElement().setAttribute("href", "text") instead
* function hej(x = 3) - set default values in the function body instead
* navigator.vibrate() - don't use
* performance.now() - use Date.now()
* WebAudio API - use normal HTML Audio (var sound = new Audio("file")) as fallback. It won't loop smoothly like WebAudio API so I'd still recommend WebAudio API for music if it's available
WebGL
* pointsize in WebGL - max allowed pointsize varies on different platforms and implementations. Use planes made of triangles instead of pointsprites, at least if the sprites cover a larger part of the screen
* WebGL 2 and above - use WebGL 1 ("experimental-webgl")
* WebGPU - don't use it
Others
* TTF file format - has to be set to "installable" to work in IE11
(You also have to tweak the performance of your game to make it run smoothly on those old devices. The best method in my opinion is to test on different types of real hardware, and keep everything simple (both when it comes to programming, game scope and file sizes). I won't describe this in more detail here.
And since some of those old browsers won't support newer HTTPS versions, you have to allow TLS 1.2 (HTTPS) or plain HTTP, which is a difficult problem for me if I want to continue hosting my games on Neocities. If I use my own servers it's easier to solve, but I'm not there yet.
Read more on kbrecordzz.com:
https://kbrecordzz.com/2023/03/21/the-console-feeling
https://kbrecordzz.com/2024/11/writing-web-code-in-a-normal-way
https://kbrecordzz.com/2024/11/making-backwards--and-forwards-compatible-web-programs)
<- Back