How to open link in external browser instead of in-app (instagram)?
You can add this script to head to redirect to chrome:
<script>
var userAgent = navigator.userAgent || navigator.vendor || window.opera;
var str = navigator.userAgent;
var instagram = str.indexOf("Instagram");
var facebook = str.indexOf("FB");
if (/android/i.test(userAgent) && (instagram != -1 || facebook != -1) ) {
document.write("<a target=\"_blank\" href=\"https://yourdomain.com\" download id=\"open-browser-url\">Please wait. Proceed to Chrome</a>");
window.stop();
let input = document.getElementById('open-browser-url');
if (input) {
input.click();
}
}
</script>
Comments
Post a Comment