4 ms·
Real question: if user agent sniffing is wrong, what is the proper way of determining whether certain behavior will be buggy in a given browser? Example: every
by wanderr 16y ago
Real question: if user agent sniffing is wrong, what is the proper way of determining whether certain behavior will be buggy in a given browser?
Example: every browser sends mouse events (esp relating to scolling) to plugins differently. We have to check the agent string and react accordingly so the scroll wheel on mice behaves consistently across all browsers. Iceweasel failed and had broken scroll support from us for months because we didn't know they send a completely different user agent string, apparently to discourage sniffing. Ironically that just meant we had to add that agent string to the list.
Is there a better way to handle those issues that doesn't involve sniffing the agent string?
- pornel 16y agoI don't know specifics of the bug you mention. If possible, run a test to check if function behaves correctly (this is good for parsing and CSS bugs, less for user input). If the bug is undetectable via test, but is already fixed in later version of the engine, test for engine and presence of feature added at that time (that's a bit icky too, but at least dependent on behaviour, rather than just name that browser reports). It's not always possible not to sniff, but it's still bad. e.g. what if bug is fixed in later version, but you keep applying workaround? At least if you sniff, don't look for brand (Firefox/Iceweasel), but for engine (Gecko is so nice that it includes build date).