You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bo...@apache.org on 2012/06/21 23:05:05 UTC
[10/15] android commit: Fixing work-around to work for both ? and #
Fixing work-around to work for both ? and #
Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/d1905dbe
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/d1905dbe
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/d1905dbe
Branch: refs/heads/master
Commit: d1905dbee8edb720b25547a72e1f7f843036089d
Parents: adc88f0
Author: Joe Bowser <bo...@apache.org>
Authored: Wed Jun 20 14:16:02 2012 -0700
Committer: Joe Bowser <bo...@apache.org>
Committed: Wed Jun 20 14:16:02 2012 -0700
----------------------------------------------------------------------
.../org/apache/cordova/CordovaWebViewClient.java | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/d1905dbe/framework/src/org/apache/cordova/CordovaWebViewClient.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaWebViewClient.java b/framework/src/org/apache/cordova/CordovaWebViewClient.java
index 85261c3..4934c8f 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")){