Exployer Destroyer: Very elaborate browser type detection

C

cwdjrxyz

Take a look at http://www.explorerdestroyer.com/ and view the script
used to detect IE. It uses quite a maze of elaborate script that
examines user agents and many properties of a browser. Of course some
of the detection methods used are not likely to please some users of
this group. Perhaps some of you would enjoy seeing if the script might
give any false positives or false negatives for detection of IE
browsers. I am just throwing this out for those who like to examine
this sort of thing. I have no plans to use it at present. If I did use
something of the sort, I think I would want to give the user a choice
of Opera and perhaps other browsers as well as Firefox.
 
L

Lasse Reichstein Nielsen

cwdjrxyz said:
Take a look at http://www.explorerdestroyer.com/ and view the script
used to detect IE. It uses quite a maze of elaborate script that
examines user agents and many properties of a browser.

Not that elaborate, but still more fragile than just doing:
<!--[if IE]>
<script type="text/javascript">
var isIE = true;
</script>
Of course some of the detection methods used are not likely to
please some users of this group.

Nor is some of their scripting. The example page starts with:
<body onload="javascript:hasIE_hideAndShow();">

The hasIE_showOnlyLayer uses a three-pronged if/else to use either
document.getElementById, document.all or document.layers. Then it
goes on to use .innerHTML on the result, even though the only browser
that would trigger the third branch (document.layers) does not support
innerHTML.
Similar problem in hasIE_showLayer, where they write
document.layers[...].style
but Netscape 4 has no style property.
Perhaps some of you would enjoy seeing if the script might give any
false positives or false negatives for detection of IE browsers.

I'm sure it's possible to have a browser like Firefox set a custom
user agent string that would fool the script.
I am just throwing this out for those who like to examine this sort
of thing. I have no plans to use it at present. If I did use
something of the sort, I think I would want to give the user a
choice of Opera and perhaps other browsers as well as Firefox.

Bonus points for that thought (says the happy Opera user).

They seem to be also pushing the Google toolbar for Firefox. Didn't
have a lot of use for it when I last checked it out, but I guess they
could have added some useful functionality since.

/L
 
R

Richard Cornford

cwdjrxyz said:
Take a look at http://www.explorerdestroyer.com/ and view the
script used to detect IE. It uses quite a maze of elaborate
script that examines user agents and many properties of a
browser.

"A maze of elaborate script used to detect IE"? That is hardly a maze,
and as far as I can see the only property that is actually considered in
the decision as to whether the browser is IE is the -
navigator.userAgent - property. That is; the script is an ill thought
out and poor example of the worst (most unreliable) browser detection
strategy available.

It flails to identify my IE as IE (it does not use the default UA
string), and it identifies IceBrowser and NetFront as IE. Three tests
and false results with all.
Of course some of the detection methods used are not likely
to please some users of this group.

There is not a regular contributor to this group who could not crate a
considerably more reliable alternative test for IE (and that includes
VK, which is about as damming a condemnation of the script as is
possible). Should it be surprising that 'users' of this group should not
be pleased to see things being done so badly that they become more of a
joke than anything else.
Perhaps some of you would enjoy seeing if the script might
give any false positives or false negatives for detection
of IE browsers.
<snip>

I don't know about 'enjoy', but false positives and negatives are the
inevitable outcome of a script written by someone with such a
superficial understanding of browser scripting.

Richard.
 
C

cwdjrxyz

Lasse said:
cwdjrxyz said:
Take a look at http://www.explorerdestroyer.com/ and view the script
used to detect IE. It uses quite a maze of elaborate script that
examines user agents and many properties of a browser.

Not that elaborate, but still more fragile than just doing:
<!--[if IE]>
<script type="text/javascript">
var isIE = true;
</script>
<[end if]-->

Yes, using the IE conditional comments would appear to be safer as well
as more simple.

I notice that they checked for WebTV in the ua. I believe the old WebTV
boxes spoofed IE4, and newer boxes(now MSNTV) spoofed IE6. Thus one
might not want to reject them. The most simple way to detect the old
WebTV boxes is, of all things, with the appCodeName. Most browsers give
Mozila here, but the old WebTV boxes use "bowser". I doubt if any
computer browser maker would want to spoof and old MSNTV box. Bowser
was the name of a rabbit belonging to one of the developers of
WebTV(long since sold to Microsoft). There are still some of the old
WebTV boxed in use in the US, but the number now likely is well under
one million boxes. The new MSNTV boxes, out about a year now, use a
watered-down IE6 browser. These can be detected in the ua by a string
that gives the non-standard screen dimensions used for display on a TV
set. This likely woud be fairly safe for detecting the new boxes, since
what computer browser maker would want to spoof the new MSNTV boxes?
The suggestion to download Firefox would be completely useless for
eithet the old or new WebTV/MSNTV boxes, because neither can download
anything. The boxes are stuck with what Microsoft decides to provide
them.
 
R

Randy Webb

cwdjrxyz said the following on 5/14/2006 1:34 PM:
Lasse said:
cwdjrxyz said:
Take a look at http://www.explorerdestroyer.com/ and view the script
used to detect IE. It uses quite a maze of elaborate script that
examines user agents and many properties of a browser.
Not that elaborate, but still more fragile than just doing:
<!--[if IE]>
<script type="text/javascript">
var isIE = true;
</script>
<[end if]-->

Yes, using the IE conditional comments would appear to be safer as well
as more simple.

And when you see more and more sites exclude non-IE based on conditional
comments, you will see other browsers start supporting them just to keep
some inept author from discriminating against non-IE browsers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top