zondag, januari 18th, 2009 | Firefox extensions
Now and then I play some with Firefox extensions. While doing that I use a batch file that creates the XPI files easily. No problems this far.
But…. A few weeks ago I got my new Macbook and I love it. The only thing was that I couldn’t use the batch file anymore. So I adjusted the batch file and converted it to a shell script. Here’s the code:
: # @(#) --Builds Firefox extensions BASELOC=$PWD EXTENSION=$1 mkdir build mkdir ./build/chrome cd ./chrome rm .DS_Store zip -r $EXTENSION.jar ./ mv $EXTENSION.jar .././build/chrome cd $BASELOC cp ./install.* ./build cp ./update.* ./build cp ./*.manifest ./build mkdir ./build/defaults mkdir ./build/defaults/preferences cd ./defaults/preferences cp ./*.* ../../build/defaults/preferences cd ../../build rm .DS_Store zip -r $EXTENSION.xpi ./* mv $EXTENSION.xpi ../ cd ../ rm -r ./build ## Restart Firefox and install extension killall firefox-bin && /Applications/Firefox.app/Contents/MacOS/firefox -install-global-extension $PWD/$EXTENSION.xpi && open -a Firefox
Save this file as
build.sh and place it in the directory where you are developing the extension. Now open the Terminal, browse to the right path and make this file executable:
chmod +x ./build.sh
To build your Firefox extension use the following code in the terminal:
Everything is working so far? Cool! Now you have something which makes the extension development in Mac OS X a lot easier! If not, please leave a comment or contact me.
Good luck with it!