3 ms·
But there are genuinely things that can't be feature detected. A bug that happens 1% of the time due to reasons still unknown, or features or bugs that need so
by Klathmon 7y ago
But there are genuinely things that can't be feature detected.
A bug that happens 1% of the time due to reasons still unknown, or features or bugs that need something to happen on the user or hardware side to detect.
For example, I had an issue once where when using WebRTC on some devices with 3 rear-facing cameras on android it would horizontally flip the "long range focus" camera. There is no way to feature detect that. Hell there wasn't even a way for me to feature detect that I should use the second of the 3 cameras on that device (the first was a fisheye-style wide angle lens, and the 3rd was a middle-ground lens, but the second worked best for our usecase).
I've also used UA detection on a browser bug that would cause fetch requests to fail if the user went offline for a split second inbetween requests. There is no way for me to detect that before the bug happens, and once it happened the "failures" looked like it just never came back online. UA detection was the only tool I had to fix that until it was fixed at the browser level.
- Dylan16807 7y agoUA detection for known bugs is very different from UA detection to enable standardized features.
- deleted 7y ago[deleted]
- nicoburns 7y ago@Klathmon This is also true of your fallback features. They may be implemented incorrectly in an unknown browser too. But it's not reasonable to assume that. You should assume the feature works, unless the UA is on a blacklist.
- danShumway 7y agoYou're still talking about progressive enhancement though. There's a difference between using a user-agent check to find a very specific environment where a bug will occur, and using a user-agent check to determine which of 3 browsers you accept. Used properly, user-agent tests can be a kind of adjacent form of feature detection. Used improperly, and your site is best viewed in IE, even though the user is on a browser that they know will work.