Head-smacking sniffing stupidity
Tuesday, 20. June 2006, 08:18:01
I'm feeling a bit like Hallvord right now
While doing some web site troubleshooting, I bumped into the following code at Olive Software:
Whoever coded that was obviously having a really bad day. Maybe their cat had died, but it must have been something seriously distracting.
I mean, translate their "opnew" into English: "It's a new version of the Opera browser if it's version 7 and identifying itself as IE or Mozilla". That's right, any later versions (like 8 or 9) are old versions, and even version 7 identifying as itself is old!
And people wonder why Opera appears to have a hard time handling web sites?
While doing some web site troubleshooting, I bumped into the following code at Olive Software:
var Mac = (navigator.userAgent.indexOf("mac")!=-1) || (navigator.userAgent.indexOf("Mac")!=-1);
var opnew = (navigator.userAgent.indexOf('Opera 7')!=-1);
var opold = (navigator.userAgent.indexOf('Opera')!=-1);
var msie = (navigator.userAgent.indexOf('MSIE')!=-1);
var moz = (navigator.userAgent.indexOf('Gecko')!=-1);
var NS6 = (navigator.userAgent.indexOf('Netscape')!=-1 && navigator.userAgent.indexOf('Gecko')!=-1);
var Nav4 = (document.layers);
var konq = (navigator.userAgent.indexOf('Konqueror')!=-1);
if (opold && msie || opold){var opold=1; msie=0;}
if (msie && !opold){msie=1;}
if(opnew && opold){opold=0;}
if(msie || moz || opnew){var dom = 1;}
Whoever coded that was obviously having a really bad day. Maybe their cat had died, but it must have been something seriously distracting.
I mean, translate their "opnew" into English: "It's a new version of the Opera browser if it's version 7 and identifying itself as IE or Mozilla". That's right, any later versions (like 8 or 9) are old versions, and even version 7 identifying as itself is old!
And people wonder why Opera appears to have a hard time handling web sites?









