Make Firefox extensions with Mozilla Jetpack
Before we go any further it’s worth making sure you have everything you need to follow this tutorial.
Mozilla Firefox 3.6 or later
If you are trying to build a standalone application, you can also use the XULRunner SDK that uses Gecko 1.9.2 or later. Using Firefox is much easier since the SDK is already configured to work with Firefox
Python 2.5 or later
To check the version of Python installed in the system, perform the following command:
[~ $:] python
Python 2.6.1 (r261:67515, Jun 20 2010, 21:47:49)[/python]
In case you want to check out the Jetpack SDK source code from its source code repository, you will need Mercurial installed on your system, since the Jetpack is hosted on the Mercurial version control system. To install Mercurial on Ubuntu, perform the following command:
[python]$ sudo apt-get install mercurial[/python]
Following installation, Mercurial’s hg command should be available.
Mozilla Jetpack SDK
To obtain the Jetpack SDK from the Mercurial repository, perform the following command:
[python]$ hg clone http://hg.mozilla.org/labs/jetpack-sdk/[/python]
Please note that the Mercurial repository of the Mozilla Jetpack SDK is being updated constantly and may not work with this tutorial. Please use the stable version of the Jetpack SDK for maximum compatibility. To set up the SDK development environment, enter the following command from the jetpack-sdk directory:
[python]$ source bin/activate
There was a time when a dinosaur named Internet Explorer used to rule the planet ‘Internet’. It was so big that in order to support Internet Explorer, people would happily ditch the support for other browsers. Then came a meteoroid called Firefox (read the name) that destroyed most of the dinosaurs and established a lot of key features that changed the face of planet Internet for times to come. It was like freeing humankind from a ruthless alien empire. These features were…
Open source: There is no doubt that open source software packages are of great quality. But mainstream adoption has always been a difficult task to achieve for an open source application. Firefox was one of the first open source projects which went head on head with something that was as popular as Internet Explorer. Being an open source project, it attracted lot of developers who worked under the Mozilla Foundation’s guidelines to create it.
Portable: Firefox was portable like most open source applications. But at the same time it was also a popular web browser. This got lot of web developers to develop their websites and web apps so they would also work with Firefox. Previously the situation was a little awkward for those of us who were using our Linux boxes with either Netscape or Mozilla web browser, because most of the websites and web apps were only designed to work with Internet Explorer. Firefox helped a lot in the adoption of Linux and other desktop operating systems because it ensured that the internet would not be incompatible on Linux or other alternative operating systems.
Extensibility: This was and still is the landmark feature that Firefox had to offer. Companies like Apple, Google and Microsoft are still figuring out the extensibility of their browsers, but Firefox had got it just right from the start. Extensibility allowed users to add features to Firefox without hacking into the original source code. This allowed users to customise the browser according to their own needs.
Out of these three features, extensibility proved to be the most popular for the Firefox project. Not that the other web browsers weren’t extensible, but the extension mechanism in other web browsers was… for lack of a better word, let’s call it horrible. We all know about the trouble with spyware and Internet Explorer BHOs (Browser Helper Objects). Firefox, being an open source browser, provided a very easy way to install extensions and manage them. It also included a sandbox-type environment and a consistent user interface. Even developing Firefox extension proves very easy. You do not need to learn C/C++ or any other low-level programming language.