我正在尝试启动并运行 Google 钱包,并且正在关注 "get started" tutorial .当我调用 javascript 库时
<script src="https://sandbox.google.com/checkout/inapp/lib/buy.js"></script>
我的控制台出现以下错误:
Blocked a frame with origin "https://sandbox.google.com" from accessing a frame with origin "http://localhost:12098". The frame requesting access has a protocol of "https", the frame being accessed has a protocol of "http". Protocols must match.
inject.js:211
(anonymous function) inject.js:211
我尝试过使用
<script src="https://sandbox.google.com/checkout/inapp/lib/buy.js"></script>
但是我得到了同样的错误。我什至将我的应用程序放在 https 地址上,但仍然出现错误。是否有我缺少的技巧来加载它?
最佳答案
我很确定您可以使用 http 而不是 https 来解决这个问题。
还要确保清空缓存。在 chrome 中按 ctrl+⇧+⌫ 或 ⌘+⇧+⌫
关于javascript - 谷歌钱包错误 : The frame requesting access has a protocol of "https", 正在访问的框架具有 "http"的协议(protocol),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17157243/