1

如果邮件正文中有预定义的字符串,我需要拦截 Thunderbird 发送的所有邮件并阻止发送。它应该是我们已经存在的 XPCOM dll 插件的一部分。

你有任何想法如何实现它吗?

4

1 回答 1

1
function send_event_handler( evt ) {

  var msgcomposeWindow = document.getElementById( "msgcomposeWindow" );

  var msg_type = msgcomposeWindow.getAttribute( "msgtype" );



  // do not continue unless this is really an actual send event

  if( !(msg_type == nsIMsgCompDeliverMode.Now || msg_type == nsIMsgCompDeliverMode.Later) )

    return;
  // do what ever you want to do here


}
// here is the listener
window.addEventListener( "compose-send-message", send_event_handler, true );
于 2011-05-06T14:43:59.620 回答