Get sender and recipients in Thunderbird extension upon sending message

前端 未结 2 859
我寻月下人不归
我寻月下人不归 2021-01-27 03:04

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

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-27 03:44

    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
    

提交回复
热议问题