News for hackers. Stuff that matters.
Re:Encyclopedia of broken UserAgent string detections by marton_s on Tuesday January 18, 2022 @12:49AM (#29975595)
A more accurate title would be “Four examples of broken UserAgent string detections”.
Re:Encyclopedia of broken UserAgent string detections by PufPufPuf on Tuesday January 18, 2022 @05:04AM (#29977125)
If you're doing user-agent detection, your code is broken by design. Use feature detection instead.

Please. I'm tired of having to use an extension to spoof user-agent in order for some websites to work. The creators of the Vivaldi browser were even forced to permanently spoof Chrome's user-agent due to websites unrecognizing the Vivaldi one.

Re:Encyclopedia of broken UserAgent string detections by antris on Tuesday January 18, 2022 @06:31AM (#29977684)
In general yes. In some specialty cases user agent detection is fine, e.g. if the application has critical and specific requirements on what software/hardware stack it should be ran on and has been tested for. Just because a feature has been detected to exist in the browser doesn't mean it works correctly, after all. But even in these cases, detecting a non-supported browser should throw a warning, not prevent you from accessing a site.