在IOS PWA中默认打开webview中的外部链接 [英] Open external links in webview as default in IOS PWA

查看:196
本文介绍了在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

这篇关于在IOS PWA中默认打开webview中的外部链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