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.
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.
This works!
if($('#ssIFrame_google').length) {
var google_sandbox = $('#ssIFrame_google').attr('sandbox')
google_sandbox += ' allow-modals'
$('#ssIFrame_google').attr('sandbox', google_sandbox)
}
Make sure to obviously execute this code after the iframe from Google has been pulled into the DOM. Change #ssIFrame_google to whatever id your Google iframe is.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With