Reply to Re: browser detection and redirection

Your name:

Reply:


Posted by Gιrard Talbot on 10/23/06 23:55

Beauregard T. Shagnasty wrote :
> jaydev wrote:
>
>> I am looking for code to detect and redirect to the corresponding
>> browser download page if the clients uses old version, could anyone
>> have a sample code for this?
>
> Browser sniffing is oft-mentioned as "doomed to failure."
>

We agree.

Browser identification approach (aka "browser sniffing"): not best, not
reliable approach
Using Object/Feature support detection approach: best and overall most
reliable
http://www.mozilla.org/docs/web-developer/upgrade_2.html#DevCrossBrowser

>> I want to use the following version browser only, if they are other
>> types I need to redirect to there download page.
>
> Normally, if you write a good site to begin, you won't have to restrict
> your audience to a specific set of browsers.
>

Jay wants to invite people and to assist people using old browsers into
upgrading their browser versions. This is a perfectly valid attitude,
especially in this particular time period where Internet Explorer 7 has
been very recently released, Firefox 2.0 will be out in a few days and
Opera 9.1 will be released in a few days. Any/all respectable web author
wants people using old, buggy, unsecure, non-recommendable,
non-compliant web standards browsers (like MSIE 6) to upgrade to the
best, free, available browser out there.

>> Internet Explorer version 5.0and above
> ..the latest is IE 7, and it is only usable by XP SP2 people. What about
> W95/W98/ME/Win2K people?
>
>> Netscape Navigator version 7.0 and above
> ..if you talk them into v 8.n, they will lose their email client.
>

Good point. You normally would want a NS 7.x user to upgrade to the
latest available Seamonkey 1.x release.

>> Mozilla version 1.3 and above
> ..the latest version of the suite is SeaMonkey.
>

Correct. Again, good point.

> And my User Agent string says:
> Mozilla/6.0 (Starship Enterprise NCC-1701)
>
> What will you do then?

Good point... but only a minority of users "play" with their userAgent
identification string like you.

{
"Another major problem with this approach is that the browser identity
can be 'spoofed' because, in many modern browsers, the
navigator.appVersion and navigator.userAgent string properties are user
configurable strings. For example,

* Firefox 1.x users and users of any/all Mozilla-based browsers can
customize the "general.useragent.*" string properties to any value.
* Opera 6+ allows users to set the browser identification string
via a menu
* MSIE uses the Windows registry
* Safari and Icab browsers mask their browser identity under
Internet Explorer or Netscape labels
}

which is why browser identification based on userAgent string detection
is not reliable.

http://www.mozilla.org/docs/web-developer/upgrade_2.html#BrowserIdent

One way to work around this problem would be to know which property or
method has been recently implemented in recently released Gecko-based
browsers.

For Opera 9, I recommend

if(window.opera && window.addEventListener && document.body.textContent)
[needs to be tested]
DOM 3 Core textContent attribute was implemented in Opera starting with
Opera 9.

For recent Gecko-based browsers (Seamonkey 1.0.?, Firefox 2):

if(window.netscape && document.compatMode &&
document.documentElement.createSVGAngle)
[I have not tested this one; maybe there is a better way]

Finally, a very safe, sound, respectable policy would be to add a link to

Why update?
http://www.upsdell.com/BrowserNews/why.htm

to

Find browsers
http://www.upsdell.com/BrowserNews/find.htm

and to
Browse Happy
http://browsehappy.com/

or possibly to

Alternative Browser Alliance
List of Alternative Web Browsers
http://www.alternativebrowseralliance.com/browsers.html
(personally, I would not recommend NS 8.x and I would definitely not
recommend K-meleon 1.x to newbies)

GΓ©rard
--
remove blah to email me

[Back to original message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация