Create your own Mozilla Extension


Mozilla Extension are browser extension which add some custom functionality to your browser.

First thing you should know about Mozilla extension

  1. They are simple compressed format with extension .XPI
  2. They can be integrated with other products of Mozilla.
  3. Mostly XUL run on Chrome Framework of Mozilla ( Not Google Chrome).
  4. Extension for Firefox 3.6 and above are almost same and supported well
  5. Extension for Firefox 3.6 and below have install.rdf file which help in installation process.
  6. Extension for Firefox 4 has to qualify more security feature ( let us digg deep in later post )

It is very difficult to trace mistakes while building your extension it may take lots of time to figure out what has gone wrong. Simple thing is to keep your URI neat for better understand ultimately reducing complexity( Experience SpeaksSmile ).

Although you can use older format by using install.rdf if you have used it. If you are new to extension building and want to start building your own extension is to use chrome.manifest file to help Mozilla to locate URI in your project and install.rdf direct an instruction to Mozilla browser to install your extension.

install.rdf

install.rdf is an xml file mostly contains all the information about your extension like

<?xml version="1.0"?>
<RDF:RDF xmlns:em="http://www.mozilla.org/2004/em-rdf#"
         xmlns:NC="http://home.netscape.com/NC-rdf#"
         xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <RDF:Description RDF:about="urn:mozilla:install-manifest"
                   em:id="extension@mandar.org"
                   em:name="M S Labs"
                   em:version="1.0.0.1"
                   em:creator="Mandar Shinde; http://www.example.org"
                   em:description="Plugin providing wide support to RS-232"
                   em:homepageURL="https://mandarsblog.wordpress.com"
                   em:iconURL="chrome://myapp/content/images/chip.png"
                   em:author="Mandar Shinde"
                   em:updateKey="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC8at5yu/0l7shU6mymH6VcMHA27ybEam82GGG+lKtRbaALitgnokCQuXwXlntRpIK078I1/PEKiVpEPc+HU45Au/kM/i8W3h3WeIXCk30e+eSzCLoCaUD5n8SP7hvK97621U0zNxvh5tJd4xvVL9axlFAsbw1d7UilCt/QGoagCwIDAQAB">
    <em:targetApplication RDF:resource="rdf:#$41y0G2"/>
  </RDF:Description>
  <RDF:Description RDF:about="rdf:#$41y0G2"
                   em:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
                   em:minVersion="1"
                   em:maxVersion="5.*" />
</RDF:RDF>

First Part

It Contains information like

  • Name
  • Id
  • Version
  • Author
  • Creator
  • Homepage
  • Description
  • Update Key ( Required in Mozilla Firefox 4 more information in next post) etc..
Second Part

</RDF:Description>

It is all about the description of Platform on which your extension will get install

em:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"   Is For Mozilla Firefox , Different products of mozilla have different id for platform specific installation.

em:minVersion="1" 
em:maxVersion="4.*"
  You should have got it up till now..Smile

chrome.manifest

It Mostly contain your URI location, your contains, your Overlays  in your extension

content        myapp        chrome/content/

This is the most basic thing you need to know while building extension, will be back with more information in next post

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s