【发布时间】:2016-10-10 20:35:57
【问题描述】:
我正在使用 Braintree Drop-In 控制台,我最近刚刚遇到内容安全策略问题,主要是在 Safari 浏览器中返回以下错误并因此导致客户端脚本问题。单击 PayPal 按钮时会出现这些错误,这会产生一个弹出窗口,并且在关闭弹出窗口后再次将详细信息返回到页面。
[Error] Blocked a frame with origin "https://checkout.paypal.com" from accessing a frame with origin "https://assets.braintreegateway.com". Protocols, domains, and ports must match.
[Error] Blocked a frame with origin "https://www.paypal.com" from accessing a frame with origin "https://assets.braintreegateway.com". Protocols, domains, and ports must match.
有人建议我在设置方法中启用 enableCORS,但没有效果。还建议修改页面策略中的某些指令,但是我的页面中不包含 CSP,所以我认为这不会有任何影响。 即https://developers.braintreepayments.com/reference/client-reference/javascript/v2/best-practices#using-braintree.js-with-a-content-security-policy
我确实尝试添加了一些元标记,但是它导致的错误比以前更多,所以我删除了它们。
有没有人遇到过这个问题并且可以建议或提供一个示例来解决这个问题?我只有 Safari 有问题,因为它对此很敏感。
【问题讨论】:
标签: paypal safari braintree content-security-policy