1
我正在爲Thunderbird編寫附加組件,並希望能夠在某些條件下取消發送電子郵件。我有以下代碼,它允許我在發送電子郵件之前執行代碼,但我不知道如何阻止它。停止發送電子郵件
document.getElementById("msgcomposeWindow").addEventListener("compose-send-message", function(){
var msgcomposeWindow = document.getElementById("msgcomposeWindow");
var msg_type = msgcomposeWindow.getAttribute("msgtype");
// do not continue unless this is an actual send event
if(!(msg_type == nsIMsgCompDeliverMode.Now || msg_type == nsIMsgCompDeliverMode.Later))
return;
alert('Sending Message...');//works fine
if(true){ //eventually this would have more logic...
//stop email
}else{
//let email go
}
}, true);
我需要做些什麼來阻止電子郵件?
這完美地工作。謝謝! – Daniel