title: Google.script.run functions failing in firefox, safari
body: <p>I am implementing a HTML sidebar and Modal dialogue in an Appscript Project bound to a Google Sheet. The HTML pages call scripts from my scripts.gs file in two different ways - onload and onclick. Both of these work fine in Chrome 89.0.4389.90 (Official Build) (64-bit) on Windows. However, they don't execute at all in Firefox 78.9.0esr (64-bit) on Windows or Safari on Mac.</p>
  <p>Looking at the Console log in Chrome only shows <code>Net state changed from IDLE to BUSY</code> when the script executes. Firefox logs <code>Uncaught ScriptError: We're sorry, a server error occurred. Please wait a bit and try again.</code></p>
  <p>Here are the scripts in the modal:</p>
  <pre><code>&lt;script&gt;
      window.onload = function(){
        google.script.run.withSuccessHandler(userData).getNewAccountRecord();
      }
      function userData(recordArray) {
        showData(recordArray, 'data')
      }    
      function showData(recordArray, divName){
        var html = &quot;&quot;;
        var record;
        html = &quot;&lt;table&gt;&quot;
        for(j=0; j&lt;recordArray.length; j++) {
          record = recordArray[j];
          for (var i=0; i&lt;record.headerArray.length; i++) {
          if (record.dataArray[i] != &quot;&quot;) {
            html += `&lt;tr&gt;&lt;td&gt;${record.headerArray[i]}:&lt;/td&gt;&lt;td class=&quot;copytext&quot; onClick=&quot;copyStringToClipboard('${record.dataArray[i]}')&quot; &gt; ${record.dataArray[i]}&lt;/td&gt;`;
            //html += `&lt;br&gt;${record.headerArray[i]}: &lt;span onClick=&quot;copyStringToClipboard('${record.dataArray[i]}')&quot;&gt;${record.dataArray[i]}&lt;/span&gt;`;
          }
        }
        }
        html += &quot;&lt;/table&gt;&quot;
        document.getElementById(divName).innerHTML = html;
      }
      function copyStringToClipboard (str) {
          var el = document.createElement('textarea');
          el.value = str;
          el.setAttribute('readonly', '');
          el.style = {position: 'absolute', left: '-9999px'};
          document.body.appendChild(el);
          el.select();
          document.execCommand('copy');
          document.body.removeChild(el);
          }
  &lt;/script&gt;
  </code></pre>
  <p>The getNewAccountRecord() function is in my scripts.gs file and executes beautifully on Chrome.</p>
  <p>Any thoughts?</p>
  <p>Notes</p>
  <ul>
  <li>This project does use an external library (version, not head deployment) though none of the scripts this is referencing are in that external library.</li>
  <li>google.script.host.close() does execute properly when called thru an onmousedown button</li>
  <li>Using V8 runtime engine</li>
  </ul>
  <p>Appreciate any insights.</p>
  <p>Tyler</p>