4 ms·
This is the correct answer. Allow 3rd party analytics or whatever to do as they choose, but your javascript should pretty much never believe a UA string. `if (
by andirk 4y ago
This is the correct answer. Allow 3rd party analytics or whatever to do as they choose, but your javascript should pretty much never believe a UA string.
`if (someFeature && someFeature.someSpecificMethod)...`
Or you can try/catch if you are less sympathetic to inferior tech.
- Macha 4y agoThis would be sufficient if features were a yes/no binary of supported or not, but sometimes browsers implement features but get them wrong, or incompletely.
- Xelynega 4y agoThen the features aren't supported in the browser and you should file a bug report to the vendor. Having the developers that use a tool work around the bugs in that tool is a recipe for having millions of repeated lines of code that don't actually solve the problem upstream.