<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body smarttemplateinserted="true" text="#000000" bgcolor="#FFFFFF">
    <div id="smartTemplate4-template">
      <style>
#ag, #ag p {
  font-family: Cambria, Georgia, serif !important; 
}
</style>
      <div id="ag">
        <p>Garrafrauns, 3/May/2019 11:12 </p>
        <p>Dear Christopher ,</p>
        <p>looks interesting.</p>
        <pre>Services.scriptloader.loadSubScript</pre>
        <p>does this declare the Preferences variable within the scope
          of onLoad only? (I haven't used loadSubScript before) Or is it
          global.</p>
        <p><tt>let context = {}; </tt><br>
        </p>
        <p>Could you explain (and maybe add a comment, if you plan to
          incorporate into a ThunderStorm example) what this line does?
          (Is it necessary for loadSubScript?)</p>
        <hr width="100%" size="2">
        <p>In the meantime, I was working on getting MenuOnTop
          compatible - what is difficult is to make it work and hoist up
          / style the Thunderbird Menu of Tb67 right on the start. It
          works well when installing the new version (attached). I am
          just not yet quite sure why this is the case.</p>
        <p>on startup of Thunderbird (67):<br>
        </p>
        <p><img src="cid:part1.82B7B624.3812F1EA@gmail.com" alt=""></p>
        <p>when I install over the existing version (with all extension
          settings the same)</p>
        <p><img src="cid:part2.76E78DEA.0B261052@gmail.com" alt=""></p>
        <p>So what I still need to figure out is why the start method is
          not working when Thunderbird 67 loads - also my status bar
          icon / toolbar icons are not displayed. I wonder if there is a
          deficiency with loading legacy restartless Add-ons  with a
          chrome.manifest on Thunderbird startup.<br>
        </p>
        <p>Thunderbird 66 b3 has no such problems, and show this on
          startup, straight away:</p>
        <p><img src="cid:part3.559759A5.597602D8@gmail.com" alt=""></p>
        <p>In Thunderbird 67 I see <i>no debug error console outputs </i>on
          startup even though I have enabled  them on my options screen:</p>
        <p><img src="cid:part4.8D964A88.EDE0C3D6@gmail.com" alt=""
            width="412" height="270"></p>
        <p>(and the error console output works fully on install) -
          startup problems in Thunderbird are hard to solve because I
          cannot start a debugger with Thunderbird. I will try
          converting to a manifest.json next to see whether that solves
          the problem.<br>
        </p>
        <p>Axel<br>
        </p>
        <p><br>
        </p>
      </div>
      <style type="text/css">
.myName {
  text-shadow: 1px 1px 2px #DDD; 
  transition:font-size 0.5s;
}
.myName:hover, .myName a:hover 
{ font-size:13pt; text-shadow: 3px 3px 4px rgba(200,250,200,0.7);}
.moz-signature {opacity: 1.0 !important;}
.myName a { cursor: pointer !important; transition:font-size 0.5s;}
.myLogo {
  transition: all .4s ease-out;
}

.myLogo:hover {
  transform: scale(3) translate(-30px,-5px);
}
#mySignature, :not(blockquote) #mySignature {
  background: rgb(230,240,163); 
  background-image: linear-gradient(to bottom, rgba(230,240,163,1) 0%,rgba(210,230,56,1) 50%,rgba(195,216,37,1) 51%,rgba(219,240,67,1) 100%);
  color: #444; 
  box-shadow: 4px 4px 9px -2px rgba(0,0,0,0.65); 
  border-radius: 0.7em; padding: 0.8em 1.2em; 
  border: 1px dashed #8080A0; 
  font-size: 11pt !important;
  font-family: 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; 
  width: 65%; 
}
.AddonList a {
  color: #666666; 
  font-size: 10pt !important;
}
</style>
      <div id="mySignature"> <b class="myName"><a
            href="mailto:axel.grude@gmail.com">Axel Grude</a></b> <br>
        Music Production and Composition <br>
        Thunderbird Add-ons Developer <span class="AddonList">(<a
href="https://addons.thunderbird.net/thunderbird/addon/quickfolders-tabbed-folders/">QuickFolders</a>,
          <a
            href="https://addons.thunderbird.net/thunderbird/addon/quickfilters/">quickFilters</a>,
          <a
            href="https://addons.mozilla.org/firefox/addon/quickpasswords/">QuickPasswords</a>,
          <a
            href="https://addons.thunderbird.net/thunderbird/addon/zombie-keys/">Zombie
            Keys</a>, <a
            href="https://addons.thunderbird.net/thunderbird/addon/smarttemplate4/">SmartTemplate⁴</a>)</span>
        <br>
        Visit my <a href="https://www.youtube.com/c/thunderbirddaily">YouTube
          Channel</a> for email productivity tips <img
          style="margin-top: 1em; float: right; box-shadow: 1px 1px 2px
          rgba(20, 20, 20, 0.4);" moz-do-not-send="false" class="myLogo"
          src="cid:part12.3123AEB6.02008C35@gmail.com" alt="Get
          Thunderbird!" width="94" height="15">
      </div>
    </div>
    <div id="smartTemplate4-quoteHeader">
      <style type="text/css" scoped="">
