PhoneGap-inappbrowser不起作用-需要在应用程序内打开URL [英] PhoneGap - inappbrowser not working - Need to open the URL inside the app

查看:89
本文介绍了PhoneGap-inappbrowser不起作用-需要在应用程序内打开URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有很多与此相关的问题,例如 Phonegap -如何在应用程序内打开外部链接.

There are so many questions related to this like, Phonegap - How to open external link inside the app .

我想在打开应用程序时打开应用程序中的网站URL(不询问需要打开哪个浏览器).

I want to open the website URL inside the app (not asking which browser need to open) when open the app.

但是它询问您需要打开哪个浏览器....我在这里做错了什么? (这在模拟器上工作正常,但是当我将其安装到android手机时,它会询问使用哪种浏览器...)

But it asked which browser you need to open.... What I have done mistake here? (This is working fine on emulator, but when I install it to android phone it asked which browser......)

我的配置文件

<access origin="*" />
<plugin name="cordova-plugin-whitelist" spec="~1.3.2" />
<plugin name="cordova-plugin-inappbrowser" spec="~1.7.2" />

索引文件

<script>
    window.open('http://example.com', '_self', 'location=no,hidden=yes,closebuttoncaption=Done,toolbar=no'); 
</script>

推荐答案

您必须配置白名单插件以允许内部站点的内部导航,您可以使用allow-navigation标记来做到这一点:

You have to configure the whitelist plugin to allow the internal navigation of external sites, you can do it with allow-navigation tag like this:

<allow-navigation href="*" />

这篇关于PhoneGap-inappbrowser不起作用-需要在应用程序内打开URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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