Skip to main content

Creating a Firefox Extension in 3 Easy Steps

We recently created an extension for the Hipatic website.

Here is how to create the most basic extension in 3 easy steps!

Step 1:
Create files & folders.

Name it myfirstextension@mysite.com
Inside this folder create files named chrome.manifest & install.rdf
Inside the same folder create a folder named chrome
Inside the folder named chrome create a folder named content
Inside the folder named content create a file named sample.xul

Step2:
Filling up the files!


open install.rdf and copy the following code

<?xml version="1.0"?>

<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:em="http://www.mozilla.org/2004/em-rdf#">

<Description about="urn:mozilla:install-manifest">
  <em:id>myfirstextension@mysite.com</em:id>
  <em:version>1.0.0</em:version>
  <em:type>2</em:type>

  <em:targetApplication>
   <Description>
    <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
    <em:minVersion>1.5</em:minVersion>
    <em:maxVersion>3.0.*</em:maxVersion>
   </Description>
  </em:targetApplication>

 <em:name>My Very First Extension</em:name>
 <em:description>My Very First Extension</em:description>
 <em:creator>Me</em:creator>
 <em:homepageURL>http://www.hipatic.co.cc/</em:homepageURL>
  </Description>      
</RDF>


Open chrome.manifest and fill in this

content sample chrome/content/ 
overlay chrome://browser/content/browser.xul chrome://sample/content/sample.xul


Finally open sample.xul (which is in the folder chrome/content/) and copy the following

<?xml version="1.0"?>
<overlay id="sample" 
   xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 <statusbar id="status-bar">
          <statusbarpanel id="my-panel" label="Please visit www.hipatic.co.cc" tooltiptext="Visit www.hipatic.co.cc" onclick="window.open('http://www.hipatic.co.cc')"/>
 </statusbar>
</overlay>



Step 3:
Zipping Up & serving the file!

Zip up the contents of the folder(don't zip the folder, zip it's contents!) you created myfirstextension@mysite.com Using Windows/Winzip/WinRAR. Make sure the format is ZIP in case you use WinRAR. Rename the archive thus created from .zip to .xpi . Now drag the .xpi file you have cretaed to your fiefox browser window. An installation window will pop up. Install the etension and restart the browser! Hurray, you have created your first extension!!

PS:
Modding your first extension:

In the file sample.xul
instead of
<statusbarpanel id="my-panel" label="Please visit www.hipatic.co.cc" tooltiptext="Visit www.hipatic.co.cc" onclick="window.open('http://www.hipatic.co.cc')"/>

you can write
<statusbarpanel id="my-panel" label="Please visit My Website" tooltiptext="Visit My Website" onclick="window.open('http://www.mysite.com')"/>

or you can append javascript files for more functions(More of that later!)

Comments

Popular posts from this blog

CPU Temperature Guide for Intel Core 2 Duo : Range of Normal CPU Temperatures

Is your CPU Temperature too High? How high is high enough? Is 60 degree Celsius high enough or is 70 degree Celsius the threshold? Hipatic covers your temperature problems right here. Below we discuss Intel Core 2 Duo.
If your CPU is overheating, visit our CPU Overheating Guide and CPU Overheating: Symptoms, Causes, & Solutions

To measure CPU Temperatures you may need Real Temp

Intel Core 2 Duo:
(If you wish to access the PDF related to your processor, please first follow the link given under sources at the end of the article instead of directly accessing the pdf link given under each sub heading. This will help you access the latest information on your processor from Intel's website & will also prevent hotlinking.)

1. Intel® Core™2 Duo Processor E8000 Series
Intel ® Core™2 Duo Processor E8600, E8500, E8400, E8300, E8200, E8190 Thermal Profile
Range: 45.1 degree Celsius (Power - 0W) to 72.4 degree Celsius (Power 65W)
Source:http://download.intel.com/design/processor/datashts/3187…

CPU Overheating: Symptoms, Causes and Solutions

The most hit pages on this blog are the CPU Temperature Guides, so here is a comprehensive(work in progress) guide to everything(almost) related to CPU Overheating.

Symptoms of a Overheating CPU :

1. Random Crashes:
Your system may switch off or restart automatically while you are using it. And this may happen repeatedly. If the overheating problem is not severe enough, then your PC may only crash when you are running many CPU intensive applications or running a CPU intensive game. If your CPU temperature is very high, then the system may restart as it is booting up ending into a endless and dangerous loop.

2.Sluggish System:
An overheating CPU underperforms, result being a sluggish computing experience. The system may experience random lock-ups too.

Differential Diagnosis:
A PC may also crash due to RAM, Motherboard, Hard Disk & Power Supply Unit issues.

Causes of CPU Overheating:

1. Improper CPU + Heatsink installation:
If your system is new and you have overheating issues, or if you…

CPU Temperature Guide for Intel Pentium 4: Range of Normal CPU Temperatures

Is your CPU Temperature too High? How high is high? Is 60 degree Celsius high enough or is 70 degree Celsius the threshold? Hipatic covers your temperature problems right here. Below we discuss Intel Pentium 4.

Pentium 4 Processors:
Temperatures Specified are Maximum Processor Case Temperatures(Tc). For details refer the sources given.
For 65 nm Process in the 775-land LGA Package supporting Hyper-Threading Technology and Intel® 64 architecture

Thermal Profile for 775_VR_CONFIG_05A ProcessorsRange 44.3 degree (at Power - 0W) Celsius to 69.2 degree Celsius (at Power - 86W)
Source: http://www.intel.com/Assets/PDF/datasheet/310308.pdf Page:77 Table:28

Thermal Profile for 775_VR_CONFIG_06 Processors
Range 43.6 degree (at Power - 0W) Celsius to 64.1 degree Celsius (at Power - 64W)
Source: http://www.intel.com/Assets/PDF/datasheet/310308.pdf Page:78 Table:29


For 90 nm Process in the 775-land LGA Package supporting Intel® Extended Memory 64 Technology & Supporting Intel® Virtualization Tech…