在iFrame中应用脚本HTMLService应用程序 [英] App Script HTMLService App in iFrame
问题描述
是否可以在iframe中嵌入HTMLService应用程序?
Is is possible to embed a HTMLService app in an iframe?
嵌入式示例: http://jsbin.com/axesex/1/edit
该应用可嵌入Google网站,但不能嵌入进入任何其他标准网页。控制台抛出错误...
The app can be embedded within Google Site but not into any other standard web page. The console throw the error...
拒绝显示' https://script.google.com/a/macros/netpremacy.com/s/AKfycbxITmxBMsHIh_u82tbvfICzNesEUJh2MRe7izyDE9cgvaLPCZI/exec 因为它将'X-Frame-Options'设置为'SAMEORIGIN'。
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'.
如果您需要更多信息,请告诉我们。 / b>
If you need any more information please let me know.
推荐答案
Updated 3/24/2017
是的,但是你需要在你的输出中设置一个额外的标志来允许它成为IFRAMEd:
Yes, 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中应用脚本HTMLService应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!