【问题标题】:Is there a way to map Google app script html template to a custom domain name?有没有办法将 Google 应用脚本 html 模板映射到自定义域名?
【发布时间】:2013-03-10 00:30:23
【问题描述】:

我有兴趣在 Google Apps 脚本 html 模板上开发整个应用程序。我可以使用 Google Apps for Business 将域映射到应用脚本吗?

【问题讨论】:

    标签: google-apps-script


    【解决方案1】:

    这是一个非常逾期的回复,但是您可以这样做!

    关键步骤是将 .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

    【讨论】:

      【解决方案2】:

      我认为最好的解决方案是将您的 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 建立网站”下拉菜单。

      【讨论】:

        猜你喜欢
        • 2019-04-28
        • 2014-03-13
        • 2021-09-30
        • 2021-07-26
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-01-19
        • 2021-03-18
        相关资源
        最近更新 更多