Ein User-Agent-String ist die Textzeile, die ein Browser bei jeder Anfrage mitschickt, um sich zu beschreiben. Standardmäßig wird hier Ihrer gelesen, oder Sie fügen einen aus einem Logfile ein, um zu sehen, was er von sich behauptet. Der String wird per Mustererkennung zerlegt, um Browser, Betriebssystem und die Frage zu benennen, ob es sich um ein Handgerät handelt.
Das Wesentliche an diesem Format ist, dass es ein historischer Zufall und keine Spezifikation ist. Nahezu jeder Browser führt aus Kompatibilitätsgründen die Namen mehrerer anderer mit, weshalb ein moderner Chrome-String neben Chrome auch die Wörter Mozilla, AppleWebKit, KHTML, Gecko und Safari enthält. Die Erkennung ist deshalb eine geordnete Folge von Vermutungen und kann falsch liegen.
Warum die Erkennung unzuverlässig ist
-
Chromium-basierte Browser geben sich als Chrome aus:
Edge, Opera, Brave und Vivaldi führen alle Chrome in ihrem String und werden hier als Chrome erkannt. Sie zu unterscheiden erfordert das zusätzliche Kürzel, das jeder anhängt.
-
Der String kann alles Mögliche sein:
Er wird vom Client gesetzt und ist frei änderbar. Bots geben routinemäßig den String eines Browsers an — er belegt eine Behauptung, keine Tatsache.
-
Browser reduzieren aktiv, was sie preisgeben:
Versionsnummern werden eingefroren und Details aus Datenschutzgründen entfernt, eine heute funktionierende Erkennung verfällt also still und leise.
-
Erkennen Sie Funktionen statt Browser:
Zu fragen, ob eine Fähigkeit vorhanden ist, stimmt jetzt und bleibt richtig. Zu fragen, welcher Browser im Einsatz ist, war nie mehr als eine Näherung.
A historical accident, not a specification
A user-agent string is a line of text a browser sends with every request to describe itself, and the [msm_tool slug="user-agent"] picks it apart with pattern matching to name the browser, the operating system, and whether the device is a handheld. The format itself is not a real specification — nearly every browser includes the names of several others purely for compatibility, which is why a modern Chrome string carries the words Mozilla, AppleWebKit, KHTML, Gecko and Safari alongside the word Chrome itself.
Chromium-based browsers all present as Chrome
Edge, Opera, Brave and Vivaldi are all built on Chromium and carry the word Chrome directly in their strings, so they are identified as Chrome by default here. Telling them apart from actual Chrome, or from each other, needs the additional token each one specifically appends to its own string.
The string is a claim, not a fact
Whatever the client sends is entirely under its own control and can be set to anything at all. Bots routinely present a real browser's string rather than announcing themselves, so a user-agent value is evidence of what a client claims to be, never proof of what it actually is.
Browsers are actively revealing less over time
Version numbers are being frozen and identifying details removed for privacy reasons across the major browsers, so detection logic that works correctly today will quietly become less accurate as that reduction continues rather than failing all at once.
Why detecting features beats detecting browsers
Asking whether a specific capability exists is accurate at the moment it is asked and stays accurate regardless of what happens to user-agent strings afterwards. Asking which browser is in use, by contrast, has never been more than an approximation built on a string with no obligation to be honest.