From f9d27e4a67a7abe42a1828005c2647233ea3584c Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Tue, 12 Feb 2013 11:16:01 -0800 Subject: [PATCH] CB-2408: There should be a check for the browser history, but the logic intentionally doesn't match --- framework/src/org/apache/cordova/CordovaWebView.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/framework/src/org/apache/cordova/CordovaWebView.java b/framework/src/org/apache/cordova/CordovaWebView.java index 44c9299a..8f128224 100755 --- a/framework/src/org/apache/cordova/CordovaWebView.java +++ b/framework/src/org/apache/cordova/CordovaWebView.java @@ -554,15 +554,14 @@ public class CordovaWebView extends WebView { // Check webview first to see if there is a history // This is needed to support curPage#diffLink, since they are added to appView's history, but not our history url array (JQMobile behavior) - if (super.canGoBack()) { + if (super.canGoBack() && this.useBrowserHistory) { printBackForwardList(); super.goBack(); return true; } - // If our managed history has prev url - if (this.urls.size() > 1 && !this.useBrowserHistory) { + else if (this.urls.size() > 1 && !this.useBrowserHistory) { this.urls.pop(); // Pop current url String url = this.urls.pop(); // Pop prev url that we want to load, since it will be added back by loadUrl() this.loadUrl(url); @@ -578,10 +577,10 @@ public class CordovaWebView extends WebView { * @return */ public boolean canGoBack() { - if (super.canGoBack()) { + if (super.canGoBack() && this.useBrowserHistory) { return true; } - if (this.urls.size() > 1) { + else if (this.urls.size() > 1) { return true; } return false;