Well, now that I have gotten my first FireFox extensionworking, I decided to see if I could make it run within Thunderbird. The first issue I ran into was trying to figure out how to debug extensions within Thunderbird. It took me a while to figure it out, but it is pretty much the same as in FireFox.
First, you have to set the following Thunderbird preference to true:
However, there is not an easy way (such as FireFox’s about:config) to set the preference. In order to set it, you need to add the following line to your user.js file in your Thunderbird profile directory:
If the file doesn’t exist (it doesn’t by default), just create it. You can find more info on setting Thunderbird preferences here.
This setting will redirect dump() statements from your extension to the console.
In order to view the dump statements, you have to start Thunderbird from the console / terminal. You can do this on OS X with the following command line (replace the path to match your system):
Now, if you add:
To you extension, then you will see:
output to the console / terminal that you started Thunderbird from.
You can now debug Thunderbird extensions the same way you debug FireFox extensions.