question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Webview is not executing my JavaScript from the web page on Android?

See original GitHub issue

Description

When I open WebView on Android emulator or real device it does not execute JavaScript. I have run simple Android App in Android Studio and it worked there.

Reproduction Steps

Just create a new app and add this WebView to it

Sample Code

<WebView
                style={[styles.flex]} //styles
                javaScriptEnabled={true} //enabling JavaScript
                source={{uri: 'http://partners.zeew.eu/'}} //Url
            />

Solution

Can you please check it and say what is wrong?

Additional Information

  • React Native version: 0.45.1
  • Platform: Android ( not sure about iOS )
  • Development Operating System: Windows
  • Build tools: Android Studio: Nexus 5x edited_api_25 Android 6.0 Google APIs, Nexus 5 API level 26, Android 8.0.0

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:7
  • Comments:48 (5 by maintainers)

github_iconTop GitHub Comments

53reactions
andrisole92commented, Jul 4, 2017

The community does not seem to be really strong and supportive.

8reactions
nikilarigelacommented, Oct 13, 2018

@jayporta have u tried with baseUrl=" " baseUrl with empty string.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaScript not working in Android Webview? - Stack Overflow
But I'm stuck at a pretty early point of development: The webview doesn't function with javascript.
Read more >
Android Question Javascript not loading/running in WebView
I have a web page that loads a Javascript .js library. It works correctly with browsers on Windows (Firefox) or Android (Chrome). It's...
Read more >
JavaScript not working in Android Webview? - YouTube
JavaScript : JavaScript not working in Android Webview ? [ Gift : Animated Search Engine : https://bit.ly/AnimSearch ] JavaScript ...
Read more >
Inject JS into Android's WebView - Medium
WebView gives developers an easy way to embed a web-based application to an Android app with almost no code. Just give it some...
Read more >
Communication with WebView Using JavaScript in Android
If you want to execute HTML, CSS or JavaScript code in your Android app, or you need to allow users visit a URL...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found