2 ms·
I don't think this is true. Having the user agent is incredibly useful when debugging an issue. It can even be useful for deploying workarounds. For example if
by kevincox 3y ago
I don't think this is true. Having the user agent is incredibly useful when debugging an issue. It can even be useful for deploying workarounds.
For example if you see that errors are being thrown on your site and nearly all of them are the new release of Chrome then you can quickly narrow down it being a compatibility issue with the new version. Similarly if someone is making broken requests to your site at a high rate it may help you figure out who it is and contact them.
It can even be useful in automated use cases. If Firefox 27 has a bug it is reasonable to add very specific checks to work around it gracefully. When possible feature detection is better, but some bugs can be very hard to test for.
The problem comes from:
1. People whitelisting user agents.
2. Adding wide sweeping checks, especially if you don't constantly re-evaluate them (For example Brave versions later than 32)
In this case it seems that it is hard to actually conclude that a user-agent check was bad here. Google could have been trying to serve something that would work better on Firefox (maybe it worked around a bug). Of course that code crashed and burned, but that doesn't mean that the check was a bad idea.
I agree that user-agents are often used for evil, but they can also be used for good. It is hard to justify completely removing them. With great power comes great responsibility. Unfortunately lots of people aren't responsible.