gpt4 book ai didi

javascript - 气体 : Unable to use HtmlService custom dialogs in Firefox

转载 作者:行者123 更新时间:2023-12-03 11:04:46 24 4
gpt4 key购买 nike

我正在尝试在 Google Apps 脚本中创建自定义对话,如下所示:

function onOpen() {   
SpreadsheetApp.getUi()
.createMenu('Custom Menu')
.addItem('Show dialog', 'showDialog')
.addToUi();
}
function showDialog() {
var html = HtmlService.createHtmlOutputFromFile('Page')
.setSandboxMode(HtmlService.SandboxMode.IFRAME)
.setWidth(400)
.setHeight(300);
SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
.showModalDialog(html, 'My custom dialog');
}

其中 Page.html 是:

Hello, world! <input type="button" value="Close" onclick="google.script.host.close()" />

在 Chrome 中,它按预期工作。在 Firefox 34 中,会显示对话框,但是当我单击关闭按钮时,它不会触发回调 google.script.host.close()

Firebug 报告错误:

ReferenceError: google is not defined  userCodeAppPanel (line 1)

最佳答案

这是 FF/IE 的一个已知错误,请使用 Native Sandbox 直到修复并按照 https://code.google.com/p/google-apps-script-issues/issues/detail?id=4617 中的问题进行操作。 .

关于javascript - 气体 : Unable to use HtmlService custom dialogs in Firefox,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27912715/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com