From 26ee9b94d4841a349f2cc556ac57abddc44ab831 Mon Sep 17 00:00:00 2001 From: Adam Comella Date: Fri, 26 May 2017 16:52:48 -0700 Subject: [PATCH] Android: Allow WebView to handle about:blank Summary: On some devices, we saw many Chrome windows open when the WebView attempted to send the user to about:blank. This change allows the WebView to handle about:blank which prevents the Chrome windows from opening and gives the user a better experience. Verified that the WebView no longer opens the device's browser when navigating to about:blank. My team has been using this change in our app. Adam Comella Microsoft Corp. Closes https://github.com/facebook/react-native/pull/14173 Differential Revision: D5142352 Pulled By: hramos fbshipit-source-id: 1070d4381b385a5bf1829fd8e97efba2045f7968 --- .../com/facebook/react/views/webview/ReactWebViewManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java index 7e246a7ff..a22824294 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java @@ -137,7 +137,7 @@ public class ReactWebViewManager extends SimpleViewManager { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { if (url.startsWith("http://") || url.startsWith("https://") || - url.startsWith("file://")) { + url.startsWith("file://") || url.equals("about:blank")) { return false; } else { try {