Created
August 17, 2022 12:38
-
-
Save goellner/a34c78fa9a27be1a7cbad8572c7a574c to your computer and use it in GitHub Desktop.
Trick instagram in-app browser to open in system browser
This file contains hidden or 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
<script type="text/javascript"> | |
// detect instagram in-app browser on android and force a redirect | |
if(navigator.userAgent.includes("Instagram") && navigator.userAgent.includes("Android")){ | |
var socialsRedirectURL = encodeURIComponent(window.location.href); | |
window.location.href = "https://yourdomain.example/socialredirect.php?redirect=" + socialsRedirectURL; | |
} | |
</script> |
I've tested it and it does not work for iOS
Not working for android also, any other solution?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Anyone knows if this works for iOS?