Contents

What you need

To build and develop Solvent you need:

Things that are not required but help:

  • FireBug - a great Firefox extension to help you debug, inspect and profile Firefox extensions.
  • Leak Monitor - another great Firefox extension that pops up warning if it spots any memory leaking in your extension code. NOTE: this spots leaks only on the javascript side of things, but it's a help.

How to start Solvent Development

  1. Open your favorite shell/terminal on Unix/MacOSX or DOS Prompt on Windows
  2. Make sure that Ant and the Subversion command line client are installed and that ant and svn are available in your path (if you don't know how to do this, stop here and download an already packaged Solvent and save yourself a lot of pain)
  3. Checkout Solvent from the Subversion repository at http://simile.mit.edu/repository/solvent/trunk/. We'll assume that the checkout created a directory called solvent.
  4. Type cd solvent
  5. Type ant to prepare Solvent. This will prepare the Solvent extension at src.

How to install Solvent in Firefox for Development

  1. Locate the full path to the firefox executable. On windows is normally something like c:\Program Files\Mozilla Firefox\firefox.exe, on macosx is something like /Applications/Firefox.app/Contents/MacOS/firefox-bin, while on Linux is varies depending on your distribution (try typing firefox in your command line since it might be already in your path).
  2. In your shell/dos-prompt, type <firefox> -ProfileManager where <firefox> is the full path to the executable. This will bring up Firefox Profile Manager. (I know there are easier ways to bring up the profile manager on windows, but you need this later anyway so stay with me)
  3. Create a new profile and chose a location that you can easily remember. NOTE: keep firefox running while executing the next points!
  4. Type cd [profile]/extensions where [profile] is the directory where the profile is (of course on Windows you will be typing \ instead of /)
  5. Create a file named {377cc066-cb3e-4ee8-ba63-39e761ad1cbe} and write the absolute path to the extension directory (which is solvent/src/ where solvent is the location of the Solvent checkout (again, on Windows, you will be typing \ instead of /). Basically, you are installing the XPI by hand and telling Firefox where to find it. (This acts as a pseudo-symlink that works in all operating systems). NOTE: if a folder with that name already exists, it means that you already Solvent installed. Make sure that you uninstall a regular XPI Solvent installation before attempting to install a development version or things might not work.
    • Make sure that your file is a single line and no whitespace or newlines at the end of the path or Firefox won't load it.
    • You can create the file by typing at the command line notepad "{377cc066-cb3e-4ee8-ba63-39e761ad1cbe}" but note that Notepad automatically appends a .txt extension to your file, so you need to delete that extension after quitting Notepad.
  6. Restart Firefox and the Solvent spray icon should show up on the bottom right of your firefox browser window. (If not, go down to the Troubleshooting section).

The Development Lifecycle

Solvent can be fully developed in place, meaning that you can edit directly the files under version control and that Solvent reacts accordingly, without you having to repackage or reinstall the firefox extension and, even better, without having to even restart firefox!!

Normally, Firefox caches all the XUL pages for efficiency reasons, which forces you to restart the browser to have your fixes to your extension being picked up. You can turn off this cache in Firefox. One easy way to do this is to turn Piggy Bank into 'debug mode' by doing the following steps:

  1. Open Tools > Piggy Bank > Options from the Firefox menu bar.
  2. Select the Development tab.
  3. Click on Enable Debug

This turns off the XUL cache and allows you to have Firefox pick up your changes just by closing the browser window and opening another one (which is way faster than restarting the whole browser, at least in some operating systems).

Packaging Up an XPI

Instead of ant, type ant xpi. This will make an .xpi file in the solvent directory.

Troubleshooting

The Solvent spray icon doesn't show up on my browser window

Look at the Extension panel by opening the Tools > Extension command from the Firefox menu and make sure that Solvent shows up.

If it's not there, make sure that the directory you typed in the {377cc066-cb3e-4ee8-ba63-39e761ad1cbe} file in the firefox extension directory contains an absolute path to your folder and that Firefox has enough permissions to read files from that folder.

You can also open the JavaScript Console by selecting the Tools > Javascript Console from the Firefox menu and look at potential problems that Firefox might tell you and suggest you possible problems.


More Info

Here are some some useful links:


Back to Solvent.