【发布时间】:2015-03-19 07:27:55
【问题描述】:
在 Google Apps 脚本中:使用 NATIVE 沙盒模式:
Linking to another HTML page in Google Apps Script 工作正常。
但是当使用IFRAME沙盒模式时:
Unable to get links working in Google Apps Script when using sandbox mode of "IFRAME"
根据上面的 SO 帖子,我尝试使用 target="_blank"。正如预期的那样,当点击链接时,页面会在新窗口中打开。
然而——
在 Chrome 中使用 target="_parent" 每次都会打开一个新窗口,但 Firefox 无法正常工作。根据https://developers.google.com/apps-script/guides/html/restrictions,HTML Service 不支持target="_parent"——这可能就是它表现得像target="_blank" 的原因。
在 Chrome 和 Firefox 中使用 target="_self" 会导致第一次点击会在同一个窗口中打开,但随后的点击会显示一个空白页面。
我希望页面与我的 Apps 脚本在同一个窗口中加载,就像在不受限制的网页上的锚点中使用 target="_self" 时那样。
请帮助我。
【问题讨论】: