在IOS PWA中默认打开webview中的外部链接

问题描述:

我在IOS 11.3中测试渐进式网络应用程序。

I'm testing Progressive Web App in IOS 11.3.

我的pwa有一个Facebook社交登录按钮,当点击时,指向外部链接(不同的窗口。位置)。

My pwa has a Facebook social login button that, when clicked, points to external link (different windows.location).

问题是pwa打开safari应用程序以显示外部链接,而不是在pwa中使用webview,因此,当登录完成后,你不会被重定向到pwa但仍然在野生动物园。

The problem is that the pwa opens safari app to show external links instead of using a webview within the pwa so, when the login is done, you will not be redirected to pwa but remains in safari.

我尝试过这样的例子 https://gist.github.com/kylebarrow/1042026 但似乎无法正常工作

I tried following examples like this one https://gist.github.com/kylebarrow/1042026 but seems not working

我如何强制pwa打开网页浏览中的外部链接?

How can i force the pwa to open external links in a webview?

提前致谢

使用BUTTON而不是A标签,并设置onclick with window.location.href ='yourUrl'
似乎运作良好

Use BUTTON instead of A tag and set onclick with window.location.href = 'yourUrl' It seems to working well