gtkhtml-browser README


Overview

gtkhtml-browser is a simple, lightweight, web-browser meant for browsing simple HTML help files. The rendering engine used is libgtkhtml2. It supports a subset of HTML4 and CSS2, and somewhat tolerates CSS3 (but not much). HTML5 is definitely not supported, nor is Javascript.

gtkhtml-browser is small and lightweight. When all its dependencies are installed in the system, the size of the browser is only about 45K. If libgtkhtml2 is not installed in the system, it can be compiled statically into the browser;  optimised for size (-Os), the resulting binary is only about 330K (after stripping). Not bad for a web browser.

gtkhtml-browser is meant for browsing known safe HTML files, e.g. help files, documentation files, etc. They can be local or on a web server, but they should be known to be simple and non-malicious. While you can use it for general browsing, it is neither safe nor recommended: libgtkhtml2 development ended in 2008, and the HTML/CSS specifications have changed much since then. libgtkhtml also does not tolerate the unknowns very well (it crashes very easily if it encounters what it thinks as invalid input).



Screenshot


gtkhtml-browser screenshot


Disclaimer:
the above screenshot is only meant to show how gtkhtml-browser rendering looks like, when everything is working. It is still not recommended to actually browse the site with gtkhtml-browser, in fact, gtkhtml-browser will crash after a few links.


Features


Not Supported


Dependencies


Compiling

There is no autoconf, just a (GNU) Makefile. gtkhtml-brower depends on "pkg-config" to find the correct include file and libraries, so if you have them in some odd location you may need to set PKG_CONFIG_PATH to point to the correct directories.

There are two flags you can specify when invoking make:
For example, to compile with system's libgtkhtml2, just run "make USE_SYSTEM_GTKHTML=yes". To compile with size optimisation, you invoke "make OPTFLAGS=-Os".

There is no "make install". The compile will produce an executable called browser on the source directory that you can rename and move to anywhere else.


Hacking and History

The source tarball contains the source of gtkhtml-browser and the latest (or final) libgtkhtml from svn (patched with Chris Lord's patches and my own small stability patches). The "samples" directory is a copy of libgtkhtml's "samples" directory.

gtkhtml-browser itself was originally developed from "testgtkhtml" test program from libgtkhtml 2.11.1. I removed the dependency on GnomeVFS stuff and replaced it with glibcurl (which depends on libcurl), added history management, added local file management, and fixed the bugs (there were many of those). May be one day I will hack the libgtkhtml stuff itself to make it better and less crash-prone, but for now. life it too short for that.

The included built-in libgtkhtml sources are not used if you specify USE_SYSTEM_GTKHTML=yes. Otherwise it will get built and linked statically into the executable.

License

Since this is a derivative work, I don't have much choice here. The original code was licensed under GNU GPL Version 2 or later by its authors; and so is this work.

Enjoy.
James 2015