Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Source | 10 comments | Create New Account
Click here to return to the 'Source' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Source
Authored by: hackamacj on Dec 20, '02 10:20:25AM

I stubled across what they use as the sniffer for Browsers:

var agt=navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);
var is_DOM = (document.getElementById) ? true : false;
var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
&& (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
&& (agt.indexOf('webtv')==-1));
//var is_nav4 = document.layers ? true : false;
var is_nav4up = (is_nav && (is_major >= 4));
var is_nav6up = (is_nav && is_DOM);
var is_ie = (agt.indexOf("msie") != -1);
var is_ie3 = (is_ie && (is_major < 4));
var msie_vers_start = agt.indexOf("msie")+5;
var msie_real_vers = parseFloat(agt.substring(msie_vers_start, msie_vers_start+3));
var is_ie4 = (is_ie && (is_major == 4) && (msie_real_vers < 5));
var is_ie4up = (is_ie && (is_major >= 4));
var is_ie5 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.")!=-1));
var is_ie5up = (is_ie && !is_ie3 && !is_ie4);
var is_aol = (agt.indexOf("aol") != -1);
var is_aol3 = (is_aol && is_ie3);
var is_aol4 = (is_aol && is_ie4);
var is_mac = (agt.indexOf("mac")!=-1);
function styleVer()
{
var v = 'dom'; // DOM & IE-PC
if (is_nav) {
if (is_mac) v = 'nsmac'; // NS MAC
else if (!is_nav6up)v = 'nspc'; // NS-PC < 6
} else if (is_mac && !is_ie5up) {
if (is_aol) v = 'aolmac'; // IE-MAC < 5 & AOL
else v = 'iemac'; // IE-MAC < 5 & !AOL
}
return "<link rel='stylesheet' type='text/css' href='/"+v+".css'>";
}
document.write ('<link rel="shortcut icon" href="/favicon.ico">');
document.write(styleVer());

It seems as though its pretty much if it isn't a browser its aol



[ Reply to This | # ]