473,513 Members | 2,266 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Exployer Destroyer: Very elaborate browser type detection

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.

May 14 '06 #1
4 1606
"cwdjrxyz" <sp*******@cwdjr.info> writes:
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]-->
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
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
May 14 '06 #2
cwdjrxyz wrote:
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.
May 14 '06 #3

Lasse Reichstein Nielsen wrote:
"cwdjrxyz" <sp*******@cwdjr.info> writes:
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.

May 14 '06 #4
cwdjrxyz said the following on 5/14/2006 1:34 PM:
Lasse Reichstein Nielsen wrote:
"cwdjrxyz" <sp*******@cwdjr.info> writes:
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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 14 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
10046
by: Szar | last post by:
JS noob. I've seen plenty of browser detection scripts but they all seem to be slightly different and don't really fit my needs. I have various places where if the browser is IE I'd like to display...
17
2522
by: lawrence | last post by:
How is it possible that the question "How do I detect which browser the user has" is missing from this FAQ: http://www.faqts.com/knowledge_base/index.phtml/fid/125 and is only here on this...
8
4529
by: R. Smits | last post by:
I've have got this script, the only thing I want to be changed is the first part. It has to detect IE version 6 instead of just "Microsoft Internet Explorer". Can somebody help me out? I tried...
8
1669
by: Jimnbigd | last post by:
What is the recommended code to test browser type, for conditional processing in Javascript? I have seen tests for "document.all". I have seen tests for the actual browser name, or substrings in...
2
1519
by: Sergey Poberezovskiy | last post by:
Hi, Simple question: I developed an ASP.Net application that runs under IE. Now for all other browsers I display a message that the application runs under IE: If Not...
7
1919
by: phal | last post by:
Hi I think there are many different browsers to browse to the Internet, how can I write the javascript to identify different browser and display according to the users. Some browser disable the...
4
2549
by: trpost | last post by:
I am looking for a script using javascript to pull browser information including, browser type and version, OS info, plugins (flash, acrobat, media player, etc), java version, etc. that will work...
4
1860
by: KoRnDragon | last post by:
I'm using a script to detect which browser is using in order to include the correct stylesheet but on this one page (http://korndragon.com/ffa5.php) It thinks I'm using Internet Explorer when I'm...
10
3233
by: Conrad Lender | last post by:
In a recent thread in this group, I said that in some cases object detection and feature tests weren't sufficient in the development of cross-browser applications, and that there were situations...
0
7265
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7171
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7388
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7545
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
4751
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3240
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1605
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
461
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.