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/8bd1be4d154bfab8c5510151fd76fd28 to your computer and use it in GitHub Desktop.
Save nalexiou-loc/8bd1be4d154bfab8c5510151fd76fd28 to your computer and use it in GitHub Desktop.
//facebook browser fix
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