diff --git a/src/ng/sniffer.js b/src/ng/sniffer.js index 585519b34847..c8648fecd67d 100644 --- a/src/ng/sniffer.js +++ b/src/ng/sniffer.js @@ -19,6 +19,7 @@ function $SnifferProvider() { this.$get = ['$window', '$document', function($window, $document) { var eventSupport = {}, android = int((/android (\d+)/.exec(lowercase(($window.navigator || {}).userAgent)) || [])[1]), + boxee = $window.navigator.userAgent.indexOf('Boxee') != -1, document = $document[0] || {}, vendorPrefix, vendorRegex = /^(Moz|webkit|O|ms)(?=[A-Z])/, @@ -55,7 +56,10 @@ function $SnifferProvider() { // 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)), + + // older webit browser (533.9) on Boxee box has exactly the same problem as Android has + // so let's not use the history API also + history: !!($window.history && $window.history.pushState && !(android < 4) && !boxee), hashchange: 'onhashchange' in $window && // IE8 compatible mode lies (!document.documentMode || document.documentMode > 7), diff --git a/test/ng/snifferSpec.js b/test/ng/snifferSpec.js index 2206a271839a..eea6fb5c2791 100644 --- a/test/ng/snifferSpec.js +++ b/test/ng/snifferSpec.js @@ -316,4 +316,27 @@ describe('$sniffer', function() { }); }); + + describe('history', function() { + it('should be true on Boxee box with an older version of Webkit', function() { + module(function($provide) { + var doc = { + body : { + style : {} + } + }; + var win = { + navigator: { + userAgent: 'Boxee' + } + }; + $provide.value('$document', jqLite(doc)); + $provide.value('$window', win); + }); + inject(function($sniffer) { + expect($sniffer.history).toBe(false); + }); + }); + + }); });