Safari claims to be netscape

aicul

Registered
I am building a site and differentiating actions depending on the browser used by the client. I use javascript for this.

Something confusing has appeared so I did several tests and it comes down to this:

Running the following javascript command in Safari:

document.write(navigator.appName);

will yield

Netscape

Is this normal? How can I detect Safari as Safari using javascript?

Thanks for any input
 
It's possible your using that function is triggering Safari to spit out that it's Netscape in order for it not to be excluded from certain websites. Safari will automatically select the user agent string to send to the server which you can change if you have the Debug menu enabled in Safari.

I suspect that by you using the Javascript to check the browser, Safari gives back a value that will be more common in order to not be excluded.
 
Captain Code said:
I suspect that by you using the Javascript to check the browser, Safari gives back a value that will be more common in order to not be excluded.

:eek: Devious and unethical in my eyes. :eek:

Also silly as Safari Javascript behaves more like IE than NS from what I have seen. But I'm no guru in this domain.
 
In other words a feature in Safari to combat those devious and unethical web page programmers who have a tough time understanding HTML and how it should properly be coded. <G>
 
From the moment Safari does not behave like other browsers it should claim to be Safari, not pose as something else.

A thought:

Misbehaviour based on other peoples misbehaviour is not justified. Remember that school teacher that asked "if Tom jumps off the bridge do you really want to do the same thing?"

Anyone care to propose a fail safe method to correctly identify Safari using javascript?

Thanks for constructive input
 
Safari has to pose as something else since there are many websites that require either IE or netscape and just bomb if you don't have these browsers. This sadly what happens when you are a minority.

I don't believe there is a failsafe way of identifying Safari, since the user agent can be changed by the user very easily via the debug menu.
 
Viro said:
Safari has to pose as something else since there are many websites that require either IE or netscape and just bomb if you don't have these browsers.

Point taken, but Safari does not behave like NetScape as far as I've seen. It actually behaves better.
 
Back
Top