Building and uploading a Firefox Extension

Some notes on building and updating a Firefox extension. In this case, it’s my send-tab-url add-on for sending the current tab’s URL to a designated server.

Access the extensions area with about:debugging and in This Firefox there’s an option to Load Temporary Add-on.

This lets me choose the root directory of my add-on, which is the directory that contains the file manifest.json.

I can use Inspect to open a developer window with the console and debugger etc. for the extension’s context. Note, the DOM for the pop-up is entirely separate from the current tab’s DOM.

# Build the zip file that's suitable to upload to Mozilla
rm ../;
zip -r -FS ../ * --exclude .git --exclude *.swp

There is a script in the project directory that builds the zip file, named according to the version found in the manifest file. It automatically excludes the files that are not part of the installable extension package.