DeveloperNotes

Maavis is a Firefox extension and so uses many of the Mozilla platform technologies. It also includes a ‘server’ written in Python. For general information on developing extensions MDC Extensions and especially Setting up. See DesignNotes for a description of the architecture.

There are 2 levels of developer

Contact us

The primary contact route is to send an email to the Maavis Google Group.

Detailed developer set up instructions

There are a few components to install and configure. For convenience correct versions of the various dependencies can be found here. For now the source must be fetched from subversion but tarballs will be provided soon.

Building the MaavisSkyper server for Skype integration and joystick button detection

Skype integration is provided by the MaavisSkypeServer which a fork of UNC’s Outfox. The skype code is in channel.py. If the server is not found an error is logged to the console and Skype integration is unavailable. Thus a quick way to disable this is to rename the server. Note having the joystick button code here is a big temporary hack.

By default, if platform\dist\MaavisSKypeServer.exe is found it will be run, otherwise the source code will be used. The source code will always be used if useSource = true in outfox.js. When using the source a debug window is shown, and this also appears if the exe is built using the console= option rather than windows= in setup.py.

To use the skype features you will need Install the supported version of Skype

Debugging tips

Occasionally code stubbornly just doesn’t work with no visibility on why. If that happens it’s best to strip it right back till it does work. Makes sure the jsconsole is working and you can print to it or use alert. Use the -jsconsole command line option as some early errors only appear there and not in Firebug. Also try the -console option especially for basic add-on config problems. If nothing seems to happen then check manifest and bindings are all correctly mapped as you don’t get errors if the files are not found in the chrome.

When changing the add-on doesn’t seem to work

Firefox caches the add-on configuration so if you change some files like extension\install.rdf you must delete the 3 extension.* files in the profile folder to force regeneration of the cache.

XBL

Debugging XBL can be a real pain. Errors in XBL don’t get reported and exceptions vanish. Therefore if you are having a problems with a method add an exception handler around the code with windows.alert() or logging. In fact I’m thinking of making it a style guideline to always have exception handlers round XBL methods (thoughts?). Another problem is that Venkman doesn’t seem to show method local const, so may need to revert to good old fashioned alerts/logs to debug.

Building the installer

Install Inno Setup to open and compile the installer\Maavis.iss file. The installer will be in the Output subfolder. You will need to setup the following files in addition to those checked out for the installer to compile.

You can install on the development machine as well if you like as it uses the Maavis Firefox profile and so should not clash with the MaavisDevprofile as long as they point to their own copies of the extension. Note that Firefox and Skype are installed for all users, so are best not installed.

Making a release

  1. Check the version number was correctly increased as the last step of the previous release (see below)
  2. update the redistributed files if required – see above
  3. Build the installer by compiling Maavis.iss with inno setup – see notes above.
  4. Test the full install and Maavis on a clean machine. Take special care if redistributed installers or plugins changed.
  5. Copy the installer to Fullmeasure.co.uk/maavis (NB we need a better home, space is limited here)
  6. Update the wiki download page Download_and_Installation, at a minimum link to the new release.
  7. Create a tag in svn
  8. Update the version number in the Maavis.iss and install.rdf for the next release and check them into SVN

Other notes

Coding

Javascript, DOM and XUL etc etc

Mozilla’s MDC is the resource for all things for the platform. For javascript the Mozilla JS 1.5 guide is good and w3schools has good tutorials and references (and for DOM and other topics).
The XUL Tutorial is also a must read, especially the XBL Bindings section.

Coding style guidelines

Mozilla’s javascript style guidelines and Douglas Crockford’s are a great starting point and will be followed closely. JSLint is an excellent quality control tool