Change History

The problem is that developers are free to change the user-agent to whatever they want, like Facebook has done. The jQuery browser UA regex depends on the webkit version number after AppleWebKit, if it doesn't find that, it goes through the possibilities, until it stops at mozilla. Of course the regex could be split up to first try to match the webkit and then the version number, but this is not sustainable, since that is only true on the Facebook app, other apps might change the user-agent differently. The only real fix, and what people should do anyway, is to not use user-agent and instead use feature testing.

I agree. Feature detection would definitely be your best bet. Since jQuery.browser is deprecated and this is a pretty rare situation, we aren't likely to fix it. Trying to craft a regexp in order to "fix" these situations is always hit or miss.