From ccceaeaca2d72fb9708100ab2f70adb903a27d66 Mon Sep 17 00:00:00 2001 From: shingotoda Date: Fri, 16 Jan 2015 17:40:54 +1100 Subject: [PATCH] CB-8317 Make it work to load about:blank and to dispatch exit message (close #149) --- framework/src/org/apache/cordova/CordovaWebView.java | 2 +- framework/src/org/apache/cordova/CordovaWebViewClient.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/src/org/apache/cordova/CordovaWebView.java b/framework/src/org/apache/cordova/CordovaWebView.java index 3825be96..491edf72 100755 --- a/framework/src/org/apache/cordova/CordovaWebView.java +++ b/framework/src/org/apache/cordova/CordovaWebView.java @@ -454,7 +454,7 @@ public class CordovaWebView extends WebView { if (LOG.isLoggable(LOG.DEBUG) && !url.startsWith("javascript:")) { LOG.d(TAG, ">>> loadUrlNow()"); } - if (url.startsWith("file://") || url.startsWith("javascript:") || internalWhitelist.isUrlWhiteListed(url)) { + if (url.startsWith("file://") || url.startsWith("javascript:") || url.startsWith("about:") || internalWhitelist.isUrlWhiteListed(url)) { super.loadUrl(url); } } diff --git a/framework/src/org/apache/cordova/CordovaWebViewClient.java b/framework/src/org/apache/cordova/CordovaWebViewClient.java index 218cd81e..6b3b4608 100755 --- a/framework/src/org/apache/cordova/CordovaWebViewClient.java +++ b/framework/src/org/apache/cordova/CordovaWebViewClient.java @@ -193,8 +193,8 @@ public class CordovaWebViewClient extends WebViewClient { @Override public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); - // Ignore excessive calls. - if (!isCurrentlyLoading) { + // Ignore excessive calls, if url is not about:blank (CB-8317). + if (!isCurrentlyLoading && !url.startsWith("about:")) { return; } isCurrentlyLoading = false;