From de3f25808a6020cbee2f511db00edf7ca51e283a Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Thu, 26 Nov 2015 17:05:58 +0100 Subject: [PATCH] Update jquery browser plugin to 0.1.0 --- public/js/jquery.browser.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/public/js/jquery.browser.js b/public/js/jquery.browser.js index 038ec52..223eca6 100644 --- a/public/js/jquery.browser.js +++ b/public/js/jquery.browser.js @@ -1,5 +1,5 @@ /*! - * jQuery Browser Plugin 0.0.8 + * jQuery Browser Plugin 0.1.0 * https://github.com/gabceb/jquery-browser-plugin * * Original jquery-browser code Copyright 2005, 2015 jQuery Foundation, Inc. and other contributors @@ -40,6 +40,7 @@ var match = /(edge)\/([\w.]+)/.exec( ua ) || /(opr)[\/]([\w.]+)/.exec( ua ) || /(chrome)[ \/]([\w.]+)/.exec( ua ) || + /(iemobile)[\/]([\w.]+)/.exec( ua ) || /(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec( ua ) || /(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec( ua ) || /(webkit)[ \/]([\w.]+)/.exec( ua ) || @@ -51,11 +52,11 @@ var platform_match = /(ipad)/.exec( ua ) || /(ipod)/.exec( ua ) || + /(windows phone)/.exec( ua ) || /(iphone)/.exec( ua ) || /(kindle)/.exec( ua ) || /(silk)/.exec( ua ) || /(android)/.exec( ua ) || - /(windows phone)/.exec( ua ) || /(win)/.exec( ua ) || /(mac)/.exec( ua ) || /(linux)/.exec( ua ) || @@ -100,14 +101,22 @@ } // IE11 has a new token so we will assign it msie to avoid breaking changes - // IE12 disguises itself as Chrome, but adds a new Edge token. - if ( browser.rv || browser.edge ) { + if ( browser.rv || browser.iemobile) { var ie = "msie"; matched.browser = ie; browser[ie] = true; } + // Edge is officially known as Microsoft Edge, so rewrite the key to match + if ( browser.edge ) { + delete browser.edge; + var msedge = "msedge"; + + matched.browser = msedge; + browser[msedge] = true; + } + // Blackberry browsers are marked as Safari on BlackBerry if ( browser.safari && browser.blackberry ) { var blackberry = "blackberry";