About
Subscribe

Roll your own browser on Mozilla

Always wanted to make your own browser, or even your own application? Then have a closer look at the Mozilla project, which makes it relatively easy to build your own applications using fairly standard markup, scripting and languages.
By Alastair Otter, Journalist, Tectonic
Johannesburg, 10 Oct 2002

If you`re still a little sceptical of the benefits of open source software (or even if you`re not) have a close look at the Mozilla project. Mozilla, the browser originally intended to be the "Mosaic Killer" (hence the name), is one of the best World Wide Web browsers around and can also be used as a platform to build other applications, some of which bear little resemblance to browsers.

To start off, download a copy of Mozilla from mozilla.org, play with it and when you`re bored of surfing the Net, have a look at books.mozdev.org. There you`ll find an Open Publication Licence version of the O`Reilly book, "Creating Applications with Mozilla". It is fascinating reading.

Within a couple of hours I had my own Web browser up and running.

Alastair Otter, Journalist, ITWeb

What the book outlines, in enormous detail, are the interfaces available in the Mozilla code for developers to use to build their own applications. Essentially, the developers of Mozilla have exposed large amounts of the Gecko rendering engine and interface code so that others can "plug in" their own code. In fact, they`ve done it so well that the interface elements can be re-used by anyone with a text editor, basic Web skills and some time.

Using combination markup languages such as XML, XUL (XML-based User Interface Language), XBL (eXtensible Binding Language) and RDF (Resource Description Framework) together with Javascript, Perl, Python and Cascading Styles Sheets (CSS), it is possible to re-use the Mozilla code to build any cross-platform application of your choice.

For the uninitiated, some of the acronyms may sound a little daunting at first, but if you know a little HTML and a bit of Javascript, you should have little problem in getting something going in a short space of time.

I was a little sceptical when I first discovered this capability in Mozilla. After all, there is a significant difference between a browser and an application. But I decided to have a go anyway, and quickly got sucked in. Within an hour of background reading, I had a very basic splash screen with a single button. Not much, but not bad for someone who only has a superficial understanding of most of the elements required.

I became a little more ambitious as soon as I had my first semi-application up and running. So for the rest of the day I read as much of the online version of the book as I could. And with a few spare hours at the end of the day, I knocked up a very basic Web browser. It doesn`t have fancy icons, and bookmark and history lists but it does have a tabbed interface and the ability to view the source code of the site you`re viewing on one of the other tabs. I haven`t got the address bar to work properly yet but that will come.

Yes it is basic, but it is a great example of exactly what can be done with open source software. In fact, there are already a number of Mozilla-based browsers available on the Internet, each with unique features and some, such as Galeon, which are good enough to rival Mozilla.

Thanks to the open source software ethos, anyone can take the work of others and extend it, hack it and re-use it without restriction.

And now that I`ve touted the benefits of Mozilla and open source, I`m going back to my browser; first to add some features, and then to think up a catchy name for my debut as a browser developer.

Share