繁体   English   中英

关于Chrome的同源政策的困惑:如何摆脱它而不要求用户禁用Chrome中的安全性?

[英]Confusion about Chrome's same origin policy: how to get rid of it without asking the user disable security in Chrome?

我很困惑:我正在开发一个Web应用程序(HTML / CSS / JS),它可以加载google + platform api脚本来创建单个登录。 它适用于Firefox,但不适用于Chrome,因为“相同的原始政策”,我得到了“阻止原始框架......”错误。

我不希望用户使用像“--disable-web-security”这样的选项启动他们的Chrome ... ,是吗? ;-)

所以我很困惑:如何让它与Chrome一起使用?

例如:如果我尝试加载:

<script type="text/javascript">
        (function() {
            var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
            po.src = 'https://apis.google.com/js/client:plusone.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
        })();
    </script>

我明白了:

Blocked a frame with origin "https://apis.google.com" from accessing a frame with origin "https://boardlineapp.com". Protocols, domains, and ports must match. 

检查您的域协议是否为https:

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM