【发布时间】:2015-10-11 02:03:41
【问题描述】:
这是我第一次使用 phonegap 构建,我无法在我的应用程序中打开外部链接。我正在使用 jquery mobile 和 phonegap build 来发布一个 android 应用程序。在更新到 cli-5.2.0 之前,我可以使用以下代码打开应用程序内的外部链接
window.open('http://www.google.com','_self',false);
但是,在 cli-5.2.0 更新后,任何外部链接现在只能在 Chrome 或应用内浏览器中打开。有没有办法在应用内打开外部链接?
这是我的 config.xml 文件以防万一
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.test.chat" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:gap="http://phonegap.com/ns/1.0">
<name>Test 3.0</name>
<description>Test App</description>
<author email="dev@cordova.apache.org" href="http://cordova.io">Author
</author>
<platform name="android">
<allow-intent href="market:*" />
</platform>
<preference name="phonegap-version" value="cli-5.2.0" />
<content src="index.html" />
<gap:plugin name="cordova-plugin-whitelist" source="npm" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<preference name="permissions" value="none"/>
<preference name="orientation" value="portrait"/>
<preference name="target-device" value="universal"/>
<gap:plugin name="org.apache.cordova.splashscreen" source="npm"/>
<!--<gap:plugin name="org.apache.cordova.inappbrowser" source="npm"/>-->
<feature name="http://api.phonegap.com/1.0/geolocation"/>
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="5000" />
<preference name="fullscreen" value="true" />-->
<gap:splash gap:platform="android" gap:qualifier="port-ldpi" src="res/drawable-port-ldpi/screen.png" />
<gap:splash gap:platform="android" gap:qualifier="port-mdpi" src="res/drawable-port-mdpi/screen.png" />
<gap:splash gap:platform="android" gap:qualifier="port-hdpi" src="res/drawable-port-hdpi/screen.png" />
<gap:splash gap:platform="android" gap:qualifier="port-xhdpi" src="res/drawable-port-xhdpi/screen.png" />
<gap:splash gap:platform="android" gap:qualifier="port-xxhdpi" src="res/drawable-port-xxhdpi/screen.png" />
<gap:splash gap:platform="android" gap:qualifier="port-xxxhdpi" src="res/drawable-port-xxxhdpi/screen.png" />
<gap:splash src="splash.png"/>
<icon src="icon.png" />
<icon src="res/drawable-port-ldpi/ldpi.png" gap:platform="android" gap:qualifier="ldpi" />
<icon src="res/drawable-port-mdpi/mdpi.png" gap:platform="android" gap:qualifier="mdpi" />
<icon src="res/drawable-port-hdpi/hdpi.png" gap:platform="android" gap:qualifier="hdpi" />
<icon src="res/drawable-port-xhdpi/xhdpi.png" gap:platform="android" gap:qualifier="xhdpi" />
<icon src="res/drawable-port-xxhdpi/xxhdpi.png" gap:platform="android" gap:qualifier="xxhdpi" />
<icon src="res/drawable-port-xxxhdpi/xxxhdpi.png" gap:platform="android" gap:qualifier="fr-xxhdpi" />
</widget>
【问题讨论】:
标签: android jquery-mobile phonegap-build