2 ms·
The user agent header has always been a mistake. I'm not sure what companies like Google are thinking when they block features from working based on the user a
by ravenstine 3y ago
The user agent header has always been a mistake. I'm not sure what companies like Google are thinking when they block features from working based on the user agent. In Firefox, I use an add-on that randomizes the user agent string, and I've configured it to use a handful of the most common user agent strings. Occasionally, parts of YouTube will break because of a certain user agent configured, like chats or chat replay, showing nothing but a broken frame with no meaningful information to a non-developer. I guess one could say that it encourages people to update their browsers, or use Chrome which auto-updates, but come on. If a feature legitimately doesn't work, then the user still has to update to a modern browser anyway.
- kevincox 3y agoI 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.