3 ms·
Well, here's one potential reason. I work on a site that involves fancy uses of video and modals and other things. For some reason, a recent update to Firefox
by talmand 13y ago
Well, here's one potential reason.
I work on a site that involves fancy uses of video and modals and other things.
For some reason, a recent update to Firefox broke some of the functionality. Testing shows that it involved Firefox on OSX and Flash video. We are using a HTML5 video with Flash fallback library on the site. Almost all browsers, including Firefox on Windows, use HTML5 video on the site and not Flash.
Therefore, I had to use the user-agent to tell me if they were using Firefox and then see if Flash content is used. If so, I fork the functionality to fix the issue for those people. Everyone else gets the original code.
Not an elegant solution but for that edge case it worked. Without knowing the exact browser then I couldn't fix the problem for those users.
There's also a need to know in terms of analytics what browsers are being used to view your sites so you can know what level of functionality you can reasonably expect from your visitors. That is, until all browsers in use render everything, and behave, exactly the same way.
- derefr 13y agoRather than being sent to the server, it might be okay in the first case if the UA was just exposed through the DOM as a property of the window.renderer; that way, the page, after delivery, could actively decide to apply a shim, but the initial content would be the same for everyone. For the second case, you can at least do JS feature detection and send back the results with AJAX. That seems like the "public API" way of getting to know your users' capabilities, rather than trying to infer them from their UA strings.
- talmand 13y agoUsually I go with feature detection, but in this case I was unable to deduce how to do that. I would require broken feature detection, if I knew what feature was broken, or something along those lines.
- derefr 13y ago> broken feature detection Interesting idea! I can imagine an implementation--every day, along with updating a malware database, each browser pulls down the list of open bugs on its own bug tracker (and upstream component bug trackers) applying to its own version. Then, from Javascript, you could say something like if(window.renderer.hasBug("http://trac.webkit.org/3440224")){ /* you're on a version of WebKit affected by this bug */ } The nice part of this is, to get a globally-unique token identifying a bug you just noticed, you "just" have to file it with the party responsible for fixing it. When the bug is closed, so does your code-branch :)