Exployer Destroyer: Very elaborate browser type detection

Discussion in 'Javascript' started by cwdjrxyz, May 14, 2006.

  1. cwdjrxyz

    cwdjrxyz Guest

    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.
     
    cwdjrxyz, May 14, 2006
    #1
    1. Advertising

  2. "cwdjrxyz" <> 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 -
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
    'Faith without judgement merely degrades the spirit divine.'
     
    Lasse Reichstein Nielsen, May 14, 2006
    #2
    1. Advertising

  3. 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.
     
    Richard Cornford, May 14, 2006
    #3
  4. cwdjrxyz

    cwdjrxyz Guest

    Lasse Reichstein Nielsen wrote:
    > "cwdjrxyz" <> 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.
     
    cwdjrxyz, May 14, 2006
    #4
  5. cwdjrxyz

    Randy Webb Guest

    cwdjrxyz said the following on 5/14/2006 1:34 PM:
    > Lasse Reichstein Nielsen wrote:
    >> "cwdjrxyz" <> 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/
     
    Randy Webb, May 14, 2006
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    798
    Joe Kesselman
    Mar 6, 2006
  2. JKop

    Macro Destroyer

    JKop, Oct 14, 2004, in forum: C++
    Replies:
    36
    Views:
    1,202
  3. prophecy8445
    Replies:
    0
    Views:
    1,091
    prophecy8445
    Nov 25, 2007
  4. Gilles DRIDI
    Replies:
    3
    Views:
    741
    James Kanze
    Mar 9, 2008
  5. Zed Shaw
    Replies:
    0
    Views:
    121
    Zed Shaw
    Jul 28, 2006
Loading...

Share This Page