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
The primary contact route is to send an email to the Maavis Google Group.
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.
%HOMEPATH%\documents;"%ProgramFiles%\Mozilla Firefox\firefox.exe" -nokiosk -no-remote -quickstart -P MaavisDev The -no-remote allows you to run Maavis alongside your usual Firefox instance, -nokiosk leaves all Firefox UI visible, while -quickstart skips the splash screen and startsound for faster debugging. The first run you will need to create the MaavisDev profile and may want to specify the location to be in your workspace to ensure it doesn’t get deleted if you uninstall Firefox.C:\Users\Steve\AppData\Roaming\Mozilla\Firefox\Profiles\14g3opw0.MaavisDev and in the extensions folder create a file maavis@fullmeasure.co.uk which contains the path to the extension folder of the Maavis code. E.g. C:\Users\Steve\projects\Maavis\extension\ NB the trailing \;prefs.js in the profile folderuser_pref("browser.dom.window.dump.enabled", true);
user_pref("javascript.options.showInConsole", true);
user_pref("javascript.options.strict", true);
user_pref("nglayout.debug.disable_xul_cache", true);
user_pref("nglayout.debug.disable_xul_fastload", true);
user_pref("extensions.logging.enabled", true);
. $topsrcdir/browser/config/mozconfig
mk_add_options MOZ_OBJDIR=../obj
mk_add_options MOZ_MAKE_FLAGS=-j8
ac_add_options --disable-tests
ac_add_options --disable-debug
ac_add_options --enable-optimize
ac_add_options --enable-extensions=default,TTS,processmanager
src\ into extensions\ in the Mozilla source tree and make -fclient.mk as usual. The built components are in $(objdir)/dist/bin/extensions. To speed up development by only building the components make in $(objdir)/extensions/<extension>). For a full introduction see James Boston and Humph’s notes on building C++ XPCOM components. Also see James Boston’s notes on nsIProcess improvements .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.
extension\platform folder with python setup.py py2exe.To use the skype features you will need Install the supported version of Skype
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.
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.
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.
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.
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.
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