【问题标题】:react-native-webview: mixedContentMode not workingreact-native-webview:混合内容模式不起作用
【发布时间】:2021-03-24 00:35:48
【问题描述】:

我的应用程序中有一个 webview,当我使用安全 url (https) 时,它在 ios 和 android 中运行良好。

但是其中一个后端环境使用了不安全的 http 协议,它在 Android 上不起作用。我已经在 ma​​in/AndroidManifest.xml 上设置了android:usesCleartextTraffic="true" 并且该网站确实打开了,但它没有正确加载,因为它在其中混合了安全和不安全的请求。

我尝试添加道具 mixedContentMode={'always'},但它并没有影响我试图避免的行为。

我该如何解决?

【问题讨论】:

    标签: react-native react-native-android react-native-webview


    【解决方案1】:

    也尝试添加这些道具:

    javaScriptEnabled={true}
    domStorageEnabled={true}
    startInLoadingState={true}
    originWhitelist={['*']}
    

    【讨论】:

      猜你喜欢
      • 2017-04-30
      • 1970-01-01
      • 2021-08-31
      • 1970-01-01
      • 2015-11-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-09
      相关资源
      最近更新 更多