Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nalexiou-loc/e4b714f9d9b8c809a229a3a319a42a05 to your computer and use it in GitHub Desktop.
Save nalexiou-loc/e4b714f9d9b8c809a229a3a319a42a05 to your computer and use it in GitHub Desktop.
facebook browser fix for extjs
var iOS = parseFloat(
('' + (/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent) || [0,''])[1])
.replace('undefined', '3_2').replace('_', '.').replace('_', '')
) || false;
if ( iOS )
{
var userAgent = navigator.userAgent;
navigator.__defineGetter__('userAgent', function(){
if ( iOS )
return userAgent.replace( 'like Gecko) Mobile', 'like Gecko) Version/' + iOS + '.0 Mobile' ) // customized user agent
else
return userAgent;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment