diff --git a/framework/src/org/apache/cordova/CordovaWebViewImpl.java b/framework/src/org/apache/cordova/CordovaWebViewImpl.java index d3f5ec9b..a7dd41a9 100644 --- a/framework/src/org/apache/cordova/CordovaWebViewImpl.java +++ b/framework/src/org/apache/cordova/CordovaWebViewImpl.java @@ -209,7 +209,7 @@ public class CordovaWebViewImpl implements CordovaWebView { @Override public void showWebPage(String url, boolean openExternal, boolean clearHistory, Map params) { - LOG.d(TAG, "showWebPage(%s, %b, %b, HashMap", url, openExternal, clearHistory); + LOG.d(TAG, "showWebPage(%s, %b, %b, HashMap)", url, openExternal, clearHistory); // If clearing history if (clearHistory) { @@ -223,10 +223,13 @@ public class CordovaWebViewImpl implements CordovaWebView { // TODO: What about params? // Load new URL loadUrlIntoView(url, true); - return; + } else { + LOG.w(TAG, "showWebPage: Refusing to load URL into webview since it is not in the whitelist. URL=" + url); } - // Load in default viewer if not - LOG.w(TAG, "showWebPage: Cannot load URL into webview since it is not in white list. Loading into browser instead. (URL=" + url + ")"); + } + if (!pluginManager.shouldOpenExternalUrl(url)) { + LOG.w(TAG, "showWebPage: Refusing to send intent for URL since it is not in the whitelist. URL=" + url); + return; } try { // Omitting the MIME type for file: URLs causes "No Activity found to handle Intent".