Lean Linux web browsers

George Tsartsianidis, 123RF

George Tsartsianidis, 123RF

No Bloat

Linux offers a surprisingly large number of lean web browsers that can substitute resource-hungry options like Mozilla Firefox and Google Chrome. Although austere in appearance, these Linux browsers are nonetheless remarkably convenient to use.

Web browsers like Firefox and Chrome gobble up working memory by the gigabyte. In PCs that have seen better days, there is often not enough space for the extra RAM required to accommodate browsers like these. Luckily, most Linux distributions have a lean web browser application in their package list.

The newer applications such as Qutebrowser [1] are built on the Webkit rendering engine. The same goes for Apple Safari and more recently, Opera. However, even the Webkit engine is not exactly frugal.

Thus, it makes sense to take a look at web browsers that have been in existence for a long time and are less outrageous in their resource demands. These browsers can generally be divided between those having a graphical interface under X and those that are text based. The latter of the two types of browsers run on the console, in a terminal emulator or remotely via SSH. There are exceptions here. Some text-based browsers use Framebuffer to also offer a graphical interface on the console. One such browser can actually handle all three methods.

In preparing this article, we looked at seven extra lean web browsers. All can be found in the repositories of Debian 8 Jessie and the current Debian derivatives like Ubuntu and Linux Mint. A Thinkpad 760XD from 1997 with 80MB RAM running Debian 8 served as the test platform.

NetSurf

NetSurf [2] is the largest among the small and is continuously being further developed. The newest version 3.3 appeared at the beginning of 2015. The Ubuntu package for version 3.2 has a GTK interface and takes approximately 4MB of space on the disk. When running, the browser can require 104MB just to open a web page. When there are lots of open tabs, this browser can cause serious slow-downs for computers that don't have much RAM. This is because the system is forced to swap out part of the browser.

Even so, NetSurf offers the most functionality. In addition to the best CSS support (CSS 2.1) of the bunch, plus the most visually appealing display of today's typical web pages, Netsurf is one of the few browsers to offer JavaScript support. However, this support option needs to be explicitly activated in the settings. An older Mozilla JavaScript library is used, which can sometimes lead to difficulty with web pages that make heavy use of JavaScript.

Gmail in this browser will complain about an unknown browser and only display an HTML version. Google Maps appears as a white page. NetSurf crashes when OpenStreetMap is invoked. NetSurf renders GitHub without a problem when JavaScript is disabled. With JavaScript enabled, the view takes forever to load a project page even on a computer that has a 2GHz CPU and 4GB of RAM.

Otherwise, Netsurf shines with its numerous settings, built in ad and pop-up blockers that need to be manually activated, and an indicator for the load time (Figure 1). Netsurf is the only lean browser that supports the well-known key combinations Ctrl++ and Ctrl+- for changing font size. These have been adopted from the major browsers.

Figure 1: Netsurf with multiple open tabs. Tabs can be arranged at the top, bottom, or on the sides.

In addition to the GTK version, NetSurf is also available as a Framebuffer version, netsurf-fb , for a graphical interface on the Linux console. It is, however, usually the case that you will need to explicitly load the Framebuffer kernel driver and adapt the access rights.

On the test computer, we used modprobe tridentfb to load the driver. If necessary, you can permanently activate the driver via making an entry in the /etc/modules file. During testing, however, NetSurf showed a black screen on the console and then it crashed.

Dillo

Dillo is a web browser for X that is also under active development. It is not based on GTK, but instead on the leaner Fast Light Toolkit (FLTK). As a result, many elements of the user interface (Figure 2) appear to be atypical. Currently, Version 3.0.5 is available. Developers are working on version 3.1.

Figure 2: Dillo with multiple open tabs. The bug symbol to the lower right shows the number of HTML errors that have been found on the page.

Dillo provides limited support for CSS 2, which permits the browser to render modern web pages in a more appealing fashion than most of the other browsers discussed here. However, it cannot compete with the quality found using NetSurf. Still, Dillo needs only about a fourth of the resources used by NetSurf under similar conditions. It is also leaner and takes up only 1.3MB of space on the disk. Just as with NetSurf, the user has many settings options. These include everything from the size of the navigation buttons to the detailed settings of the renderer and more. Therefore, it makes sense to work on the configuration file dillorc

Dillo displays the number of embedded images it is loading during a page build. It also shows the size of the page that has been downloaded and how many HTML errors it contains. There is a small issue, however. With default settings, Dillo issues numerous debugging messages in the terminal where it has been invoked. When called via a menu in the operating system, you won't notice this.

Features and Browsers That Were Not Tested

Links2 and Lynx have had support for SSL client certificates only since recent releases of Ubuntu. The versions used on the test platforms could not handle these.

It is probably a good idea to avoid Flash [8], as a matter of principle. This is especially true when old computers are confronted with such a resource hog.

The author also wanted to test Arachne [9]. This web browser was originally written for DOS and runs on Linux with the help of SVGAlib [10], something which is no longer delivered with Ubuntu. Suitably compiled, Links2 can also use this library. Unfortunately, the only things we got from Arachne were crashes.

There are other browsers that are not available in Ubuntu. All of the browsers in this category are related to Links2. You can find the entire list by reading the history of ELinks [11].

Links2

