1function get_browser(){ 2 var ua=navigator.userAgent,tem,M=ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || []; 3 if(/trident/i.test(M[1])){ 4 tem=/\brv[ :]+(\d+)/g.exec(ua) || []; 5 return {name:'IE',version:(tem[1]||'')}; 6 } 7 if(M[1]==='Chrome'){ 8 tem=ua.match(/\bOPR\/(\d+)/) 9 if(tem!=null) {return {name:'Opera', version:tem[1]};} 10 } 11 M=M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?']; 12 if((tem=ua.match(/version\/(\d+)/i))!=null) {M.splice(1,1,tem[1]);} 13 return { 14 name: M[0], 15 version: M[1] 16 }; 17}
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.