diff options
author | Chris Rebert <code@rebertia.com> | 2015-01-03 10:18:39 +0300 |
---|---|---|
committer | Chris Rebert <code@rebertia.com> | 2015-01-03 10:18:39 +0300 |
commit | dfe20fad498f6adae0553a9a8b05bb01608bc6e2 (patch) | |
tree | f5a16c04de68124f0a8d2fda38ba8f8378ac1e79 /src | |
parent | dce6167ebcee6935f08abefefbaad70aea3b1ed3 (diff) |
try to support Opera Mini
Diffstat (limited to 'src')
-rw-r--r-- | src/browser/mq4-hover-hover-shim.js | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/browser/mq4-hover-hover-shim.js b/src/browser/mq4-hover-hover-shim.js index 5937e39..de2a022 100644 --- a/src/browser/mq4-hover-hover-shim.js +++ b/src/browser/mq4-hover-hover-shim.js @@ -10,15 +10,22 @@ */ export function supportsTrueHover() { if (!window.matchMedia) { - // Ancient non-IE, or IE<=9, per http://caniuse.com/#feat=matchmedia + // Opera Mini, IE<=9, or ancient; per http://caniuse.com/#feat=matchmedia var ua = navigator.userAgent; - var isIEmobile = ( + if (ua.indexOf("Opera Mini") > -1) { + // Opera Mini doesn't support true hovering + return false; + } + if ( ua.indexOf('IEMobile') > -1 || ua.indexOf('Windows Phone') > -1 || ua.indexOf('XBLWP7') > -1 || ua.indexOf('ZuneWP7') > -1 || // IE Mobile 9 in desktop view ua.indexOf('Windows CE') > -1 // out of an abundance of caution - ); + ) { + // IE Mobile <=9 + return false; + } // UA is ancient enough to probably be a desktop computer or at least not attempt emulation of hover. - return !isIEmobile; + return true; } // CSSWG Media Queries Level 4 draft |