Force links to open outside facebook's inapp b

2019-05-04 15:24发布

Facebook updated it's mobile app and created an in-app browser and as they say it's more faster. The problem is that any link of any page opens inside this browser.

I tried a lot of combinations without luck... Some examples are bellow.

Did anyone knows more about it and how to forece links to open on external browsers?

<script>
function externalLinks() {
  for(var c = document.getElementsByTagName("a"), a = 0;a < c.length;a++) {
    var b = c[a];
    b.getAttribute("href") && b.hostname !== location.hostname && (b.target = "_blank")
  }
}
;

</script>
<a href="http://www.google.com" onClick="externalLinks();">External Link</a>

Other Way:

<a href="http://www.google.com" target="_blank" style="target-new: tab;">Google</a>

Thank you all!

0条回答
登录 后发表回答