阻止(可能是子框架)导航到非允许的URL

时间:2016-04-29 07:38:20

标签: angularjs cordova ionic-framework

我无法从我的应用程序中打开点击的网址到浏览器。

enter image description here

我需要添加什么。

2 个答案:

答案 0 :(得分:5)

我找到了解决方法。将以下行添加到config.xml文件中。

<access origin="http://*" launch-external="yes" />
<access origin="https://*" launch-external="yes" />

这对我有用!!

答案 1 :(得分:0)

@Kumar的答案有效,但是我需要进行一些调整,这些调整对于需要从Ionic调用WhatsApp的人员而言非常有用。您可以像这样允许ALL(但这是非常不安全的):

<access origin="*" launch-external="yes" />

或者您可以允许whatsapp:

<access origin="whatsapp//*" launch-external="yes" />

但是,如果您以“ https”开头,则不会包含“ whatsapp” ...