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
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
- HTML 4 and a subset of CSS 2
- Local or remote files
- Simple directory index for local browsing
- Image formats: supports whatever gdk-pix supports (PNG, GIF,
JPG, SVG, etc)
- Simple history (back/forward)
- Homepage button (homepage specified on the command line)
- Resizable fonts
- Forms
Not Supported
- HTTP POST (only GET is supported)
- Javascript
- CSS3
- HTML5
- Cookies
- Flash
- Video/audio etc
- Caching or other advanced stuff
Dependencies
- libgtkhtml2 (included in the source tarball)
- libcurl
- gtk2
- libxml2 (needed by libgtkhtml2)
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:
- OPTFLAGS (the optimisation flags). Default is '
-O0 -g
'
(ie, no optimisation for debugging).
- USE_SYSTEM_GTKHTML (use system's libgtkhtml2 instead of the
one included in the source tarball). Default is empty (that is,
use built-in one).
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