我很難嘗試為條紋實作 3ds。自從我更新到cordova 10、[email protected] 和[email protected] 以來,我無法再為3ds 加載iframe。意圖設定正確,我在手機上收到 3ds 文本訊息,但看不到 iFrameContent。我嘗試更改 index.html 中的 Content-Security-Policy 和 config.xml 中的 allow-navigation。
這些是我的config.xml屬性:
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<allow-navigation href="about:*" />
<allow-navigation href="https://*/*" />
在這里我如何設定 CSP:
<meta
http-equiv="Content-Security-Policy"
content="
connect-src * 'self' 'unsafe-inline';
script-src * 'self' 'unsafe-inline';
frame-src https://*.stripe.com;"
>
這是我得到的錯誤:

根據條帶
但我仍然無法加載包含 3ds 的 iframe。

有什么線索嗎?謝謝!
uj5u.com熱心網友回復:
嘗試使用 ionic webkit "cordova-plugin-ionic-webview",添加
<preference name="ScrollEnabled" value="true" />
<preference name="Scheme" value="https" />
<preference name="MixedContentMode" value="2" />
到您的 config.xml(這是 ionic-webview 特定的),最后添加frame-ancestors 'self' https://*.stripe.com;到您的 csp 配置。
它對我有用
uj5u.com熱心網友回復:
我是為每個在同一問題上苦苦掙扎的人寫這篇文章的。我設法通過將條帶邏輯和卡片管理移到 Cordova 默認瀏覽器包裝器(即WKWebView)之外來解決這個問題。我已經達到了條帶支持,他們也認為這與WKWebView安全性有關。
只需安裝cordova-plugin-inappbrowser并使用InAppBrowser.addEventListener
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/358657.html
