vendor: 4,800 bytes, lines 1-170
1/*! 2 * jQuery Browser Plugin 0.0.7 3 * https://github.com/gabceb/jquery-browser-plugin 4 * 5 * Original jquery-browser code Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors 6 * http://jquery.org/license 7 * 8 * Modifications Copyright 2014 Gabriel Cebrian 9 * https://github.com/gabceb 10 * 11 * Released under the MIT license 12 * 13 * Date: 12-12-2014 14 */ 15 16(function (root, factory) { 17 if (typeof define === 'function' && define.amd) { 18 // AMD. Register as an anonymous module. 19 define(['jquery'], function ($) { 20 factory($, root); 21 }); 22 } else { 23 // Browser globals 24 factory(jQuery, root); 25 } 26}(this, function(jQuery, window) { 27 "use strict"; 28 29 var matched, browser; 30 31 jQuery.uaMatch = function( ua ) { 32 ua = ua.toLowerCase(); 33 34 var match = /(edge)\/([\w.]+)/.exec( ua ) || 35 /(opr)[\/]([\w.]+)/.exec( ua ) || 36 /(chrome)[ \/]([\w.]+)/.exec( ua ) || 37 /(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec( ua ) || 38 /(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec( ua ) || 39 /(webkit)[ \/]([\w.]+)/.exec( ua ) || 40 /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) || 41 /(msie) ([\w.]+)/.exec( ua ) || 42 ua.indexOf("trident") >= 0 && /(rv)(?::| )([\w.]+)/.exec( ua ) || 43 ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) || 44 []; 45 46 var platform_match = /(ipad)/.exec( ua ) || 47 /(ipod)/.exec( ua ) || 48 /(iphone)/.exec( ua ) || 49 /(kindle)/.exec( ua ) || 50 /(silk)/.exec( ua ) || 51 /(android)/.exec( ua ) || 52 /(windows phone)/.exec( ua ) || 53 /(win)/.exec( ua ) || 54 /(mac)/.exec( ua ) || 55 /(linux)/.exec( ua ) || 56 /(cros)/.exec( ua ) || 57 /(playbook)/.exec( ua ) || 58 /(bb)/.exec( ua ) || 59 /(blackberry)/.exec( ua ) || 60 []; 61 62 return { 63 browser: match[ 5 ] || match[ 3 ] || match[ 1 ] || "", 64 version: match[ 2 ] || match[ 4 ] || "0", 65 versionNumber: match[ 4 ] || match[ 2 ] || "0", 66 platform: platform_match[ 0 ] || "" 67 }; 68 }; 69 70 matched = jQuery.uaMatch( window.navigator.userAgent ); 71 browser = {}; 72 73 if ( matched.browser ) { 74 browser[ matched.browser ] = true; 75 browser.version = matched.version; 76 browser.versionNumber = parseInt(matched.versionNumber, 10); 77 } 78 79 if ( matched.platform ) { 80 browser[ matched.platform ] = true; 81 } 82 83 // These are all considered mobile platforms, meaning they run a mobile browser 84 if ( browser.android || browser.bb || browser.blackberry || browser.ipad || browser.iphone || 85 browser.ipod || browser.kindle || browser.playbook || browser.silk || browser[ "windows phone" ]) { 86 browser.mobile = true; 87 } 88 89 // These are all considered desktop platforms, meaning they run a desktop browser 90 if ( browser.cros || browser.mac || browser.linux || browser.win ) { 91 browser.desktop = true; 92 } 93 94 // Chrome, Opera 15+ and Safari are webkit based browsers 95 if ( browser.chrome || browser.opr || browser.safari ) { 96 browser.webkit = true; 97 } 98 99 // IE11 has a new token so we will assign it msie to avoid breaking changes 100 // IE12 disguises itself as Chrome, but adds a new Edge token. 101 if ( browser.rv || browser.edge ) { 102 var ie = "msie"; 103 104 matched.browser = ie; 105 browser[ie] = true; 106 } 107 108 // Blackberry browsers are marked as Safari on BlackBerry 109 if ( browser.safari && browser.blackberry ) { 110 var blackberry = "blackberry"; 111 112 matched.browser = blackberry; 113 browser[blackberry] = true; 114 } 115 116 // Playbook browsers are marked as Safari on Playbook 117 if ( browser.safari && browser.playbook ) { 118 var playbook = "playbook"; 119 120 matched.browser = playbook; 121 browser[playbook] = true; 122 } 123 124 // BB10 is a newer OS version of BlackBerry 125 if ( browser.bb ) { 126 var bb = "blackberry"; 127 128 matched.browser = bb; 129 browser[bb] = true; 130 } 131 132 // Opera 15+ are identified as opr 133 if ( browser.opr ) { 134 var opera = "opera"; 135 136 matched.browser = opera; 137 browser[opera] = true; 138 } 139 140 // Stock Android browsers are marked as Safari on Android. 141 if ( browser.safari && browser.android ) { 142 var android = "android"; 143 144 matched.browser = android; 145 browser[android] = true; 146 } 147 148 // Kindle browsers are marked as Safari on Kindle 149 if ( browser.safari && browser.kindle ) { 150 var kindle = "kindle"; 151 152 matched.browser = kindle; 153 browser[kindle] = true; 154 } 155 156 // Kindle Silk browsers are marked as Safari on Kindle 157 if ( browser.safari && browser.silk ) { 158 var silk = "silk"; 159 160 matched.browser = silk; 161 browser[silk] = true; 162 } 163 164 // Assign the name and platform variable 165 browser.name = matched.browser; 166 browser.platform = matched.platform; 167 168 jQuery.browser = browser; 169 return browser; 170}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.