Force link opening in mobile browser and not on facebook?

Asked

Viewed 1,255 times

0

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

This is the code to detect whether 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 didn’t work

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

And I also tested this one, but it didn’t work either

window.open('http://m.site.com', '_system');
  • It is possible. UOL does it. I also want to find out how. Facebook Browser gives some bugs in my Jquery codes.

1 answer

0


By doing this you are in a way circumventing the permissions of the user because the configuration of the browser depends exclusively on it. This setting is internal within the Facebook app.

What you can do is display a message that behaves best by opening on Chrome and only display the content on it, nothing more.

  • I already have a message warning about the browsing experience in the browser, but I would like to be able to direct redirect to the browser, as I know it is possible to open apps through links I thought it was possible to do this too

  • But in such cases, you’ll have to work with Dynamic Links and work the app to "listen" to that link. Which is not the case as you will not be able to modify the browser

  • I’ll keep the warning so, if it was possible to at least create a button for it, I think it’s a little constrictive to open the link and ask it to open through the browser.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.