browser sniffer

P

Paul Watt

Hi,
Could anyone recomend a browser sniffer that will differentiate
between IE and pretty much anything else then load a CSS file
according to hat browser the user is using?

Cheers

Paul
 
E

Els

Paul said:
Hi,
Could anyone recomend a browser sniffer that will differentiate
between IE and pretty much anything else then load a CSS file
according to hat browser the user is using?

Any sniffer would fail when I use Opera identifying as IE, or if I
just alter the user agent string in a Gecko browser to be the same as
IE.

I think you're better off making individual styles (un)readable by
different browsers. For instance: if you don't want IE to see the
styles for div.someclass,
You can write it like:
body>div.someclass{}
(also not seen by NN4, and Icab2)

More info on hacks like that:
http://centricle.com/ref/css/filters/
 
C

C A Upsdell

Els said:
Any sniffer would fail when I use Opera identifying as IE ...

No. Even when Opera is configured to identify itself as IE, the
userAgent string still contains the word 'Opera'. Only a sloppy sniffer
would fail.
 
E

Els

C said:
No. Even when Opera is configured to identify itself as IE, the
userAgent string still contains the word 'Opera'. Only a sloppy sniffer
would fail.

I knew it! <g>
Which is why I continued that sentence with "or" ...
(yes I should have been more specific ;-))
 
W

William Tasso

Writing in news:alt.html,alt.www.webmaster
From the safety of the cafeteria
C A Upsdell said:
...
Only a sloppy sniffer would fail.

The mind bogles at the very thought of a sniffer having the
attribute:sloppy and the implication therefore that there are sniffers
that do not.
 
S

Spartanicus

C A Upsdell said:
No. Even when Opera is configured to identify itself as IE, the
userAgent string still contains the word 'Opera'.

Opera 8 has a stealth mode to get around outdated and malicious
sniffers, in that mode it's UA string is identical to that of the
browser being spoofed.
 
C

C A Upsdell

Spartanicus said:
Opera 8 has a stealth mode to get around outdated and malicious
sniffers, in that mode it's UA string is identical to that of the
browser being spoofed.

How is this done? I can't find it under any Opera 8 preferences;
searching for 'stealth' under Opera Help reveals nothing; and examining
Opera's info re userAgent strings reveals nothing.
 
S

Spartanicus

C A Upsdell said:
How is this done? I can't find it under any Opera 8 preferences;
searching for 'stealth' under Opera Help reveals nothing; and examining
Opera's info re userAgent strings reveals nothing.

It's controlled via ua.ini (IIRC). Opera 8 by default once a week checks
if a new version of the browser is available. At the same time it
downloads an updated version of this ua.ini file. The file controls
which UA string is sent to which site, it is maintained by Opera
Software so that users don't have to mess with it themselves and because
making stealth mode easily available to users could result in users
permanently configuring stealth mode. This would result in Opera showing
up even less in server logs that it already does, thereby contributing
to the common "We don't support Opera because it has to small a market
share" nonsense reply many users get when they complain to a site about
the site not working in Opera.

Knowledgable users however can edit the file directly.
 
C

C A Upsdell

Spartanicus said:
It's controlled via ua.ini (IIRC). Opera 8 by default once a week checks
if a new version of the browser is available. At the same time it
downloads an updated version of this ua.ini file. The file controls
which UA string is sent to which site, it is maintained by Opera
Software so that users don't have to mess with it themselves and because
making stealth mode easily available to users could result in users
permanently configuring stealth mode. This would result in Opera showing
up even less in server logs that it already does, thereby contributing
to the common "We don't support Opera because it has to small a market
share" nonsense reply many users get when they complain to a site about
the site not working in Opera.

Knowledgable users however can edit the file directly.

Okay, I found some info at the bottom of
http://www.opera.com/windows/changelogs/800/

The only thing is, I can't find ua.ini anywhere on my PC, so I wonder if
this is an Opera 8 feature that was implemented but which is not yet active.
 
S

Spartanicus

C A Upsdell said:
The only thing is, I can't find ua.ini anywhere on my PC, so I wonder if
this is an Opera 8 feature that was implemented but which is not yet active.

I don't use the feature myself and I have Opera configured not to
perform the automatic update checks.

Afaik it is active, but the ua.ini file is not installed by default.
Afaik it will only be present when Opera has performed one of it's
weekly update checks, or after a manual update check from the Help menu.
 
C

C A Upsdell

Spartanicus said:
I don't use the feature myself and I have Opera configured not to
perform the automatic update checks.

Afaik it is active, but the ua.ini file is not installed by default.
Afaik it will only be present when Opera has performed one of it's
weekly update checks, or after a manual update check from the Help menu.

Well, I've done both, and no ua.ini appeared.

With regard to browser sniffing, I wonder how relevant ua.ini is: it
should only list sites which don't work without browser spoofing, which
should only happen with sites which have sloppy browser sniffers; a
well-written browser sniffer should therefore not be affected by ua.ini.

Of course there is the larger issue of whether browser sniffing is
appropriate for dealing with browser differences, especially given that
there are alternatives, e.g. object detection, and CSS trickery. But
this is not an issue I will address, as it has been addressed umpteen
times, and there is no point on rehashing this issue all over again.
 

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,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top