【问题标题】:How to fix "Error while parsing the 'sandbox' attribute" flags error with HtmlService?如何使用 HtmlService 修复“解析“沙盒”属性时出错”标志错误?
【发布时间】:2016-02-05 12:58:43
【问题描述】:
我刚刚尝试了很多样例Google Apps Script scripts
但我总是得到错误:
“解析 'sandbox' 属性时出错:'allow-modals'、'allow-popups-to-escape-sandbox' 是无效的沙箱标志。”
我已经尝试在 Mac OS 上使用 Chrome 和 Safari,在 Win 8 上使用 Chrome。
【问题讨论】:
标签:
google-apps-script
iframe
web-applications
【解决方案2】:
这行得通!
if($('#ssIFrame_google').length) {
var google_sandbox = $('#ssIFrame_google').attr('sandbox')
google_sandbox += ' allow-modals'
$('#ssIFrame_google').attr('sandbox', google_sandbox)
}
确保在将来自 Google 的 iframe 拉入 DOM 后执行此代码。将 #ssIFrame_google 更改为您的 Google iframe 的任何 ID。