我已经完成了一组功能,并且正在使用html模板开发UI(见下文)
https://developers.google.com/apps-script/guides/html/templates
我相信我应该部署为一个网络应用程序,以使其可以在线访问所有用户。但是,如何为我部署的Web应用程序分配Web域名?
答案 0 :(得分:2)
是的,你可以这样做!
关键步骤是将.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL)枚举添加到您的HtmlServe中,如下所示:
return HtmlService
.createTemplateFromFile('login')
.evaluate()
.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL);
然后,您只需获取您的Apps脚本网址并将其嵌入您喜欢的任何网页即可。如果您在服务器上启用了SSL,它甚至支持SSL。
<iframe src="https://script.google.com/macros/s/xxxxxxxxxxxxxxxxxxxxxx/exec"></iframe>
来源: https://developers.google.com/apps-script/reference/html/x-frame-options-mode