Force link opening in mobile browser and not facebook?

1

When sharing the link of a page on facebook either by messenger or in a post when the user clicks, it will open in the browser of the facebook itself, which in turn is giving some "bizarre" bugs on my page, being that the same in chrome and firefox works perfectly fine, so I would like to know if there is any way to detect and force the link opening on the mobile browser and not on facebook?

This is the code to detect if it is the facebook browser or not

function faceApp() {
    var ua = navigator.userAgent || navigator.vendor || window.opera;
    return (ua.indexOf("FBAN") > -1) || (ua.indexOf("FBAV") > -1);
}

I tried to open the external browser like this and it did not work

navigator.app.loadUrl('http://m.site.com', { openExternal:true });

And I also tested this one, but it also did not work

window.open('http://m.site.com', '_system');
    
asked by anonymous 03.03.2017 / 18:27

1 answer

0

By doing so, you are somehow circumventing the user's permissions because the browser configuration depends entirely on it. This setting is internal within the Facebook app.

What you can do is display a message that behaves better by opening it in chrome and only displaying the content in it, nothing more.

    
03.03.2017 / 19:48