• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Jamin Williams
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65120
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jamin Williams
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
follow the link I posted in this thread last week...
http://www.coderanch.com/t/114417/HTML-JavaScript/determine-NetScape-browser-version
Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic