aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Why does the User-Agent=Mozilla/4.0 when I use MSIE 6.0? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Why does the User-Agent=Mozilla/4.0 when I use MSIE 6.0?" Watch "Why does the User-Agent=Mozilla/4.0 when I use MSIE 6.0?" New topic
Author

Why does the User-Agent=Mozilla/4.0 when I use MSIE 6.0?

Jamin Williams
Ranch Hand

Joined: Dec 16, 2003
Posts: 44
I don't know if this is the proper place to ask this type of question so please forgive me...
Why is it that the User-Agent HTTP header value is alway set to Mozilla/4.0 when Mozilla is not being used to generate the request?
For instance I am using MSIE 6.0 to make a request and the User-Agent in the request header is set to:

I'm sure there is some sort of historical explination for this but of course I can't find it on the net so I am hope somone here can educate me.
Thanks,
Jamin


Jamin Williams<br />SCJP, SCWCD
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60990
    
  65

Since this is more of a browser question than a JSP question, I'm going to shuffle this off to the HTML forum.
But the short answer is that there is no standard for the User-Agent header so browsers can do whatever they want. And that makes it a, er, 'challange' to decipher in a deterministic manner.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jamin Williams
Ranch Hand

Joined: Dec 16, 2003
Posts: 44
Thanks Bear.
So does anyone know why MS would want to use Mozilla/4.0 as opposed to using something that is more specific to MSIE? For instance MSIE/6.0?
Jamin
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
Hi Jamin
try go to this w3schools link using IE6 and see the magic
It shows Netscape 4.0!!!
So as suggested earlier it seems that due to non-standardization of this browser string for User-Agent header makes our life difficult.
But a possible work around could be,
- Detect if its a mozilla,netscape browser. I have so far not seen that Mozilla/netscape browsers returning incorrect information (e.g. MSIE6 as the browser type)
- and if (!netscape || !mozilla || !other_browser) then assume its IE..

this might work for you..
Regards
Maulin
Jamin Williams
Ranch Hand

Joined: Dec 16, 2003
Posts: 44
Thanks for the tip Maulin.
I guess if I want to go that route I need to find out what the other browers return...
If anyone knows the answer to the original question, please feel free to share it!
Jamin
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
follow the link I posted in this thread last week...
http://www.coderanch.com/t/114417/HTML-JavaScript/determine-NetScape-browser-version
Eric
 
Don't get me started about those stupid light bulbs.
 
subject: Why does the User-Agent=Mozilla/4.0 when I use MSIE 6.0?