I\'m playing around trying to create a Thunderbird extension, one of the bootstrapped/restartless type (I mean, javascript code is not run from overlays. Instead listen
I've done it even more simply using this.
var win = Services.wm.getMostRecentWindow("msgcompose");
composeFields = {};
win.Recipients2CompFields(composeFields);
// composeFields has more properties than this like cc and bcc but the
// below is what you asked for.
Components.utils.reportError(composeFields.to); // Debug output.
var sender = document.getElementById("msgIdentity").description