Permalink
Browse files

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 #14173

Differential Revision: D5142352

Pulled By: hramos

fbshipit-source-id: 1070d4381b385a5bf1829fd8e97efba2045f7968
  • Loading branch information...
rigdern authored and facebook-github-bot committed May 26, 2017
1 parent 242d29d commit 26ee9b94d4841a349f2cc556ac57abddc44ab831
@@ -137,7 +137,7 @@ public void onPageStarted(WebView webView, String url, Bitmap favicon) {
@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 {

0 comments on commit 26ee9b9

Please sign in to comment.