Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does the WebKit user agent contain "mozilla"?

Why in the world is this the webkit user agent:

Mozilla/5.0 (Windows NT 6.0; WOW64) AppleWebKit/534.27+ (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27

Why not:

Webkit/5.04 (Windows NT 6.0; WOW64) AppleWebKit/534.27+ (KHTML, like Gecko) Safari/533.20.27

Thanks for clearing this up :)

like image 898
cmplieger Avatar asked Jan 30 '26 04:01

cmplieger


2 Answers

It really is a left over from the early days of Web. Many sites were only compatible with Netscape Navigator, which was the dominant browser at that point, and so what they did was to sniff the User-Agent for the "Mozilla/*" part. When IE showed up, MS wanted those websites to work in their browser as well, so they went for pretending they are Mozilla as well. And so did all the browsers that popped up later on, including WebKit-based ones. And it doesn't seem like that artifact is going away anywhere soon as still many old sites do that type of sniffing and for browsers dropping this convention would probably mean breaking thousands of sites.

like image 101
Jakub Wieczorek Avatar answered Feb 01 '26 20:02

Jakub Wieczorek


It's a throwback to the browser wars, the browser is identifying as a 'Mozilla Compatible' agent.

like image 38
PhonicUK Avatar answered Feb 01 '26 22:02

PhonicUK