【发布时间】:2013-03-10 00:30:23
【问题描述】:
我有兴趣在 Google Apps 脚本 html 模板上开发整个应用程序。我可以使用 Google Apps for Business 将域映射到应用脚本吗?
【问题讨论】:
我有兴趣在 Google Apps 脚本 html 模板上开发整个应用程序。我可以使用 Google Apps for Business 将域映射到应用脚本吗?
【问题讨论】:
这是一个非常逾期的回复,但是您可以这样做!
关键步骤是将 .setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL) 枚举添加到您的 HtmlServe 中,如下所示:
return HtmlService
.createTemplateFromFile('login')
.evaluate()
.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL);
然后,您可以简单地将您的 Apps 脚本 URL 嵌入到您喜欢的任何网页中。如果您在服务器上启用了 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
【讨论】:
我认为最好的解决方案是将您的 Apps 脚本托管在 Google 协作平台页面中(可以托管在 [subdomain].your-domain.com)。
Here's a little bit about GAS gadgets on Google Sites.
还有Google Sites on your own subdomain。点击“通过 Google Apps 建立网站”下拉菜单。
【讨论】: