针对iframe的Google Web App出错

时间:2015-01-08 03:25:03

标签: iframe google-apps-script

尝试同时使用框架和iframe。

在本地主机上:frameset.html:

<iframe src=a.html name="a" width="200" height="200" align="right"></iframe>
<iframe src=b.html name="b" width="200" height="200" align="left"></iframe>

b.html有一个链接可以打开Goog​​le Web App, https://script.google.com/macros/s/a-web-app-id/dev,在弹出窗口中(我使用iframe,但是应用程序脚本网络应用程序只能在自己的选项卡/窗口中运行)。

在IFRAME模式下作为htmlservice运行的Web应用程序具有以下链接:

<a target='a' 
href="https://script.google.com/d/some-script-id/edit?usp=drive_web">
where does this same origin link open?</a>

而不是在frameset.html的框架a中打开链接,而是每次单击它时都会在新选项卡中打开(因此N点击,N个标签打开)。当我设置b.html以使用上面相同的链接打开本地弹出窗口(c.html)时,它可以正常工作。

控制台登录应用程序脚本弹出窗口:

https://script.google.com/macros/s/a-web-app-id/dev 
Failed to load resource: net::ERR_CACHE_MISS

https://some_string-script.googleusercontent.com/userCodeAppPanel
Failed to load resource: net::ERR_CACHE_MISS

1 个答案:

答案 0 :(得分:0)

当在IFRAME沙盒模式下运行时,GAS会抱怨,因为所有GAS webapps都在https下运行。它有机会在同一个窗口范围内调用不安全的http作用域。

如果您看到以下内容,请检查控制台:

  

混合内容:页面位于   https://www.example.com/secure/checkout.aspx已通过HTTPS加载,   但要求一个不安全的样式表   http://www.example.com/CSS/all.min.css?v=2。这个要求已经   堵塞;内容必须通过HTTPS提供。