MozillaAddonDevelopment

Mozilla application Addons Development in Netbeans

Doc Contributor: Cydey


[[{TableOfContentsTitle=TableOfContents} | {TableOfContents title='Table of Contents'}]]

Introduction


We can easily setup Netbeans so that we are able to create no only Firefox Addons but also addons for the following:

  • Mozilla Firefox
  • Mozilla Thunderbird
  • Mozilla Suite 1.x
  • Netscape
  • SeaMonkey
  • Flock
  • Sunbird
  • Nvu

This can be achieved using the foxbeans module for Netbeans available at http://plugins.netbeans.org website.

Downloading Foxbeans Netbeans Module


File:Browse to the requisite page

  • Click the download link to download the module as a .nbm file. A pop-up window would open up asking for where to download. You can create a separate folder which would contain all the netbeans modules you wish to install.

File:Choose where to download

Installing Foxbeans Netbeans Plugin


1. Open the Netbeans IDE. (Netbeans 6.0 used in the images)

File:Netbeans Loading

2. On the Menu Bar choose Tools and further choose the 2nd last option Plugins from the submenu.

File:Plugin Manager

3. The Plugin manager by default opens up the Update Tab; change the tab to Downloaded.

File:Plugin Manager

4. Click the Add Plugins button; A window pops up; navigate to the directory where you downloaded the plugin and add it. It shows up as visible in the figure.

File:Install the Plugin

File:Install the Plugin

5. Click the install button on the Bottom-left corner of the window.

File:Install the Plugin

6. A confirmation window pops up; click Next to continue the installation.

File:Accrpt the licence agreement

7. Next you need to read the license agreement and accept it. The plugin is licensed under CDDL.

File:Accept the licence agreement

8. Since the plugin is designed by a windli it is not digitally signed and you would need to ignore and continue inspite of the Validation Warning.

File:Ignore the Warning

9. The plugin would install automatically; Once the installation is finished the window would show an option to restart the IDE. Please do so to complete the installation.

File:Restart to complete Installation


Creating a Sample Mozilla Addon


1. When the Netbeans IDE restarts, click on the New Project Menu item to start creation of a New Project.

File:Create New Project

2. Choose the first option of Mozilla Addons and create a Mozilla Addon Project

File:Create Mozilla Addon Project

3. Specify a Project name and click Next.

File:Specify Project Name

5. Next we have to enter Addon settings. Choose a Mozilla application to associate the addon to and consequently browse to the application as shown. Presently, we are going for Mozilla Firefox.

File:Creating Project

File:Creating Project

File:Creating Project

6. Finally, finish and create the New Project.

File:Creating Project


Compiling and Testing the Addon


1. Now, you can see the basic Addon Project structure consisting of build.xml and other directories. I will not go into details of how to build an addon. However, now we have set up a platform where we can develop addons for any Mozilla application be it

  • Mozilla Firefox
  • Mozilla Thunderbird
  • Mozilla Suite 1.x
  • Netscape
  • SeaMonkey
  • Flock
  • Sunbird
  • Nvu

File:Directory Structure

2. Next, we can compile and run the project to test that all settings have been correctly configured. Just Click on the Run Project button and find yourself with a new window of firefox which contains the sample addon.

File:Existing build.xml

File:Run Main Project

3. Mozilla Firefox window opens up. If you observe carefully you will observe that My First Addon menu item under Tools. You can click the same to test that the sample addon works.

File:Firefox

File:Firefox

File:Firefox


References

1. http://www.rietta.com/firefox/Tutorial/overview.html

2. http://developer.mozilla.org/en/docs/Extensions

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo