development snippets

Notes on how to develop a Firefox extension

Tagged firefox, extension, development, notes  Languages 

Create a new profile for extension development

Tweak Firefox configuration for extension development\_up\_extension\_development\_environment

Create a skeleton extension

Extract it to the your project folder, for example:


Setup Firefox to load your extension

Follow these instructions to configure Firefox to load your extension from /home/name/projects/my_extension:\_up\_extension\_development\_environment\#Custom\_code\_location\_up\_extension\_development\_environment\#Using\_directories\_rather\_than\_JARs

Install the Extension developer

Start Firefox with the development profile

firefox-bin -P development -no-remote

To start the default profile use:

firefox-bin -P THE_PROFILE_NAME -no-remote

Build your extension

The extension wizard includes a build script, but it might be a good idea to upgrade it to the latest version, which can be found here (including a Windows build script):\_build\_script


If you're on windows and using CygWin, you might get this error:

./ line 6: $'\r': command not found
./ line 29: $'\r': command not found
./ line 40: $'\r': command not found
./ line 70: syntax error near unexpected token $'do\r''
'/ line 70: for CHROME_SUBDIR in $CHROME_PROVIDERS; do

The solution is to run the dos2unix command on the *.sh files:


How to create a separate development profile for Firefox

Tagged firefox, development, profile, mode  Languages bash

Extensions slow down Firefox so I prefer disabling all but the most important Firefox extensions when coding.

Here's how to do it:

  1. First, create a development profile following these instructions
  1. Next, create a shortcut that starts Firefox in development mode:
# Mac OSX
/Applications/ -P development -no-remote

# Linux
/usr/lib/firefox/firefox-bin -P development -no-remote

# Windblows
"C:\Program Files\Mozilla Firefox\firefox.exe" -P development -no-remote