Links 2.8 [4] works like a genuine hybrid. It can be used as a text browser on the console (Figure 3) and also under X as a graphical application (Figure 4). If you only call links2, then the text version starts. Via links2 -g or the shell script xlinks2, you launch the graphical version. Additionally, links2 -g functions on the console as a graphical browser, but it requires Framebuffer. In contrast to NetSurf, this works without any problem.

Figure 3: Links2 as a text browser in an X terminal …
Figure 4: … and under X with graphics.

Links2 needs less than 20MB working memory even in graphics mode. It occupies around 3MB of space on the disk. This is mostly because it has its own fonts and numerous localization capabilities, including Swiss German, for example. The menu at the upper edge appears only when you either click on the bar located there or press the F10 key. Otherwise, the only thing you see is a left arrow that functions as the back button.

Links2 cannot handle browser tabs, but it can open multiple X windows. To do this, the browser opens additional windows from the terminal window.

The Links2 rendering engine takes some getting used to. Because it is utilized for both text and graphics modes, the graphical version looks very much like a text mode with proportional instead of equidistant fonts. The menus and dialogs are also reminiscent of the text mode. Links2 displays images only in graphics mode whether under X or using Framebuffer. It uses external image viewers when operating in text mode (Figure 4).

W3m

W3m [5] almost constitutes a departure from the graphics environment. In text mode, it renders all text in the font used by the terminal. It does use different colors as well as bold face. If the Inline Image Support, (in Ubuntu, look for package w3m-img ) gets installed, then the browser overlays images via Framebuffer or under X on the text terminal. This gives the impression that the images are part of the window (Figure 5).

Figure 5: W3m in the Terminal window with images that have been loaded.

Note that this won't work in your regular Unity/Gnome console. You'll have to use a classic X console like rxvt (sudo apt-get install rxvt ).

Version 0.5.3 of W3m takes up a good 2.1MB of space on the disk. It needs around 10MB of working memory to display the Ubuntu User web page. There is a big difference between W3m and other text-mode browsers in that W3m moves the cursor through web pages just like a text editor. The details for cursor behavior can be specified in settings. Competitors make the user jump via the arrow keys from link to link or among the fields in a form.

Lynx

The text browser Lynx [6] has been around since 1992. This means it was created before the WWW. At the beginning, it used a proprietary hypertext protocol, which was similar to the later WWW competitor Gopher. The developers are still actively working on Lynx and release a development version every few months. The current version needs about 11MB RAM to display the LinuxUser website (Figure 6).

Figure 6: Lynx in the beginner mode with help in the lower lines.

This browser is stuffed with settings options, which you can reach by pressing O. You will need to select accept changes at the beginning of the options page before modifications can take effect. If the settings still exist at the next start, you will need to save them permanently. This only works for those settings that have a name that does not end with an (!) .

The User-Mode option lets you specify how experienced you are in operating Lynx. The standard setting is Novice (Figure 6). In this setting, Lynx shows two extra lines of help at the bottom of the screen. In the Advanced setting, only the URL for the highlighted link is shown on the status line (Figure 7).

Figure 7: Lynx in advanced mode with the link target in the last line.

Lynx is currently the oldest web browser still in use. Many of its key commands can be found in other text based browsers. For example, G opens a dialog for entering a URL, Shift+G lets you edit the URL indicated, R performs a reload, the back arrow key brings up the previous web site, the up and down arrow keys jump from link to link, and Q closes the browser.

One of the special characteristics of Lynx is that in the standard setting, it always displays web pages with a black background, even in a terminal with a light background. This is not what Links2, ELinks, and W3m do. To change the background, you will need to write a different Lynx stylesheet (LSS ) in a language similar to CSS.

Netrik

Netrik [7] was by far the most frugal text browser among those tested (Figure 8). It makes do with 4.3MB of working memory and 655KB in disk space. It also offers the fewest features and is the only browser among the ones discussed here which does not offer HTTPS. The last release dates from mid-2009. It is therefore doubtful that the browser will ever have HTTPS support.

Figure 8: Netrik displays many colors and special characters, however, always on a black background.

How They Compare in Speed

Comparing the speeds of the graphical web browsers discussed here is difficult. It is easier to draw a comparison among those four text browsers that have a -dump command-line option. This option serves to download the parameters of a web page and render it as a STDOUT file.

The following times for this process were recorded for the download of the Ubuntu User homepage on a 1997 Pentium MMX with a 166 MHz clock rate:

  • Links2: 1.66 Seconds
  • W3m: 2.21 Seconds
  • Lynx: 2.43 Seconds

Although Netrik also has dump mode, it shows potential HTML errors before displaying a web page. It was necessary to acknowledge these first via Enter, which prevented accurate measurement.

Conclusion

Almost all of the lean web browsers have developed a niche for themselves that justifies their existence. The current trend favoring the use of HTTPS will probably be the downfall of Netrik. Using this browser purely for viewing documents in local HTML files is still a possibility.

It is a good idea to figure out which of the browsers presented here is suitable for your own purposes by trying them out on live objects. To do this, you can install the entire set via the command in Listing 1.

Listing 1

Install Browsers

$ sudo apt-get install netsurf dillo links2 elinks lynx w3m w3m-img netrik

The author prefers to use the classic Lynx in pure text mode. He relies on Dillo for a Nokia N900. When speed and graphics with minimal resource consumption are the priority, then Links2 under X is his favorite.