|
Posted by Andy Dingley on 10/24/06 10:21
jaydev wrote:
> I am looking for code to detect and redirect to the corresponding
> browser download page if the clients uses old version,
Then stop doing that. It's bad and wrong for a whole load of reasons.
It's their browser. You worry about your site, you let the customer
worry about their browser.
Maybe you're a major trustworthy ISP or security vendor offering a
browser checking service. In this narrow case, there could be a case
for _advising_ people that their browser version is out of date and
shoudl be upgraded. You should present this information as a table of
what you think they have, what version you think it is, then some
_suggestions_ as to how to upgrade, which they can follow if (and only
if) they wish to. DO NOT FORCE A REDIRECT ON THEM BECAUSE _you_ THINK
THEY OUGHT TO BE FORCED TO UPGRADE.
If you were competent to advise people to upgrade browser versions (one
of only half-a-dozen sites I'd trust to do this) you'd already know how
to do this, and you'd be telling us how to do it.
If this is for your site, or your cat Mittens' homepage, then why
should it be telling me stuff about my browser? Go away - it's none of
your business. It's also very bad security practice to train naive
customers into believing that random websites are trustworthy
authorities to recommend upgrades. What happens if you're actually an
Elbonian credit card fraud ring trying to install trojaned browsers on
the unsuspecting?
If you want to "browser sniff" to see if browsers can support features
that your site needs to use, then don't browser sniff, feature sniff
instead. Don't assume that "IE 4 doesn't support the .foobar property",
instead test whether this browser actually supports .foobar directly
(this is easy and a standard JavaScript technique).
Remember that browser sniffing is usually based on the user agent
string, and that's very far from reliable. It's commonly misrepresented
deliberately, let alone all the general unreliability of it.
If you need to force users to use a particular browser, then your site
is wrong. Fundamentally and abjectly wrong.
Navigation:
[Reply to this message]
|