Create firefox Extension (Add-on SDK-based extensions)
This article will guide you in to create a simple firefox extension . There are three different techniques you can use to build extensions: Add-on SDK-based extensions, manually bootstrapped restartless extensions, and legacy extensions. This tutorial will take you through the steps required to build a very basic extension - one which adds a action button . SDK Installation Prerequisites To develop add-ons using the current Add-on SDK, you'll need:
- Python 2.5, 2.6 or 2.7. Note that versions 3.x of Python are not supported on any platform.
- Firefox Browser.
- The SDK itself: you can obtain the latest stable version of the SDK as a tarball or a zip file.
Steps to Create firefox extension
Extract the file contents wherever you choose, and navigate to the root directory of the SDK with a shell/command prompt. For example: tar -xf addon-sdk.tar.gz cd addon-sdk

source bin/activate

(addon-sdk)user@user-Lenovo-B570e:~/addon-sdk$

mkdir my-addon cd my-addon cfx init

- data/
- lib/ main.js
- test/
- package.json
cfx test
- package.json
cfx xpi
. Others, such as lib, permissions, and preferences, represent instructions to the cfx tool itself to generate and include particular code and data structures in your add-on. 
var buttons = require('sdk/ui/button/action'); var tabs = require("sdk/tabs");
var button = buttons.ActionButton( id: "mangocoders", label: "Visit mangocoders", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onClick: handleClick }); function handleClick(state) { tabs.open("http://www.mangocoders.com/"); } To run and try the add-on use : cfx run

Packaging add-on :
When you've finished the add-on and are ready to distribute it, you'll need to package it as an XPI file (xpi is like a zip file). This is the installable file format for Firefox add-ons. You can distribute XPI files yourself or publish them to https://addons.mozilla.org so other users can download and install them. To build an XPI, just execute the command :cfx xpi
