3 ms·
UA parsing is considered bad design and trusting UA's is unwise. What exactly necessitates UA parsing to detect ipadOS, instead of other guaranteed detection m
by phillipseamore 7y ago
UA parsing is considered bad design and trusting UA's is unwise. What exactly necessitates UA parsing to detect ipadOS, instead of other guaranteed detection mechanisms, like CSS feature queries and checking if methods are available in JS and others? Also keep in mind that even if you trust the UA string it is not representative for all users. Most (if not all) browsers allow users to toggle features, change flags and more. That includes Safari on all OS's.
- getpolarized 7y agoCSS feature queries and these other strategies are also hacks to determine the actual device being used. Most other UAs don't just flat out lie about the CPU and platform.
- phillipseamore 7y agoThey are by no means hacks, they are guaranteed and standardized! You shouldn't care about the device. You care if it supports certain features or APIs you want to utilize.
- campfireveteran 7y agoThere ought to be a standard "caniuse" features discovery API rather than parsing UA's or oodles of platform quirks/detection "magic."