Browse files

android: stop logging console logs from webview

Summary: We're logging all console logs from webview. This strips console logging for non debug builds

Reviewed By: AaaChiuuu

Differential Revision: D4578071

fbshipit-source-id: 79b21012a6ef215eb35701911662a720cb6be280
  • Loading branch information...
fkgozali authored and facebook-github-bot committed Feb 18, 2017
1 parent 1fa95ed commit cb68b97289ad8fa98e7195a4dadd44135f044e17
@@ -24,6 +24,7 @@
import android.os.Build;
import android.text.TextUtils;
import android.view.ViewGroup.LayoutParams;
import android.webkit.ConsoleMessage;
import android.webkit.GeolocationPermissions;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
@@ -331,6 +332,15 @@ public String getName() {
protected WebView createViewInstance(ThemedReactContext reactContext) {
ReactWebView webView = new ReactWebView(reactContext);
webView.setWebChromeClient(new WebChromeClient() {
public boolean onConsoleMessage(ConsoleMessage message) {
if (ReactBuildConfig.DEBUG) {
return super.onConsoleMessage(message);
// Ignore console logs in non debug builds.
return true;
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
callback.invoke(origin, true, false);

0 comments on commit cb68b97

Please sign in to comment.