What the minimum basic setup required to begin developing a Firefox extension?
-
if you want to answer yourself, post an answer instead of putting it all up in the question body. – chakrit Nov 08 '08 at 11:37
-
+1 to ask the question in the question and then post your answer separately. – Noah Goodrich Nov 08 '08 at 11:38
-
I thought you meant Quick Basic, the programming language. :) – Bill the Lizard Nov 08 '08 at 12:54
7 Answers
Precaution: In order to prevent messing with your default Firefox experience, try the tip below on a newly created disposable test account.
Step 1: Create a new Firefox profile. For this you need to invoke the Profile Manager via command line option:
firefox.exe -profilemanager
Click on the 'Create Profile' button of the Profile Manager, which will invoke a wizard. Give the profile a name. Use the 'Choose Folder' button and save the profile in a appropriately named folder. This folder is where we are going to create our quick and dirty Firefox extension.
Step 2: Change directory to 'extensions' folder within the profile folder created in Step 1. Now we need to give the Firefox extension a globally unique name. Email-like names are good enough for that. For example, OneMinuteFirefoxExtension@ec29.com will be good enough name for the extension. Under the 'extensions' folder, create a folder with its name as the just chosen unique name.
Step 3: Create files chrome.manifest and install.rdf. You can copy paste the sample here with the names, description altered appropriately.
chrome.manifest:
content 1mffext chrome/
and install.rdf:
<?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="rdf:#$Fsv+Z3"
em:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
em:minVersion="2.0"
em:maxVersion="3.0.*" />
<RDF:Description RDF:about="urn:mozilla:install-manifest"
em:id="1m-ff-ext@ec29.com"
em:type="2"
em:name="OneMinuteFirefoxExtension@ec29.com"
em:version="0.0.1"
em:description="One Minute FireFox extension"
em:creator="labsji "
em:homepageURL="http://labsji.wordpress.com">
<em:contributor>Venkat83</em:contributor>
<em:targetApplication RDF:resource="rdf:#$Fsv+Z3"/>
</RDF:Description>
Step 4 Create folder called chrome and create a text file called test.txt within the folder. files in the folder will be accessible via chrome url like chrome://1mffext/content/test.txt
Now the bare minimum extension is ready. Regular html/javascript files can be used to create the functionality desired.
Testing the Extension: Invoke firefox to use the profile created above.
firefox.exe -profile <path of the newly created profile> -no-remote
I have created a googlecode project to share the resultant code created following the steps above. The code along with run scripts are available at Just a Minute Firefox Extension
Sim-OnDemand- personal virtual world as a Service's launcher application is an example of an application packaged and distributed using this method.

- 1
- 1

- 872
- 1
- 8
- 15
Step 1: Use the Add-on Builder to generate all the necessary files.
Step 2: Extract the downloaded files into your development area.
Step 3: Create a text file in your profile's extensions folder named according to the em:id in the downloaded install.rdf file, put the full path to your extracted files in it then restart Firefox (delete the text file to uninstall if necesary).

- 74,533
- 18
- 193
- 177
-
as of 2011, this link is now dead, says service is disabled but the tools at https://addons.mozilla.org/en-US/developers/tools/builder are recommended. – Jason Antman Apr 07 '11 at 11:59
To start another instance of firefox with a different profile you can use the following command:
firefox -P My_test_profile -no-remote
This way you can have 2 different firefox running and use one for testing extensions without messing with the one you use regularly.

- 51,659
- 8
- 55
- 58
The Add-On SDK makes simple add-on development easier. https://developer.mozilla.org/en-US/Add-ons/SDK
Steps for Mac/Linux:
- Download and extract the zip from this page: https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/Installation
- In the add-on-sdk-version folder, run
source bin/activate
mkdir plugin_name
cd plugin_name
- Edit lib/main.js to include your code.
cfx init

- 14,346
- 12
- 59
- 97
Interesting information.
Now to answer the question, I would say: create a Greasemonkey script (or Chickenfoot, or iMacros, etc.).
Might be more limited (in changing FF UI for example) but good for most needs.

- 40,535
- 6
- 96
- 134
Here are the reasons why someone would want to create a minimal firefox extension.
- When you wish to create a local computer( disk) resident browser based application, interacting with the file system for reading and writing is possible if the application is structured as an extension.
- Quick prototyping without worrying about XmlHttpRequest cross domain issues. When you run as plain application, user is hassled with a pop-up whenever XmlHttpRequest is attempted.
- Many a times, installing an extension causes a lot of angst in terms of 'Will this mess up with my other customizations?'. A work in progress extension can be distributed along with a profile so that the user can preview, test it. Without worrying about messing with the default firefox browsing experience.

- 872
- 1
- 8
- 15
I suggest testing on the Portable edition of Firefox.

- 5,654
- 5
- 28
- 48
-
It does not run in parallel with a normal Firefox, instead create an alternate profile to be able to run and restart a Firefox while keeping your regular Firefox open. – Robin Rodricks Jul 03 '09 at 18:34
-
But you can close the regular Firefox, and play with a portable one. – Osama Al-Maadeed Jul 03 '09 at 21:22