From d1905dbee8edb720b25547a72e1f7f843036089d Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Wed, 20 Jun 2012 14:16:02 -0700 Subject: [PATCH] Fixing work-around to work for both ? and # --- framework/src/org/apache/cordova/CordovaWebViewClient.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/framework/src/org/apache/cordova/CordovaWebViewClient.java b/framework/src/org/apache/cordova/CordovaWebViewClient.java index 85261c3e..4934c8f3 100755 --- a/framework/src/org/apache/cordova/CordovaWebViewClient.java +++ b/framework/src/org/apache/cordova/CordovaWebViewClient.java @@ -461,7 +461,7 @@ public class CordovaWebViewClient extends WebViewClient { @Override public WebResourceResponse shouldInterceptRequest(WebView view, String url) { - if(url.contains("?")){ + if(url.contains("?") || url.contains("#")){ return generateWebResourceResponse(url); } else { return super.shouldInterceptRequest(view, url); @@ -476,6 +476,10 @@ public class CordovaWebViewClient extends WebViewClient { if(niceUrl.contains("?")){ niceUrl = niceUrl.split("\\?")[0]; } + else if(niceUrl.contains("#")) + { + niceUrl = niceUrl.split("#")[0]; + } String mimetype = null; if(niceUrl.endsWith(".html")){