Created
July 21, 2021 13:12
-
-
Save nalexiou-loc/8bd1be4d154bfab8c5510151fd76fd28 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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