Bug Tracker

Changes between Initial Version and Version 1 of Ticket #11229, comment 1


Ignore:
Timestamp:
Jan 26, 2012, 3:06:44 PM (9 years ago)
Author:
sindresorhus
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11229, comment 1

    initial v1  
     1The default UIWebView UA is the same as Mobile Safari [http://stackoverflow.com/questions/2143763/does-uiwebview-send-the-same-user-agent-in-the-request-headers-as-mobile-safari except the word Safari], which would still match.
     2
    13The problem is that developers are free to [http://stackoverflow.com/questions/8487581/uiwebview-ios5-changing-user-agent 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 [http://www.modernizr.com/ feature testing].