google-apps-script - 如何修复 HtmlService 的 "Error while parsing the ' 沙箱“属性”标志错误?

标签 google-apps-script iframe web-applications

我刚刚尝试了很多样本​​Google Apps Script scripts
但我总是收到错误:

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


我曾尝试在 Mac OS 上使用 Chrome 和 Safari,在 Win 8 上使用 Chrome。

最佳答案

可以安全地忽略此错误,脚本将继续正常运行。这是两个已在 Chrome 46(当前稳定版本)中实现的新标志。如果您在不支持它们的浏览器中进行测试,您将看到该错误(这实际上只是一个警告)。
allow-modals标志是必需的,因为默认情况下,Chrome 将 block modal dialogs within a sandboxed iframe .添加此标志允许模态在您的应用程序脚本中工作。
allow-popups-to-escape-sandbox flag 有点相似;其目的是permit new windows to be created without them being subject to the same sandboxing restrictions .

关于google-apps-script - 如何修复 HtmlService 的 "Error while parsing the ' 沙箱“属性”标志错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33531905/

相关文章:

asp.net - 解析器错误 : Could not load type after changing output dir in asp. 网络应用程序

mysql - 缺少外键列

google-apps-script - 根据值更改编辑单元格背景颜色

url - 需要在 ie8 的新选项卡中打开链接!

javascript - iframe.contentDocument 不适用于 IE8

javascript - 禁用 iOS Overscroll 但允许正文滚动

Java EE 应用程序目录最佳实践问题

google-apps-script - 异常 : No item with the given ID could be found. 可能是因为您尚未编辑此项目或您无权访问它

javascript - 比较 2 个不同电子表格中的 2 个数组,并将其补码写入第二个电子表格

javascript - 从主文档中的 JavaScript 获取 IFrame 的文档