该应用程序可以嵌入到 Google 站点中,但不能嵌入到任何其他标准网页中.控制台抛出错误...拒绝显示https://script.google.com/a/macros/netpremacy.com/s/AKfycbxITmxBMsHIh_u82tbvfICzNesEUJh2MRe7izyDE9cgvaLPCZI/exec' 因为它将'X-Frame-Options'设置为'SAMEORIGIN'.如果您需要更多信息,请告诉我. 解决方案 2017 年 3 月 24 日更新是的,但您需要在输出上设置一个额外的标志以允许它被 IFRAME://提供没有 X-Frame-Options 标头的 HTML(在 Apps 脚本服务器端代码中).var output = HtmlService.createHtmlOutput('<b>Hello, world!</b>');output.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL);Is is possible to embed a HTMLService app in an iframe?Embedded Example: http://jsbin.com/axesex/1/editThe app can be embedded within Google Site but not into any other standard web page. The console throw the error... Refused to display 'https://script.google.com/a/macros/netpremacy.com/s/AKfycbxITmxBMsHIh_u82tbvfICzNesEUJh2MRe7izyDE9cgvaLPCZI/exec' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.If you need any more information please let me know. 解决方案 Updated 3/24/2017Yes, but you need to set an extra flag on your output to allow it to be IFRAMEd:// Serve HTML with no X-Frame-Options header (in Apps Script server-side code).var output = HtmlService.createHtmlOutput('<b>Hello, world!</b>');output.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL); 这篇关于iFrame 中的 App Script HTMLService App的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-29 03:45