Force iOS Facebook application for opening channel links in a browser not in WebView

(Before doing downvoting / flagging, please note that there are already similar questions, but none of them work with simple javascript)

Whenever a link to Facebook-Feed is clicked on an iOS device (only via the facebook application), it will open in WebView, and not in a new browser window (for example, on Android).

When this happens, the web application that is about to open will break, so I need to somehow trick iOS and make it open the link in the standard users browser (where the web application works flawlessly).

If this is possible only at the touch of a button, it is also not difficult. But from what I tried, everything opened in a WebView, and I just could not get it to open it in a browser.

I saw a couple of ObjectiveC solutions that I certainly cannot use in a web application. So I would like to stick with JS / HTML (or PHP, but I don't think it will be very useful)

What does not work:

<a href="http://google.com" target="_blank">My Link Text</a>

A normal link with a target attribute will not do the trick. Instead, the link will open in WebView.

window.open('http://google.com');

window.openwon't work either (of course, I bound it to an event handler). It seems that the webview will not respond window.open()in any way.

So, is there anyone here who has a solution? I hope not some strange iOS landmark.

+4
1

Facebook. iOS, URL- (, Safari -). Facebook URL- -,

+2

Source: https://habr.com/ru/post/1534887/


All Articles