User Agent Parser
Browser, version, engine, OS and device class from a UA string. Your own is filled in by default.
—
—
Worked example
A Chrome on Windows string contains "Safari/537.36" — a compatibility token Chrome has always sent so that old sniffing code does not break. Parsing order matters: check Edge and Opera before Chrome, because both include a Chrome token.
The user agent string is a fossil. It encodes browser, engine, OS and device in a format designed for 1990s sniffing, then accumulated compatibility tokens as browsers pretended to be each other to avoid being blocked.
Why parsing is unreliable
Order determines the answer: every Chromium browser claims Chrome, several claim Safari. Browsers reduce the reported information over time for privacy. And anything a client sends can be faked, so a UA is a hint, never an identity.