How To Enable Disable JavaScript Code in WebView React Native

JavaScript and jQuery is the base of almost every web application(Websites) present on internet because of its flexible environment. But infrequently hacker or bad peoples needs to inject some bad code in user’s device using JavaScript, So here this features helps the android and iOS application user to stop executing JavaScript and jQuery on their webpage loaded inside WebView in device. So in this tutorial we would going to make a react native app with Enable Disable JavaScript Code functionality and Stop executing JavaScript + jQuery code on their WebView using WebView’s javaScriptEnabled={Boolean Value} prop in Android iOS application.

Contents in this project Enable Disable JavaScript Code in WebView React Native Example :

1. Import StyleSheet, Platform and WebView component in your project.

2. Create WebView component inside render’s return block with javaScriptEnabled={Boolean Value} Prop.

  • If we set javaScriptEnabled={true} then it will Enable the JavaScript on WebView.
  • If we set javaScriptEnabled={false} then it will Disable the JavaScript on WebView.

3. Create Custom Style :

4. Complete source code for App.js File :

Screenshot in iOS device :

Enable Disable JavaScript Code

Screenshot in Android App:


  1. how to make full screen in this embedded code ?

Leave a Reply

Your email address will not be published. Required fields are marked *