diff options
| author | Vojta Jina | 2012-05-14 14:14:52 -0700 |
|---|---|---|
| committer | Vojta Jina | 2012-05-14 15:12:51 -0700 |
| commit | 7b739c97028be2a5d5aef679ef1f8064cd10d386 (patch) | |
| tree | d549dc84026352e50f54df0d4ca22906540fb616 /src/ng/sniffer.js | |
| parent | c1533ef5762199bea18d3bf3bcba7fcf89272931 (diff) | |
| download | angular.js-7b739c97028be2a5d5aef679ef1f8064cd10d386.tar.bz2 | |
fix($sniffer): report history false on Android < 4
Android has history.pushState, but it does not update the location correctly:
http://code.google.com/p/android/issues/detail?id=17471
Closes #904
Diffstat (limited to 'src/ng/sniffer.js')
| -rw-r--r-- | src/ng/sniffer.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ng/sniffer.js b/src/ng/sniffer.js index b19e7ccf..0b116e27 100644 --- a/src/ng/sniffer.js +++ b/src/ng/sniffer.js @@ -14,10 +14,15 @@ */ function $SnifferProvider() { this.$get = ['$window', function($window) { - var eventSupport = {}; + var eventSupport = {}, + android = int((/android (\d+)/.exec(lowercase($window.navigator.userAgent)) || [])[1]); return { - history: !!($window.history && $window.history.pushState), + // Android has history.pushState, but it does not update location correctly + // so let's not use the history API at all. + // http://code.google.com/p/android/issues/detail?id=17471 + // https://github.com/angular/angular.js/issues/904 + history: !!($window.history && $window.history.pushState && !(android < 4)), hashchange: 'onhashchange' in $window && // IE8 compatible mode lies (!$window.document.documentMode || $window.document.documentMode > 7), |
