mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-21 10:05:34 +08:00
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
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user