Force links to open outside facebook's inapp browser

痞子三分冷 提交于 2019-12-22 06:02:01

问题


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!

来源:https://stackoverflow.com/questions/26639644/force-links-to-open-outside-facebooks-inapp-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!