nsIEditor is now builtinclass

Jonathan Protzenko jonathan.protzenko at gmail.com
Thu Aug 28 22:39:59 UTC 2014

On 08/27/2014 11:16 PM, Ehsan Akhgari wrote:
> What I still don't understand is why you're doing all of this, IOW 
> what is the problem that you are trying to solve.  Sorry if it's 
> obviously mentioned somewhere but I don't really understand the 
> Thunderbird side of this setup, so perhaps I'm missing something.
Sure. Let me try to rephrase it shortly.
- I want to send the contents of a given iframe as an HTML mail.
- The only way to send an HTML mail is to use the nsMsgCompose class and 
let it get its HTML input from an nsIEditor.
- I should hence tell nsMsgCompose to get its HTML from the nsIEditor 
associated to the <iframe> (for which I set contenteditable="true").
- The only way to tell nsMsgCompose "here's the editor you should get 
your HTML from" is to call initEditor.
- initEditor associates an nsIEditor to the nsMsgCompose instance, but 
also blasts the contents of the existing nsIEditor (my iframe) by 
inserting "<blockquote>contents of the email being replied 
to</blockquote>" into it.
- (Side note: Forgetting to mention which mail I'm replying to would 
result in no <blockquote> being inserted, but then some headers of the 
outgoing mail would be set incorrectly.)

The best, short-term way to fix this is to make nsIMsgCompose's editor 
field mutable, so that I can tell nsMsgCompose which nsIEditor the HTML 
should be taken from, without having the nasty side-effect of seeing the 
contents of the iframe destroyed because of the other quoting stuff 
initEditor is doing.

Does that help?

Thanks for actually trying to understand this :)

~ jonathan

More information about the tb-planning mailing list