Bug 1497656 - set up Thunderbird custom elements on DOMWindowCreated, to make them work also in the stand-alone message window. r=aceman
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Fri, 12 Oct 2018 10:53:22 +0300
changeset 33358 e2b203306dad4554844efa16f2c43cba60cee85e
parent 33357 22016492fb10c5d1b4175047c095d935c19de151
child 33359 7dbabf78da029efe0b7f5d723837e9ebd84d058d
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
reviewersaceman
bugs1497656
Bug 1497656 - set up Thunderbird custom elements on DOMWindowCreated, to make them work also in the stand-alone message window. r=aceman
mail/components/mailGlue.js
--- a/mail/components/mailGlue.js
+++ b/mail/components/mailGlue.js
@@ -129,17 +129,17 @@ MailGlue.prototype = {
       // (i.e. in messenger.xul).
       aSubject.addEventListener("DOMContentLoaded", () => {
         if (aSubject.document.documentElement.hasAttribute("lightweightthemes")) {
           new LightweightThemeConsumer(aSubject.document);
         }
       }, {once: true});
 
       // Set up our custom elements.
-      aSubject.addEventListener("DOMDocElementInserted", () => {
+      aSubject.addEventListener("DOMWindowCreated", () => {
         let doc = aSubject.document;
         if (doc.nodePrincipal.isSystemPrincipal && (
             doc.contentType == "application/vnd.mozilla.xul+xml" ||
             doc.contentType == "application/xhtml+xml"
         )) {
           Services.scriptloader.loadSubScript(
             "chrome://messenger/content/customElements.js", doc.ownerGlobal);
         }