instead of "frowned upon", why not explain it a bit more something like, "Most of the time you can avoid UA sniffing by using feature test/inference. Sniffing is used for things that have no known FT, like visual bugs or bfcache bugs. A bad feature inference can cause as many problems as a sniff for example MooTools recently dealt with the document.getBoxObjectFor issue.
What's the reason for such misleading change? Camino, Seamonkey, Flock, Fennec, and even Netscape Navigator (on my mac) now all report themselves as "firefox".
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
why not name it gecko, for browsers like camino ? and instead of safari, webkit (so chrome would be included)
Sorry, something went wrong.
Feature testing is nice for some things, but I've yet to see something to help detect things like CSS selectors.
For example, I know IE doesn't support :nth-child, so I use $.browser.msie and use Sizzle to apply the class/css rules instead of having to make specific IE hacks, or add extra classes etc. Same thing goes for IE6 :hover support, I just add it via Sizzle.
How could I do those things if browser sniffing was removed?
I'd say if you're addressing the browser object, it's the right time to throw in webkit, so we can pick up Chrome without being totally confusing.
Along with that, gecko seems far more appropriate.
I am shocked you (a Mozilla employee) are marginalizing Camino :-)
Full disclosure: I'm guilty of doing this as well in the MooTools 2.0 branch, and I'll probably fix it.
My, my, my! This commit is getting attention.
We were discussing this and right now (in 1.3.2) jQuery.browser is a mixture of browser rendering engine versions and browser versions, along with a mixture of browser names and engine names. The previous commit gets us closer to at least some form of parity (everything is browser version and the names are all browsers). Granted there will still be a bit of weirdness (non-Firefox browsers matching Firefox) but that's another issue entirely. We /could/ go through and add in a new jQuery.engine.version/jQuery.engine.* (engine names) but that's another endeavor and, at this point, we really shouldn't be trying to add more engine/browser detection code - as it stands the previous commit was strictly fixing 3 bugs.
As far as the deprecated verbiage goes we've already discussed this extensively in the documentation page itself:
We had it marked as deprecated, but that's not true as we can't in good conscience remove jQuery.browser without breaking a number of jQuery plugins. We're continuing to actively encourage people to use feature detection and move away from jQuery.browser.
I'll follow-up to resolve the Firefox/Mozilla issue.
Tried to provide a little more clarity here: 9d8bd16
The previous commit that I mentioned is here: d3dc2d1
And just to be clear: I'd much rather have a list of rendering engines and the version be the rendering engine. Unfortunately we sort of have the options that we now (likely because of the poor name choice used in jQuery.browser) and should just continue to encourage people to move away from jQuery.browser to something smarter.