How to detect Chromium-based browsers based on UA string

363 Views Asked by At

Is it enough to look for the word "Chrome" in the UA string to determine if the browser is Chromium-based? Or are there non-Chromium-based browsers that use the word "Chrome" in their UA string that would invalidate this method of detection?

1

There are 1 best solutions below

1
herrbischoff On

User agent parsing is not a reliable method of detecting a browser. Just see this list for thousands of user agent strings that just mash all browser strings together. Mainstream desktop browsers usually do not do this but many mobile ones do, especially on Android. Also, it's trivial to spoof this the user agent string.

Compare:

curl --user-agent "UserAgentString" http://example.com

In almost all cases what you really want to do is feature detection. However, this required JavaScript. But given that close to 100% of browsers used by Real People™ support JavaScript and have it enabled, this should only be an issue in edge cases.