1

I have a simple test google apps script that prints the content of a sheet. It works fine in Safari on Mac but on Chrome I get a blank page with this error in the console:

dropping postMessage.. was from unexpected window

This is the code:

    function doGet() {
  return HtmlService
      .createTemplateFromFile('index')
      .evaluate();
}

function getData() {
  return SpreadsheetApp
      .openById('1vyrKW7ABfCDY-a8H4AZ2JFZwA7lpCEuD6R5x4fJ8_qI')
      .getActiveSheet()
      .getDataRange()
      .getValues();
}

Here is the HTML template:

<!DOCTYPE html>
<html>
  <head>
    <base target="_top">
  </head>
  <body>
    <? var data = getData(); ?>
    <table>
      <? for (var i = 0; i < data.length; i++) { ?>
        <tr>
          <? for (var j = 0; j < data[i].length; j++) { ?>
            <td><?= data[i][j] ?></td>
          <? } ?>
        </tr>
      <? } ?>
    </table>
  </body>
</html>

And here is the published web app: https://script.google.com/macros/s/AKfycbyYiAlqtqElFeyiWD6yq2zWtzQ1vdJMkHUPOfZrQFvicTO_uXs/exec

zorro2b
  • 2,227
  • 4
  • 28
  • 45

1 Answers1

3

It is a known issue with the latest version of Google Chrome. If you open the web app inside Firefox, it would work just fine.

Please star this issue on code.google.com for updates.

Amit Agarwal
  • 10,910
  • 1
  • 32
  • 43
  • 2
    It looks like the issues is related to the LastPass extension for Chrome. The issue gets resolved if the extension is disabled. – Amit Agarwal Jan 30 '17 at 13:40