Using Firefox/Creating an extension

From Wikibooks, open books for an open world
< Using Firefox
Jump to: navigation, search
Chapters: 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14

Introduction[edit]

This tutorial will explain step by step how to deploy an extension for Firefox 3. In this way the reader could implement in a easy way extensions that let personalize their version of Firefox, taking care about the compatibilities with Firefox 3.0*.

The first chapter gives a brief introduction to the extensions for Firefox. Then it will discuss some items that the developer must have considered about the compatibilities.

The second chapter starts to describe step by step how to deploy the extension and then, the last chapter will explain hoy to make the install file and how to install it.


Extensions for Firefox 3.0.*[edit]

This chapter will introduce the topic of what are the extensions and what functionalities they give. And for last the topic of compatibility.


What are the extensions?[edit]

An extension is a new functionality that is integrated to Firefox. These one can be deployed independent from the browser and from the platform. So we can say that extensions let users to bring new features, functionalities and behaviors to the browser.


The extensions are not the same as plug-ins. A plug-in allows for the viewing of web content that the browser cannot show by itself, for example: pdf, flash, sounds and videos.


Compatibility with Firefox 3.0.*[edit]

Some functions of JavaScript are not longer supported in the new releases of Firefox, especially over versions 3.p.*. Also the structures of the manifest files and the reference to the browes.xul have been changed. It is important to know about that changes, if not the extension could be incompatible with the last versions of Firefox. Other items to consider are the Managers that Firefox implements (ex, loginManager). These have been suffered changes too. For more information: Updating....


Start creating an extension.[edit]

The next chapter describes step by step how to develop simple extensions. It’ll specify the folders that must be created, the structure that must follow the type of files and the root folder.


Structure of folders[edit]

There is an obligatory structure that the folders must carry out. This structure defines the names of the folders, the hierarchical structure, the type of files of each folder and the place where these folders and files should be stored for bean recognized for Firefox.


Root folder[edit]

Al the beginning we must create a folder with the name of the extension. This name must be unique and match the name defined in the installation file. There are two ways of naming the root folder of an extension.

As mentioned, this name must be unique, so the first alternative is to generate a GUID identifier for it. In windows you can use the guidgen command and in Linux the uuidgen command. For example, you can generate this {1ca6f699-f8f3-479b-983b-20775f09f755}. The second alternative is to create a name with e-mail format. Is not recommendable to use a personal e-mail, only should have the same format. For example, we can call our extension like myextension@somedomain.

Inside the root folder we'll create the structure corresponding to the extension.


Chrome Folder[edit]