Cyclone3 Skin

Setting up extension development environment

From Cyclone3 Wiki

Contents

Objectives

  • create a dedicated profile to install and edit XUL CMS
  • unpack the source code and create an easy way to edit it and see your changes

Requirements

  • Firefox 4 or higher (Firefox 5.0.1a works also just fine at the moment)
  • ability to unzip files
  • basic text editor

Basic steps

Creating and running a dedicated profile

It is best to use a dedicated profile for extension development. This way you will make sure it does not conflict with any other extensions. So: if you want to develop XUL CMS, create a separate profile and install the extension to this profile.

Create a new profile / Run Firefox with specific profile

On all platforms run the firefox binary with the following parameter. You can also create a shortcut.

firefox -no-remote -Profilemanager 

Firefox profile default location

Windows

C:\Documents And Settings\<user name>\Application Data\Mozilla\Firefox\Profiles\<profile dir>\Extensions

GNU/Linux

~/.mozilla/firefox/<profile dir>/extensions 

Unpacking the extension

Open your profile directory. You should see the extension file:

c3xuladmin4@cyclone3.org.xpi

Firefox keeps the extension package in one zip file and only extracts the extension on runtime. This is much faster, but inconvenient. We need to unpack the extension to a more suitable directory.

On linux you can create a devel (for example) directory in your home.

mkdir ~/devel

Make sure Firefox is not running. Move the extension file to your development directory.

mv c3xuladmin4\@cyclone3.org.xpi ~/devel

Instead of your .xpi file, create a text file bearing the name of the application, without the .xpi extension.

touch c3xuladmin4@cyclone3.org
vim c3xuladmin4@cyclone3.org

Edit the file and enter the path (full absolute path) of your development directory:

/home/user/devel 

Save the file, go to your development directory and unpack the source

cd ~/devel
unzip c3xuladmin4@cyclone3.org.xpi

All done. Firefox will now read the extension from your unpacked sources.

Prevent auto-update

Firefox updates extensions automatically by default. In case of XUL CMS it periodically checks the RDF feed https://downloads.cyclone3.org/C3XULadmin4.rdf and downloads a new version in the background.

This will erase any changes you have made so you need a way to get rid of auto updates for this particular addon.

Arbitrary version setting (hack)

Disabling cache

Firefox caches all xul and javascript code in extensions. If you make any changes, by default, you need to restart Firefox to see them. This would not be very practical. There is a way to disable the cache:

  1. Open the url: about:config
  2. Create a new boolean variable:
nglayout.debug.disable_xul_cache       true

Save and restart Firefox. Now you only need to reload the specifix XUL window or binding to see your changes.

See also

Developing XUL CMS