react-native-webview: onOpenWindow event not working as expected
I tested with the latest release but could not open the window inside webview (using android). Can you suggest what I am doing wrong here?
return <WebView
source={{
uri: `some_randome_url`
}}
javaScriptCanOpenWindowsAutomatically={true}
originWhitelist={['*']}
onOpenWindow={(syntheticEvent) => {
const { nativeEvent } = syntheticEvent;
const { targetUrl } = nativeEvent
console.log('Intercepted OpenWindow for', targetUrl)
}}
/>;
The URL "some_randome_url" have below line in the html
`<a href="https://www.google.com" target="_blank">testing link</a>`
Clicking on above link, opens it on external browser and not inside the webview window.
//version “react-native-webview”: “13.3.0” “react”: “18.2.0”, “react-native”: “0.71.3”,
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 29 (1 by maintainers)
You cannot. But you can have two WebViews in your mobile app.