Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> user-agent had and will never be useful for the client

In the past it was definitely useful for some things. To use as an example something I was involved with, many years ago: if you were deploying software via ClickOnce and needed a particular version of .NET installed, that information was exposed in the user-agent string, so you could tell the user “you need to go install this other thing first”, rather than saying “try this, and if it doesn’t work in one of these ways, check if you’ve installed this”.

These days, it’s not often useful, and feature detection is highly preferable where possible, but platform detection (whether via user-agent string or properties like navigator.platform) is still definitely useful, for things that should be tied to what the platform actually is. For example, on a download page you want to know what the OS and architecture are in order to recommend the appropriate file to download for that machine. Or, when implementing keyboard shortcuts, Apple platforms use metaKey (⌘) instead of ctrlKey (⌃), and visually present the shortcuts differently too, such as ⌘⌥⇧⌫ or Command-Option-Shift-Delete, compared with Ctrl+Alt+Shift+Backspace for everyone else.



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

Search: