Mackenzie's Site (http://159.223.118.101/blog/2015/12/13/line-mode-progressive-enhancement.txt) Line Mode Browser, or progressive enhancement all the way back ============================================================== Progressive enhancement is a development strategy meant to provide older and / or less capable browsers with a working website while providing the more capable with a rich, full experience. It is often presented as a set of layers of support, with HTML at its base, then CSS added to that for styles, then JavaScript for advanced behavior. With this, it's often posited that a well-crafted HTML experience can be used by any browser. However, for really old browsers from the early web, the new web provides many things that can make pages difficult to read, functionality unusable, or even entire sites inaccessible. Today, I'm going to go back as far as I reasonably can in terms of browser support, to the second web browser ever made, and the first widely supported one, [Line Mode Browser](https://en.wikipedia.org/wiki/Line_Mode_Browser). I can't look at the first, [WorldWideWeb](https://en.wikipedia.org/wiki/WorldWideWeb), because it was only made for NextStep and, as far as I can tell, isn't accessible for me to test with. Line Mode is though. It was open-source by the [w3c and kept available](http://www.w3.org/LineMode/). I was able to get it with [MacPorts](http://macports.org/) with the 'libwww' package (run as `www` on the command line). Line Mode was based on WorldWideWeb, and in fact was less featured, so it is likely to have any issues WorldWideWeb has and more. I will look at some issues that Line Mode has with modern web pages, and provide some solutions that will improve the abilities of even the oldest browsers to use a page. Note: In 2013, an \[in-browser simulation of Line Mode\](http://line-mode.cern.ch/www/hypertext/WWW/TheProject.html) was created. It uses the rendering engine of the browser you are using, but uses JavaScript to modify the markup of the page it is displaying to more closely match how Line Mode would display things, so many of these problems will not exist. You need the actual binary to see them. HTTPS everywhere (it's supported) --------------------------------- ### Problem [HTTPS](https://en.wikipedia.org/wiki/HTTPS), the protocol for encrypting web traffic, wasn't created until 1994 and even then took a while to be formally specified. Line Mode and other early browsers don't support it at all. They simply won't be able to load sites that are only available over HTTPS. They will not be able to access any content at all. Line Mode just displays nothing, freezes, or exits. Banks, eCommerce, and other sites with "sensitive" information have long used HTTPS, but calls have been increasing for its use elsewhere. "HTTPS everywhere" is becoming a common mantra. The idea is that governments / others can track what users are viewing or even inject / rewrite content when using HTTP. It is common for HTTPS sites to do a 301 redirect to HTTPS when accessed over HTTP. For non-"sensitive" activities, it might be a bit heavy handed to block older browsers. [Wikipedia, for example, forces HTTPS](http://blog.wikimedia.org/2015/06/12/securing-wikimedia-sites-with-https/), and will not load on old browsers (even ones that do support HTTPS but not new enough hashing algorithms). It's a bit disappointing that such a significant general source of information wouldn't be accessible at all to some browsers. ### Solution If you want to support non-HTTPS capable browsers, you have to provide HTTP access. This means either not redirecting to HTTPS or providing an HTTP capable subdomain (though users would have to know about this). You can tell modern browsers to use HTTPS without a 301 redirect using HSTS. It's sort of like a more powerful 301 redirect for modern browsers, but is ignored by non-supporting browsers. [HSTS](https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security) will tell modern browsers to use your HTTPS site, but only after they've visited it once. JavaScript can be used to force a redirect to HTTPS by checking if the browser can successfully make a connection, thus progressively enhancing. See \[my newer post about this\](http://159.223.118.101/blog/2019/09/30/forcing-https-progressive-enhancement.md) for details. Modern browsers will end up at the HTTPS site, while early browsers like Line Mode, which don't understand JavaScript, will get HTTP. If desired, you can put a message on all pages when browsing over HTTP (for instance, by checking `$_SERVER['HTTPS'] !== 'on'` in PHP) that tells them they are visiting the insecure version of the page and pointing them to the secure version. That way you users can still access it, but are informed about the option of security if they want it. Generic elements ---------------- Tags that browsers do not understand are treated as what I will call generic elements. In essence, they are treated like a `
` or ``, with their text content displayed generically. This is one of the biggest helps to progressive enhancement, because old browsers will still get text content even if it isn't displayed in the way newer browsers handle it. New elements are set up to take advantage of this, having a fallback that displays in browsers that don't understand the element. For instance, in the `