[thelist] detecting opera

Peter-Paul Koch gassinaumasis at hotmail.com
Thu Aug 23 09:46:08 CDT 2001

>Not sure, Marc, I'd suspect not.
>(the same is true for iCab btw, which now allows users to enter any string, 
>rather than just picking from a list)

The pre-cooked Opera and iCab strings always contain 'Opera' or 'iCab', but 
I admit being able to fill in your own string becomes more popular. Opera 
doesn't allow you (yet), so a simple detect for the string 'Opera' will 
detect the browser correctly (as long as you do it before an MSIE detect, 
there may also be 'MSIE' in the string).

>However, if a user has changed the UA string, I'd suspect that they've
>done so from a reasonable position of knowledge and would know
>what they've let themselves in for.

Time for another pet peeve: the real point behind switching the browser 
string is to get around badly written browser detects. This problem could be 
easily solved if everyone starts detecting for JavaScript support. If you 
want to use DHTML, don't check if the browser is NN4+ or IE4+, instead check 
if the browser supports any advanced DOM (document.layers, document.all or 
document.getElementById). Much safer in the long run.

In my experience about 80% of the browser detects currently on the WWW are 
just bad coding. For more information about this very important subject, see 
(Beginning scripters, please read this page, it's *very* important to get 
this right when you start writing JavaScripts).


Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

More information about the thelist mailing list