1// Checks the browser and adds classes to the body to reflect it. 2 3$(document).ready(function(){ 4 5 if (jqueryUpgradeEnabledOnPage) { 6 // if jquery upgrade is enabled (jquery 3.4) then the $.browser won't exist 7 return; 8 } 9 10 var userAgent = navigator.userAgent.toLowerCase(); 11 $.browser.chrome = /chrome/.test(navigator.userAgent.toLowerCase()); 12 13 // Is this a version of IE? 14 if($.browser.msie){ 15 $('body').addClass('ie'); 16 17 // Add the version number 18 $('body').addClass('ie-' + $.browser.version.substring(0,1)); 19 } 20 21 22 // Is this a version of Chrome? 23 if($.browser.chrome){ 24 25 $('body').addClass('chrome'); 26 27 //Add the version number 28 userAgent = userAgent.substring(userAgent.indexOf('chrome/') +7); 29 userAgent = userAgent.substring(0,1); 30 $('body').addClass('chrome-' + userAgent); 31 32 // If it is chrome then jQuery thinks it's safari so we have to tell it it isn't 33 $.browser.safari = false; 34 } 35 36 // Is this a version of Safari? 37 if($.browser.safari){ 38 $('body').addClass('safari'); 39 40 // Add the version number 41 userAgent = userAgent.substring(userAgent.indexOf('version/') +8); 42 userAgent = userAgent.substring(0,1); 43 $('body').addClass('safari-' + userAgent); 44 } 45 46 // Is this a version of Mozilla? 47 if($.browser.mozilla){ 48 49 //Is it Firefox? 50 if(navigator.userAgent.toLowerCase().indexOf('firefox') != -1){ 51 $('body').addClass('firefox'); 52 53 // Add the version number 54 userAgent = userAgent.substring(userAgent.indexOf('firefox/') +8); 55 userAgent = userAgent.substring(0,1); 56 $('body').addClass('firefox-' + userAgent); 57 } 58 // If not then it must be another Mozilla 59 else{ 60 $('body').addClass('mozilla'); 61 } 62 } 63 64 // Is this a version of Opera? 65 if($.browser.opera){ 66 $('body').addClass('opera'); 67 } 68 69 70});
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.