#newHeaderAG1 b { font-weight:bold; color: #990033; min-width: 4.5em; max-width:none; display:inline-block;}
</style>
      <blockquote type="cite" style="margin-bottom: -20px !important;
        padding-bottom:20px !important;">
        <div id="newHeaderAG1" style="font-size: x-small; padding:1em;
          background-color:rgba(220,220,240,0.4); border-radius:3px;"> <b>Subject:</b>preferences
          workaround<br>
          <b>From:</b>Christopher Leidigh <a class="moz-txt-link-rfc2396E" href="mailto:cleidigh@gmail.com"><cleidigh@gmail.com></a><br>
          <b>To:</b>Axel Grude <a class="moz-txt-link-rfc2396E" href="mailto:axel.grude@gmail.com"><axel.grude@gmail.com></a> <br>
          <b>Sent: </b>Friday, 5/3/2019, 01:59 01:59 GMT DT +0100 [Week
          18]<br>
        </div>
      </blockquote>
    </div>
    <blockquote type="cite"
      cite="mid:e527596d-6343-e4d9-3ed3-76ca4241b04f@gmail.com"
      id="mid_e527596d_6343_e4d9_3ed3_76ca4241b04f_gmail_com" class="
      cite">Axel
      <br>
      <br>
      I think I've come up with a pretty clean workaround to the
      preferencesBindings issue.
      <br>
      Basically by changing execution order I eliminate the
      onDOMContentLoaded event before
      <br>
      the preferences are set within the user script.
      <br>
      I have this proposed solution out for comment, would be interested
      in your take.
      <br>
      <br>
      Basic approach:
      <br>
      <br>
      - Remove preferencesBindings.js <script> tag within the
      document
      <br>
      - within the user script onLoad():
      <br>
      <br>
      <br>
      <br>
      function onLoad(e) {
      <br>
          Services.console.logStringMessage("Preferences 1: onload event
      function");
      <br>
      <br>
          let context = {};
      <br>
      <br>
          // Grab the dialog element so we can play with it
      <br>
          const dialog = document.getElementById("preferences1dialog");
      <br>
      <br>
          // Load preferencesBindings script here, onDOMContentLoaded()
      has already fired
      <br>
          // therefore we will not get its errors
      <br>
      <br>
Services.scriptloader.loadSubScript(<a class="moz-txt-link-rfc2396E" href="chrome://global/content/preferencesBindings.js">"chrome://global/content/preferencesBindings.js"</a>,
      context, "UTF-8" /* The script's encoding */);
      <br>
          Services.console.logStringMessage("Preferences 1: onload
      loaded preferences script");
      <br>
      <br>
          // Now we load our preferences
      <br>
          Preferences.addAll([
      <br>
              { id: "extensions.preferences1.optionscolor", type:
      "unichar" },
      <br>
              { id: "extensions.preferences1.animationduration", type:
      "int" },
      <br>
              { id: "extensions.preferences1.animationenabled", type:
      "bool" },
      <br>
          ]);
      <br>
      <br>
          // Force the element updates
      <br>
          Preferences.updateAllElements();
      <br>
      <br>
          Services.console.logStringMessage("Preferences 1: onload
      loaded preferences ");
      <br>
      <br>
          ... other user stuff...
      <br>
      <br>
      <br>
      <br>
    </blockquote>
  </body>
</html>