# Why does Edge put “Safari” in its User-Agent? ## The bizarre legacy left by the browser wars two decades ago {#sec-b379c8b7cf7e} If you’ve ever dug into server logs, you’ve probably seen a string like this: ```txt Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36 Edg/101.0.1210.47 ``` “Edge but Safari?” “Chrome but Mozilla?” How can one browser pretend to be four at once? It’s not just a string joke—it’s a fossil from the fiercest browser war in web history, and its effects are still visible in server logs in 2025. In this post we’ll cover: * Why every browser still starts with `Mozilla/5.0` * Why Chromium‑based Edge deliberately embraces `Safari` * How this mess is ultimately being phased out by standards --- ## 1. It all started with the Netscape vs. IE war {#sec-ed1dfede82d5} In the late 1990s the browser market was essentially a two‑player game: * **Netscape Navigator** * **Internet Explorer** Netscape’s User‑Agent looked like this: ```txt Mozilla/4.0 (compatible; ...) ``` Web developers began to think: > “If it’s a Mozilla browser, it must support the latest features. Anything else is legacy code.” Thus, *browser feature branching* became *User‑Agent string checking*. ```js // 1990s‑style pseudocode if (ua.includes("Mozilla")) { // Modern browser code } else { // Legacy code } ``` Other browsers were outraged: > “We’re also Netscape‑grade—why should we be discriminated against?” So everyone started prefixing their UA with **Mozilla**. At that time, Mozilla was essentially a *compatibility mark* meaning: > “I’m Netscape‑grade. Don’t treat me as low‑end.” ### The origin of the name “Mozilla” {#sec-3fc954878dea} * “Mosaic + Godzilla” → “Mozilla” is a common story. * Emotionally, it’s a parody of a “giant, powerful browser” like Godzilla. In practice it was just a marketing/historical label for “Netscape‑like or worthy of Netscape.” That’s why today almost every browser starts its UA with Mozilla: ```txt Mozilla/5.0 (Windows NT 10.0; Win64; x64; ...) ``` It’s not because the browser is Mozilla, but because of the historical reason: *I’m Netscape‑grade, so don’t dismiss me as old.* --- ## 2. Engine wars: WebKit, Gecko, Trident… and the chaos that followed {#sec-a68550e88545} In the early 2000s the engine landscape split like this: * **IE** → Trident * **Firefox** → Gecko * **Safari** → WebKit Developers again used UA strings to split browsers: ```js const ua = navigator.userAgent; if (ua.includes("Safari")) { // Safari / WebKit code } if (ua.includes("Gecko")) { // Firefox code } if (ua.includes("Trident")) { // IE‑only code (crying…) } ``` Even at this point the pattern was already problematic. Mixing engine names with brand names made branching logic increasingly complex. ### Chrome’s arrival → “Who are you?” crisis {#sec-380a1e0589e4} When Chrome first appeared, the problem was simple: > Websites didn’t recognize Chrome, so UA checks sent it down the Safari code path. Chrome’s strategy was: > “Let’s just pretend we’re Safari.” So Chrome’s UA became: ```txt Mozilla/5.0 (...) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/xx.xx.xx Safari/537.36 ``` The real meaning of this string is roughly: * `Mozilla/5.0` → “I’m also Netscape‑grade.” * `AppleWebKit/537.36` → “My rendering engine is WebKit‑like.” * `(KHTML, like Gecko)` → “I can run like Gecko (Firefox).” * `Safari/537.36` → “I need to look like Safari for compatibility.” * `Chrome/xx` → “I’m actually Chrome.” In short, Chrome became a *four‑layered masquerade*. --- ## 3. Edge’s arrival: a compromise between identity and survival {#sec-741f429fad5a} Now it’s Microsoft’s turn. The original Edge used its own EdgeHTML engine, but eventually switched to Chromium‑based Edge. Microsoft knew this fact well: > “Websites already have tens of thousands of UA‑based branches.” If Edge had simply used: ```txt User-Agent: Edge/101.0.0.0 ``` The reality would be: * Many sites wouldn’t recognize the browser. * Legacy `if (ua.includes("Chrome"))` checks would fail. * Users would see “Unsupported browser” screens, broken layouts, and odd polyfills. So Edge’s strategy was: > “I’m Edge, but I’ll look like Chrome + Safari.” Resulting UA: ```txt Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36 Edg/101.0.1210.47 ``` Interpretation: * `Mozilla` → “I’m a modern browser.” * `AppleWebKit` → “I’ll render like WebKit.” * `Chrome` → “I’m Chromium‑based.” * `Safari` → “I’ll also look like Safari, so don’t block me.” * `Edg` → “But my brand is Edge.” So this long string isn’t Edge’s self‑introduction; it’s a *survival‑mode disguise* to appease legacy code. --- ## 4. Decoding the User‑Agent string: 30 years of history in one line {#sec-08da4b643a7e} Let’s break down the key tokens: | Token | Real meaning (paraphrased) | | --- | --- | | `Mozilla/5.0` | “I’m a Netscape‑grade modern browser. Don’t treat me as old.” | | `AppleWebKit/537.36` | “I render like WebKit (Safari).” | | `KHTML, like Gecko` | “I can run like Gecko (Firefox).” | | `Safari/537.36` | “I’m not real Safari, but I’ll look like it.” | | `Chrome/101.0...` | “My engine is Chromium (Chrome).” | | `Edg/101.0...` | “My brand is Edge; the rest is a survival disguise.” | In a single line we see: * Netscape vs. IE war * Gecko vs. WebKit vs. Trident engine war * Chrome’s market domination * Edge’s survival strategy and compromise --- ## 5. User‑Agent is becoming a “historical garbage dump” {#sec-5bb4f0aba746} The problem is that the UA system is essentially a broken design today: * Browsers mimic each other → **trust = 0** * Legacy code forces strings to grow * Device/OS info is over‑exposed → **privacy concerns** * Parsing UA to determine browser/feature is nearly impossible Thus W3C and browser vendors are gradually phasing out UA strings in favor of **User‑Agent Client Hints**. ### Client Hints: “Let’s be honest now” {#sec-28ba4e4b27e5} In the future, headers like these will take center stage: ```txt Sec-CH-UA Sec-CH-UA-Platform Sec-CH-UA-Mobile ``` How it works: 1. Server asks for precise browser info via response headers. 2. Browser sends only the requested data, structured and selective. 3. No need to parse a long, deceptive string. Benefits: * Browsers no longer need to perform a *triple‑ or quadruple‑layered disguise*. * Servers request only the data they need, reducing privacy exposure. * Structured data simplifies code. In short, standards are being redesigned so browsers can be honest. --- ## 6. Conclusion – a new perspective on the “strange line” in server logs {#sec-835f487251df} Look again at that first line: ```txt Mozilla/5.0 ... Safari/537.36 ... Edg/101 ``` It’s not just a string; it’s a compressed history of: * Browser wars and power struggles * Compromises with legacy code * Market‑driven disguises and strategies * The slow standardization that’s finally catching up And the funny part is: > This historical storm’s remnants are still being captured in server logs every day in 2025. So next time you see a weird combination like `Mozilla/5.0 ... Safari ... Edg/...` in your logs, you can smile and think, “Another fossil has passed by.” 🙂 ![image](https://blog.mikihands.com/media/editor_temp/6/c04e87c5-9bc2-423d-a7f5-830763169ef2.png)