alinz / react-native-webview-bridge

React Native Webview with Javascript Bridge
MIT License
1.37k stars 493 forks source link

Links open in Chrome on Android instead of WebView, on RN 0.56 #265

Open fungilation opened 6 years ago

fungilation commented 6 years ago

Took me a long while to figure this out, here's the workaround:

<WebViewBridge
...
  originWhitelist={["http://.*", "https://.*"]}
/>

Without this, on RN 0.56 on Android, links would default open by Android in Chrome instead of the app's WebView. originWhitelist is new to RN 0.56, and react-native-webview-bridge lacks the default supplied in JS to the Native WebView. So originWhitelist needs to be supplied in userland, or it can be added in react-native-webview-bridge similar to this PR in RN: https://github.com/facebook/react-native/commit/23f8f7aecb1f21f4f5e44fb9e4a7456ea97935c9

simonso-nzme commented 5 years ago

Thanks for that! You've saved me lots of time 👍

ghost commented 5 years ago

我加了怎么没作用

dakiesse commented 5 years ago

Thank you! You saved my time as well!