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
This commit is contained in:
parent
242d29d374
commit
26ee9b94d4
|
@ -137,7 +137,7 @@ public class ReactWebViewManager extends SimpleViewManager<WebView> {
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||||
if (url.startsWith("http://") || url.startsWith("https://") ||
|
if (url.startsWith("http://") || url.startsWith("https://") ||
|
||||||
url.startsWith("file://")) {
|
url.startsWith("file://") || url.equals("about:blank")) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue