Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//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