Send Button Not Working v45.0

User Help for Mozilla Thunderbird
Post Reply
slitherfast
Posts: 2
Joined: April 27th, 2016, 8:30 am

Send Button Not Working v45.0

Post by slitherfast »

I updated Thunderbird today to v45.0. After the update when I try to send a message the button does not work nor does Ctrl+Return. I can receive mail fine. I have the following error in the error log.
RBgoDoCommand.apply(this,arguments);
if (aCommand == "cmd_paste" && ! document.getElementById("cmd_paste").disabled)
setTimeout(QuoteAndComposeManager.pasteFixFont, 500);
};
}

var QuoteAndComposeManager = {

correctSRCafterINNERHTMLcall : function() {
var doc = gMsgCompose.editor.document;
var imgs = doc.getElementsByTagName("img");
for (var i=0; i<imgs.length;i++) {
var img = imgs;
var src = img.src;
src = src.replace("%7C", ":");
img.setAttribute("src", src);
}
},

correctSRC : function() {
try {
// This code tries to fix the bugs with "Edit as new" function with images
// The bugs are two and both related to corrupt path in img tags
//
// Bug #1: after you save once, the path becomes wrong, because it mixes the path of
// the orginal message and the key of the current draft: my fix restores the key of the
// original message.
//
// Bug #2 (only Windows versions): the path on Windows changes che char ":" in "|";
// when you save a draft from an "Edit as view" action, the char "|" is escaped and so
// the save fails: my fix restores the char ":" instead of %7C (| escaped)
//
// Note: both bugs seem not to be present when you "edit as new" a message directly in Drafts folder

var doc = gMsgCompose.editor.document;
if (gMsgCompose.originalMsgURI != "")
var num = gMsgCompose.originalMsgURI.substring(gMsgCompose.originalMsgURI.lastIndexOf("#")+1);
else
var num = null;
var imgs = doc.getElementsByTagName("img");
for (var i=0; i<imgs.length;i++) {
var img = imgs;
var src = img.src;
var src_correct = src;
var isDraft = (src.indexOf("/Drafts?") > -1);
if (num && src.indexOf("mailbox") == 0 && src.indexOf("number="+num+"&") == -1) {
if (! isDraft) {
// Fix for bug #1
var src_parts1 = src.split("number=");
var src_parts2 = src_parts1[1].substring(src_parts1[1].indexOf("&"));
src_correct = src_parts1[0]+"number="+ num + src_parts2;
}
}
// Fix for bug #2
src_correct = src_correct.replace("%7C", ":");
img.setAttribute("src", src_correct);
}
}
catch(e) {}
},

/*menus : function() {
if (QuoteAndComposeManager.restoreMenu) {
document.getElementById("formatMenu").hidden = false;
document.getElementById("insertMenu").hidden = false;
document.getElementById("outputFormatMenu").hidden = false;
var showFormat = document.getElementById("menu_showFormatToolbar")
showFormat.hidden = false;
if (showFormat.getAttribute("checked") == "true")
document.getElementById("FormatToolbar").hidden = false;
QuoteAndComposeManager.restoreMenu = false;
}
},*/

pasteFixFont : function() {
if (! gMsgCompose.composeHTML)
return;
if (RBprefs.getBoolPref("extensions.quoteandcomposemanager.font.fix")) {
var ed = gMsgCompose.editor.QueryInterface(Components.interfaces.nsIHTMLEditor);
var doc = gMsgCompose.editor.document;
if (doc.body.lastChild.tagName.toUpperCase() != "BR") {
var br = doc.createElement("br");
doc.body.appendChild(br);
}

/*
// Sometimes when the user pastes some node(s), the pasted root node encloses
// all and there is no way to get out of it. So we add a new node as "way out".
// Notice that it's used a DIV tag, because it's a block element and so it's added
// outside the pasted root node (with inline element it'd be added inside).
// Of course the DIV is stylized as inline, because we just need a space outside
// the pasted root node.
var el = doc.createElement("div");
el.setAttribute("style", "display:inline");
el.innerHTML = "&nbsp;";
ed.insertElementAtSelection(el,false);
// Sometimes Thunderbird adds a BR tag after pasted content
if (el.previousSibling.tagName.toUpperCase() == "BR")
el.parentNode.insertBefore(el, el.previousSibling);
// Selecting the empty DIV tag, it will be automatically erased when the user will write
ed.selectElement(el);
*/
}
},

fixNewImgPath : function(ev) {
if (! gMsgCompose.composeHTML || ! RBprefs.getBoolPref("extensions.quoteandcomposemanager.editasnew.fix_img_path"))
return;
// A new image is added as node
if (ev.target && ev.target.tagName && ev.target.tagName.toUpperCase() == "IMG") {
var src = ev.target.src;
src = src.replace("%7C", ":");
ev.target.setAttribute("src", src);
}
// Some new nodes are added, one of them at least is an image (for example with copy&paste)
else if (ev.target && ev.target.innerHTML && ev.target.innerHTML.toLowerCase().indexOf("<img") > -1)
QuoteAndComposeManager.correctSRCafterINNERHTMLcall();
},

cleanStyle : function() {
if (! RBprefs.getBoolPref("extensions.quoteandcomposemanager.clean.style"))
return;
var dom = QuoteAndComposeManager.getMailDOM();
var body = dom.body;
var pNodes = body.getElementsByTagName("p");
for (var i=0;i<pNodes.length;i++) {
pNodes.removeAttribute("class");
}
var opNodes = body.getElementsByTagName("o:p");
for (var i=0;i<opNodes.length;i++) {
opNodes.parentNode.removeChild(opNodes);
}
var inner = body.innerHTML.toString();
if (inner.indexOf("<style>") > -1)
inner = inner.replace(/<style>(?:.|\n)+<\/style>/gi, "");
if (inner.indexOf("<xml>") > -1)
inner = inner.replace(/<xml>(?:.|\n)+<\/xml>/gi, "");
body.innerHTML = inner;
if (gMsgCompose.type == 4) {
var head = dom.getElementsByTagName("head")[0];
inner = head.innerHTML.toString();
inner = inner.replace(/<style>(?:.|\n)+<\/style>/gi, "");
inner = inner.replace(/<xml>(?:.|\n)+<\/xml>/gi, "");
head.innerHTML = inner;
}
},

onSend : function(evt) {
var msg_type = document.getElementById("msgcomposeWindow").getAttribute("msgtype");
var sendDelay = RBprefs.getIntPref("extensions.quoteandcomposemanager.send.delay");
if (sendDelay > 0 && msg_type == nsIMsgCompDeliverMode.Now) {
var obj = {};
obj.abort = false;
obj.delay = sendDelay;
window.openDialog ("chrome://realborders/content/confirm.xul","", "chrome, modal, close, centerscreen", obj);
if (obj.abort) {
evt.preventDefault();
return;
}
}

if (! gMsgCompose.composeHTML)
return;

QuoteAndComposeManager.cleanStyle();
try {
var dom =QuoteAndComposeManager.getMailDOM();
// hack for compatibility with Outlook 2007
if (RBprefs.getBoolPref("extensions.quoteandcomposemanager.insert_outlook_div")) {
if (msg_type == nsIMsgCompDeliverMode.Now || msg_type == nsIMsgCompDeliverMode.Later) {
var blockquotes = dom.getElementsByTagName("blockquote");
var bordercolor = RBprefs.getCharPref("extensions.quoteandcomposemanager.borders.color");
for (var i=blockquotes.length-1; i>-1; i--) {
var bqHTML = blockquotes.innerHTML;
if (blockquotes.getAttribute("type") =="cite") {
var stylecite2 = "border-left: 2px solid " + bordercolor +"; border-right: 2px solid " + bordercolor +"; padding: 0px 15px; margin: 2px 0px;"
blockquotes.innerHTML = '<!--[if !IE]><DIV style="'+stylecite2+'"><![endif]-->'+bqHTML+"<!--[if !IE]></DIV><![endif]-->";
}
}
}
}

var need_fix = true;

var div1 = dom.body.getElementsByTagName("div")[0];
if ((div1.getAttribute("class") == "QCMcontainer" || div1.getAttribute("id") == "QCMcontainer") && div1.parentNode == dom.body)
need_fix = false;

var font1 = dom.body.getElementsByTagName("font")[0];
if (font1.getAttribute("class") == "QCMcontainer" && font1.parentNode == dom.body)
need_fix = false;

if (need_fix && RBprefs.getBoolPref("extensions.quoteandcomposemanager.font.fix")) {
// do not continue unless this is an actual send event
if (msg_type == nsIMsgCompDeliverMode.Now || msg_type == nsIMsgCompDeliverMode.Later) {
// All the body mail is included in a div TAG with the same style of the BODY tag
// This is needed, because when the message will be replied, the tag BODY will
// be stripped off. With this trick, the style will be kept also when this message
// will be quoted in reply
var font = dom.body.style.fontFamily;
var size = dom.body.style.fontSize;
var fw = "";
var fs = "";
// All the body mail is included in a div TAG with the same style of the BODY tag
// This is needed, because when the message will be replied, the tag BODY will
// be stripped off. With this trick, the style will be kept also when this message
// will be quoted in reply
if (font != "" && size !="") {
if (dom.body.style.fontWeight)
fw = "font-weight: bold;";
if (dom.body.style.fontStyle)
fs = "font-style: italic;";
if (RBprefs.getBoolPref("extensions.quoteandcomposemanager.font.fix_high_compatibility")) {
var size2 = QuoteAndComposeManager.pixel2size();
var div = '<font class="QCMcontainer" face="'+font+'" size="'+size2+'"><div class="QCMcontainer" style="font-family:'+font+';font-size:'+size+';'+fw+fs+'">';
dom.body.innerHTML = div + dom.body.innerHTML + "</div></font>";
}
else {
var div = '<div class="QCMcontainer" style="font-family:'+font+';font-size:'+size+';'+fw+fs+'">';
dom.body.innerHTML = div + dom.body.innerHTML + "</div>";
}
}
}
}
}
catch(e) {}
if (RBprefs.getBoolPref("extensions.quoteandcomposemanager.editasnew.fix_img_path"))
QuoteAndComposeManager.correctSRC();
else
QuoteAndComposeManager.correctSRCafterINNERHTMLcall();
},

pixel2size : function() {
var pixel = RBprefs.getIntPref("extensions.quoteandcomposemanager.font.fix_size");
if (pixel <= 9)
size = 1;
else if (pixel < 12)
size = 2;
else if (pixel < 17)
size = 3;
else if (pixel < 20)
size = 4;
else if (pixel < 25)
size = 5;
else if (pixel < 33)
size = 6;
else
size = 7;
return size;
},

// This function is called just by hitting CTRL 6
removeQuoting : function() {
if (window.arguments && window.arguments[0])
var msgType = window.arguments[0].type;
else
var msgType = gMsgCompose.type;
if (msgType !=2 && msgType !=3 && msgType !=6 && msgType !=7 && msgType !=8 && msgType !=9)
return;
if (! gMsgCompose.composeHTML)
QuoteAndComposeManager.deletePlainTextQuoting();
else {
var blockquotes = QuoteAndComposeManager.getMailDOM().getElementsByTagName("blockquote");
for (i=0;i<blockquotes.length;i++)
blockquotes.setAttribute("style", "border:none !important; padding-left:0px !important; padding-right:0px !important; margin-left:0px !important; margin-right:0px !important");
}
},

replyOnTop : function() {
var id = getCurrentIdentity();
return (id.replyOnTop == 1);
},

getMailDOM : function() {
return document.getElementById("content-frame").contentDocument;
},

deletePlainTextQuoting : function() {
var body = QuoteAndComposeManager.getMailDOM().body;
if (! body)
return;
var bodyHTML = body.innerHTML;

// --- This code has been created by Chitu Okoli

// Whenever the original message had a line with a leading space, recreate the original by stripping it of >
// A &nbsp is used so as to not interfere with subsequent regexs
bodyHTML = bodyHTML.replace(/<br>(>)+ /g, "<br>&nbsp;");
// Delete all other > symbols that follow a line break (no matter how many there are)
bodyHTML = bodyHTML.replace(/<br>(>)+ ?/g, "<br>");
// special case to delete the very first "> " quote character
bodyHTML = bodyHTML.replace(/(<\/?span [^>]+>)(>)+ /g, "$1");
// Remove new line characters in the middle of paragraphs (always preceded by " " in Thunderbird quoting)
// This line is buggy, since it does not distinguish between when Thunderbird added a <br> and when there
// was already a line break to begin with. To reduce bugginess, it matches only on exactly one space
// preceding the <br>. As it is now, it works most of the time.

if (RBprefs.getBoolPref("extensions.quoteandcomposemanager.plaintext.remove_br"))
bodyHTML = bodyHTML.replace(/([^ |-]){1} <br>/g, "$1 ");

// --- End of code created by Chitu Okoli

body.innerHTML = bodyHTML;
if (RBprefs.getBoolPref("extensions.quoteandcomposemanager.reply.force_rewrap"))
QuoteAndComposeManager.rewrap();
},

setCursor : function() {
if (! QuoteAndComposeManager.replyOnTop())
GetCurrentEditor().endOfDocument();
else
GetCurrentEditor().beginningOfDocument();
},

rewrap : function() {
if (! RBprefs.getBoolPref("mailnews.display.disable_format_flowed_support"))
goDoCommand('cmd_rewrap');
QuoteAndComposeManager.setCursor();
},

manipulateHTMLReplyHeaders : function() {
QuoteAndComposeManager.cleanStyle();
var blockquotes = QuoteAndComposeManager.getMailDOM().getElementsByTagName("blockquote");
// No blockquote tag? exit!
if (blockquotes.length == 0) {
return;
}
// gets the prefs
var textendquote = RBprefs.getCharPref("extensions.quoteandcomposemanager.text.endquote");
var bordercolor = RBprefs.getCharPref("extensions.quoteandcomposemanager.borders.color");
var bgcolorpref = RBprefs.getBoolPref("extensions.quoteandcomposemanager.bgcolor.enable");
var realborders = RBprefs.getBoolPref("extensions.quoteandcomposemanager.borders.insert");
var levelquote = RBprefs.getIntPref("extensions.quoteandcomposemanager.borders.levelquote");
var override= RBprefs.getBoolPref("extensions.quoteandcomposemanager.borders_style.mark_as_important");
var sep = override ? " !important;" : " ;";
var black = RBprefs.getBoolPref("extensions.quoteandcomposemanager.headers.always_black");
var changefont = RBprefs.getBoolPref("extensions.quoteandcomposemanager.headers.change_font");
var moveheaders = RBprefs.getBoolPref("extensions.quoteandcomposemanager.headers.move_inside_quote");

var body = QuoteAndComposeManager.getMailDOM().body;

if ( body && (black || changefont || moveheaders)) {
var spanstyle = "";
var span = QuoteAndComposeManager.getMailDOM().createElement("span");
span.setAttribute("class", "headerSpan");
var nodeArray = new Array;
var bodyNodes = body.childNodes;
var index = 0;
if (body.getElementsByClassName("moz-cite-prefix")[0])
var moz_cite_prefix = true;
else
var moz_cite_prefix = false; // this variable will be true with TB13 or higher

if (moz_cite_prefix) {
// We find all the nodes before the blockquote tag, i.e the headers
// and we put all the headers node into the nodeArray
while (bodyNodes[index] != blockquotes[0]) {
nodeArray[index] = bodyNodes[index];
if (nodeArray[index] && nodeArray[index].getAttribute && nodeArray[index].getAttribute("class") == "moz-cite-prefix") {
var signature = nodeArray[index].getElementsByClassName("moz-signature")[0];
if (signature) {
nodeArray[index].parentNode.insertBefore(signature.previousSibling, nodeArray[index]);
nodeArray[index].parentNode.insertBefore(signature, nodeArray[index]);
}
span.appendChild(nodeArray[index]);
moz_cite_prefix = true;
var br = QuoteAndComposeManager.getMailDOM().createElement("br");
body.insertBefore(br, body.firstChild);
if (QuoteAndComposeManager.replyOnTop())
GetCurrentEditor().beginningOfDocument();
break;
}
index++;
}
}
else {
if (QuoteAndComposeManager.replyOnTop())
var diff = 2;
else
var diff = 0;
while (bodyNodes[index] != blockquotes[0]) {
nodeArray[index] = bodyNodes[index];
index++;
}
// Parse the headers and move them into the SPAN element
for (var i=diff;i<nodeArray.length;i++) {
if (i==nodeArray.length-1 && moveheaders)
span.appendChild(QuoteAndComposeManager.getMailDOM().createElement("br"));
User avatar
LIMPET235
Moderator
Posts: 39936
Joined: October 19th, 2007, 1:53 am
Location: The South Coast of N.S.W. Oz.

Re: Send Button Not Working v45.0

Post by LIMPET235 »

Moving this to Thunderbird Support...
[Ancient Amateur Astronomer.]
Win-10-H/64 bit/500G SSD/16 Gig Ram/450Watt PSU/350WattUPS/Firefox-115.0.2/T-bird-115.3.2./SnagIt-v10.0.1/MWP-7.12.125.

(Always choose the "Custom" Install.)
slitherfast
Posts: 2
Joined: April 27th, 2016, 8:30 am

Re: Send Button Not Working v45.0

Post by slitherfast »

I figured out how to solve this problem. Turn off all extensions restart Thunderbird and you should be good to go. Then turn your extensions on one by one.
wsmwk
Posts: 2833
Joined: December 7th, 2004, 6:52 am
Contact:

Re: Send Button Not Working v45.0

Post by wsmwk »

slitherfast,
Which extensions are you using?
amcgall
Posts: 7
Joined: April 29th, 2016, 1:05 am

Re: Send Button Not Working v45.0

Post by amcgall »

I discovered that the QuoteAndComposeManager extension caused the send button to not work. I disabled the extension, restarted Thunderbird and then the send button started working.
User avatar
LIMPET235
Moderator
Posts: 39936
Joined: October 19th, 2007, 1:53 am
Location: The South Coast of N.S.W. Oz.

Re: Send Button Not Working v45.0

Post by LIMPET235 »

Hi,
Thanks for the feedback.
I'm sure that Paolo would appreciate it as well.
But, given the current circumstances re; Mozilla & their current use/installation/updating etc.,
of extensions, it appears that Paolo, as well as others are not too pleased about it.

He can be contacted on his site...(Read his Spotlight notes.)
> https://nic-nac-project.org/~kaosmos/index-en.html
[Ancient Amateur Astronomer.]
Win-10-H/64 bit/500G SSD/16 Gig Ram/450Watt PSU/350WattUPS/Firefox-115.0.2/T-bird-115.3.2./SnagIt-v10.0.1/MWP-7.12.125.

(Always choose the "Custom" Install.)
anglia
New Member
Posts: 1
Joined: April 30th, 2016, 5:46 am

Re: Send Button Not Working v45.0

Post by anglia »

Yes, same thing happened to me, disabling extensions resolved the situation
I also had the QuoteandCompose Manager installed, never used it, so now disabled
graab
Posts: 1
Joined: June 28th, 2008, 11:12 am

Re: Send Button Not Working v45.0

Post by graab »

Yes, same thing happened to me, disabling extensions resolved the situation
I also had the QuoteandCompose Manager and EditSendernow disabled
Post Reply