React Native Webview get html

I want to get html in web view. I read react-native-doc(https://facebook.github.io/react-native/docs/webview.html#content) but I cannot found it.

Can I do this?

I found this. https://github.com/alinz/react-native-webview-bridge

But I could not use this in android. This works only in android. I don't know this problem is only my problem or library problem.

In Android I use onNavigationStateChange. Read https://github.com/facebook/react-native/issues/586#issuecomment-90826117 I think this is not good way. But I really need this. so I used this.

In case anyone comes across this in the future. You options here is to use javascript. You can use injectedJavaScript on the webview to inject a window.postmessge($('body').html()) and then handle the reply in the onMessage function on the webview. The cleaner way would be to fetch the page yourself and then load it into the webview.

Comments

Popular posts from this blog

Meaning of `{}` for return expression

Get current scroll position of ScrollView in React Native

React Native - Image Cache