How to debug a Thunderbird addon/extension's JavaScript

I want to develop a Thunderbird 12 addon. I have written a simple JS function. (File: "chrome\content\myApp.js"). This file is called by a xul-'onclick'-event. I have packed my addon as a .xpi file and then I have installed it. (All ok, it's working!)

Now I'd like to debug my JS functions. But I can't find a working JS Debugger. I have tried this addons:

  • "Javascript Debugger"(0.9.89). Not working: The thread doesn't stop at my breakpoints.
  • Firebug(1.7.2) + Chromebug(1.7.2). Not working: I can't enable the JS debug tab. (Update: I also can't set/change a "context")

Answers:

Answer

Unfortunately there's no such thing as a decent debugger for chrome (addons) javascript. Chromebug has been long abandoned, venkman doesn't work, addon authors are a little bit stranded there. A new debugging API called JSD2 is in the works at Mozilla, but it looks from the wiki that it's mostly targeted at content (webpage) javascript, not chrome (addons) javascript, at least not in the short term.

Fortunately, a very recent effort seems to have paid off: there's now a way to execute easily small snippets of javascript in a decent console-like window. See http://mikeconley.ca/blog/2012/05/11/scratchpad-ported-to-thunderbird-kinda/ for the details :).

Answer

Happily we once again have a debugger for Thunderbird! You need a newer/nightly version, but hanks to Philipp Kewisch's summer of code project we can use the Firefox debugger to remotely debug Thunderbird. More details at the following links: http://kewisch.wordpress.com/2013/09/22/thunderbird-developer-tools-wrapup/ http://kewisch.wordpress.com/2013/06/13/the-thunderbird-remote-debugger-is-alive/ https://bugzilla.mozilla.org/show_bug.cgi?id=876636

If you are really committed to TB12, you can debug on the nightly then test on TB12.

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.