簡體   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