Search code examples
google-apps-scriptiframeweb-applications

How to fix "Error while parsing the 'sandbox' attribute" flags error with HtmlService?


I have just tried many of the sample Google Apps Script scripts

But I always get the error:

"Error while parsing the 'sandbox' attribute: 'allow-modals', 'allow-popups-to-escape-sandbox' are invalid sandbox flags."

I have tried with Chrome and Safari on Mac OS and Chrome on Win 8.


Solution

  • This error can be safely ignored, the script will continue to run fine. These are two new flags which have been implemented in Chrome 46 (the current stable release). If you're testing in a browser that doesn't support them, you'll see that error (which is really just a warning).

    The allow-modals flag is required because Chrome will, by default, block modal dialogs within a sandboxed iframe. Adding this flag allows modals to work in your apps scripts.

    The allow-popups-to-escape-sandbox flag is somewhat similar; its purpose is to permit new windows to be created without them being subject to the same sandboxing restrictions.