wiki:DeveloperDocumentation

How to debug a Firefox/Thunderbird plugin

  • Check out the Dragontalk plugin of choice in Eclipse
  • Use build.xml to build the plugin
  • Install the plugin in Firefox/Thunderbird
  • Install Venkman (JavaScript debugger) in Firefox/Thunderbird
  • Open Venkman (Tools/JavaScript Debugger)
  • Deselect "Debug/Exclude Browser Files"
  • Search for "DFKI" in Loaded Scripts pane
  • Open a script of your choice
  • Set a breakpoint (single click left from source line)

Using the debugger to step through the plugin's and Mozilla's code is probably simpler than going through docs.

If you want to add new functionality, have a look at the numerous existing Firefox/Thunderbird plugins to get an idea how things are done.

For enabling the console (the place dump messages go to) see http://gnowsis.opendfki.de/wiki/MozillaDeveloping . You may have to enable dump in gnowsis_dump().

General Hints

  • Use try {...} catch(e) { dump(e); alert(e); } in abundance. Uncaught exceptions typically vanish in the depths of Mozilla and are hard to find without lots of debugging.
    • Never swallow exceptions, always at least dump() them unless you really know what you are doing.
Last modified 16 years ago Last modified on 08/29/08 17:59:48