Hacker News new | past | comments | ask | show | jobs | submit login

They intentionally show a broken UI if your user agent is Vivaldi. [1] In my opinion this is really concerning.

[1]: https://www.youtube.com/watch?v=QkayN3xiRDc




Crazy. User agent strings are such a broken concept where every browser pretends to be another. How anyone is still attempting to use them to do anything useful is beyond me.

If you a building a webapp, use feature detection not user agent strings.


User agents ARE feature detection, but for the server.

Now I tend to agree with the general advice that anywhere you can use JS based feature detection, you should prefer that.

But hell, there are times js based feature detection REALLY doesn't cut it.

For example, here's the Chromium team recommending UA based feature detection for handling the SameSite kerfuffle: https://www.chromium.org/updates/same-site/incompatible-clie...


UA is advertisement (heh) of features. Why shouldn’t you use what the browser tells you?


Think about the mapping between features and UA strings. Over time features are added or removed. So those mappings grow stale.

Check out feature detection vs browser detection, it explains some of the challenges to relying on user agent strings.

I think the rule is: detect features, don't rely on unreliable proxies for features.

https://mobile.htmlgoodies.com/html5/client/browser-and-feat...


I agree with that advice for most sites, especially SPA's, 100%.

But Google search has some weirdly specific requirements. It needs to know if it can show a result that required a polyfill mere ms after it gets your request, for example, or if it would be better to just send less bytes and a scaled down version of the same result that might need different data to assemble. It's not perfect but a UA string is one of the only practical ways to do this. Having qa and engineers to keep track of this mapping for the most commonly used browsers may make sense for search to shave off a bunch of time shipping js and doing feature detection to figure out what it needs next, but may not make sense for your website.

In general there are no blanket general guidelines that apply to every single site regardless of usage patterns or business needs.

Disclaimer: Former web search eng, current Googler.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: