[Android WebView] can't load url
I'm trying to load this URL https://gitter.im/login in my web view component, but it doesn't loads.
It just displays this:

I've tried to load it in a default android browser and it had loaded successfully.
Some code:
<View style={{flex: 1}}>
<WebView
ref='webview'
style={{height: 400}}
url={'https://gitter.im/login/'}
javaScriptEnabled={true}
domStorageEnabled={true}
onNavigationStateChange={this.onNavigationStateChange}
/>
</View>
I'm on 0.18.0-rc.
Also tried other URLs, and it ~~works perfectly~~ works well only if there is no js. It seems like a bug with enabling javascript.
Also tried to use javaScriptEnabledAndroid, but nothing was change.
Hey terrysahaidak, thanks for reporting this issue!
React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.
- If you don't know how to do something or something is not working as you expect but not sure it's a bug, please ask on StackOverflow with the tag
react-nativeor for more real time interactions, ask on Discord in the #react-native channel. - If this is a feature request or a bug that you would like to be fixed, please report it on Product Pains. It has a ranking feature that lets us focus on the most important issues the community is experiencing.
- We welcome clear issues and PRs that are ready for in-depth discussion. Please provide screenshots where appropriate and always mention the version of React Native you're using. Thank you for your contributions!
Do other pages load? Can you open chrome://inspect and see if you can debug the issue?
@satya164 yup, it does. But I still cant load gitter.im site. It loads welcome screen, then I'm login through GitHub and redirecting back, but it doesn't loads. And when I'm trying to visit it again with my cookies, it won't load. I think it isn't the problem with Gitter because there is an app for android called Developer Talks where the user should login through webview.
I'll try to inspect it later and let you know.
And sorry for my English :)
@satya164 I've debugged the issue and I assume that it doesn't render the HTML.

I can also submit the form with this code:
var submit = document.getElementById('allow')
submit.click()
No console errors?
@tomauty no. BTW I'm running it in 5.1.1 on my sgs4 i9505.
It seems like a magic :smile:
Just tried it with 0.19.0-rc and got the same result. :worried:
Just got it working by deleting some css code. But still can't realize why it does not work like native webview?
I've disabled height: 100% html tag's rule (the best result i've got because of that). And got it:
+1 I'm running into the same issue with certain websites.
I figured it out. If you make the WebView as the parent instead of being nested in the View it loads the websites fine. Not exactly sure why.
@kevinejohn now it nested only inside some containers -- Navigator and Root
I've fixed that by injection this js code:
const jsForInjection = `
var el = document.getElementsByTagName('body')[0];
el.style.height = '${Dimensions.get('window').height}px';
`
@terrysahaidak that worked. Thanks!
This is happening to us too, a url that used to load correctly in RN WebView 0.18 is now a blank screen since RN 0.19
@maraujop could you inspect the web view with chrome://inspect?
@terrysahaidak Sure, I've inspected the webview, This url renders a widget that gets inflated through some javascript execution. It looks like the javascript never executed because the widget is not inflated, however the console shows no errors and it used to work before.
did you use webview's javaScriptEnabled property?
because in my issue HTML was rendered, but not displayed.
Thanks Terry for your help, but yes, javaScriptEnabled is set to true. I've just upgraded to 0.20-rc and it works again, so I guess it is fixed already.
@terrysahaidak i have the same issue , a blank html, looks like many page redirection cause it, and how can i inspect my rn-app in chrome ? i connect my phone by usb, and just could see LG-D858 #LGD858DB61B26E , no inspect button, but when i open mobile browser and open a page , the chrome inspect page show the inspect button ,but not belong to my app, how can i debugge the rn-webview? thanks a lot~
@oillamp connect you phone via USB, allow USB debugging and then got to this url chrome://inspect in chrome, then you'll see your device and page that currently opened in webview
hmm, it should display your rn-webview. try to use another webview (you can find it on react.parts or github)