diff options
| author | Dusan Bartos | 2013-08-21 14:54:54 +0200 | 
|---|---|---|
| committer | Jeff Cross | 2013-08-23 11:57:55 -0700 | 
| commit | eefcdad013b56d5d3a05c0b2137a5860091b2575 (patch) | |
| tree | c62d49512d1367873fc5a9a159b0df2e68f53a80 /src | |
| parent | 74ae3edf8614ea8a97580033db0fd145d5260b62 (diff) | |
| download | angular.js-eefcdad013b56d5d3a05c0b2137a5860091b2575.tar.bz2 | |
fix($sniffer): history problems on Boxee box
History API not working properly on Boxee box browser (old Webkit)
problem similar to the one on Android < 4
Diffstat (limited to 'src')
| -rw-r--r-- | src/ng/sniffer.js | 12 | 
1 files changed, 8 insertions, 4 deletions
diff --git a/src/ng/sniffer.js b/src/ng/sniffer.js index 585519b3..7f26e312 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 = /Boxee/i.test(($window.navigator || {}).userAgent),          document = $document[0] || {},          vendorPrefix,          vendorRegex = /^(Moz|webkit|O|ms)(?=[A-Z])/, @@ -42,10 +43,10 @@ function $SnifferProvider() {        transitions = !!(('transition' in bodyStyle) || (vendorPrefix + 'Transition' in bodyStyle));        animations  = !!(('animation' in bodyStyle) || (vendorPrefix + 'Animation' in bodyStyle)); -       +        if (android && (!transitions||!animations)) { -        transitions = isString(document.body.style.webkitTransition);  -        animations = isString(document.body.style.webkitAnimation);  +        transitions = isString(document.body.style.webkitTransition); +        animations = isString(document.body.style.webkitAnimation);        }      } @@ -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),  | 
