cordova - 无法在 Cordova 上加载 Stripe 3ds iframe
问题描述
我很难尝试为条纹实现 3ds。自从我更新到 cordova 10、android@9.1 和 ios@6.2 后,我无法再为 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;"
>
这是我得到的错误:
根据条带文档,您需要将这些规则附加到您的 CSP
但我仍然无法加载包含 3ds 的 iframe。
有什么线索吗?谢谢!
解决方案
尝试使用 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 配置中。
它对我有用
推荐阅读
- reporting-services - SSRS - 使用计算值的 If 语句
- python - 为什么这个函数在两种情况下(网页抓取项目)都没有返回相同的输出?
- c - 获取DRAM或SRAM Galaxy S7的起始地址
- linux - 在 linux 中是否可以禁用特定文件的文件系统缓存?
- c# - MVVM 如何在 2 个视图之间共享一个属性
- ajax - 如何在不提交 btn 的情况下将 yii2 中的输入值发送到控制器
- kibana - kibana 创建索引,POST 不工作
- sql - 使用 SSIS 的重复任务
- python-2.7 - PySpark 动态 When 语句
- html - 使用 Node,我无法从应用程序文件中加载静态 HTML 页面