gpt4 book ai didi

javascript - Google 网站上的 Apps Script Gadget 开始抛出 CORS 错误

转载 作者:数据小太阳 更新时间:2023-10-29 04:21:32 26 4
gpt4 key购买 nike

我有一个包含多个页面的 Google 站点,所有页面都包含一个 Google Apps 脚本小工具。用户报告说,几个月前,Apps Script Gadgets 停止工作。我已经对它们进行了测试,发现 Apps Script 小工具可以正确加载并显示来自 UI 服务的内容,但是,当单击任何运行函数的按钮时,Apps Script Gadget 会挂起并且浏览器中的控制台错误显示:

Uncaught SecurityError: Failed to read the 'frame' property from 'Window': Blocked a frame                      
with origin "https://sites.google.com" from accessing a frame with origin
"https://xxxxxxxxxxxxxxxx-a-sites-opensocial.googleusercontent.com".
Protocols, domains, and ports must match.

Google 是否更改了某种安全策略以防止跨源请求对 Apps Script 脚本发出?有什么解决方法吗?

谢谢

斯图

最佳答案

对于这个问题,我能找到的唯一解决方案是将小工具替换为在新页面中打开 Apps 脚本 URL 的链接。

关于javascript - Google 网站上的 Apps Script Gadget 开始抛出 CORS 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22400332/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com