[英]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.