Cordova 3.0 InAppBrowser,没有导航栏和按钮标题

标签 cordova inappbrowser

我使用的是 Windows XP,我使用 Cordova/Phonegap 3.0 为 Android 开发。

我已经像这样安装了 InAppBrowser:
- 我在我的项目文件夹中打开了一个命令窗口
- 我做了:

$ cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git
$ cordova plugin rm org.apache.cordova.core.inappbrowser

- 我补充说:
<feature name="InAppBrowser">
<param name="android-package" value="org.apache.cordova.InAppBrowser" />
</feature>

在 app/res/xml/config.xml 中。

第一个问题。如何确定 InAppBrowser 已安装?

我已经在我的 HTML 代码中加入了这个链接:
<a href="#" onclick="window.open('http://www.example.com','_blank','location=yes','closebuttoncaption=back');">open</a>

此链接有效,但我没有地址栏,也没有“返回”按钮。
我错过了什么 ?

谢谢

更新

好吧,我傻了...第二行($cordova plugin rm org.apache.cordova.core.inappbrowser)删除插件...
所以,现在我只使用第一行并且插件安装正确。

但我还是有问题。当我使用:
<a href="#" onclick="window.open('http://www.example.com','_blank','location=yes','closebuttoncaption=back');">open</a>

它工作正常:存在地址栏和按钮(使用“完成”作为标题而不是“返回”)。
但是当我这样做时(位置=否):
<a href="#" onclick="window.open('http://www.example.com','_blank','location=no','closebuttoncaption=back');">open</a>

该链接打开页面但没有按钮。
有什么建议吗?

最佳答案

window.open 方法接受 3 个参数,最后一个是可选的逗号分隔的功能字符串。所以你要:

<a href="#" onclick="window.open('http://www.example.com','_blank','location=no,closebuttoncaption=back');">open</a>

另见 https://github.com/apache/cordova-plugin-inappbrowser .

关于Cordova 3.0 InAppBrowser,没有导航栏和按钮标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18246009/

相关文章:

javascript - 更新 AngularJS 服务中的 $scope 对象不会更新 View

Android Cordova Facebook 错误 "Session was closed and was not closed normally"即使正确的哈希键

android - Phonegap Android InAppBrowser 无法正常工作

iOS/ Cordova : InAppBrowser not working

android - 在 cordova/on android 应用程序中,使用 https 的请求失败但使用 http 的相同请求成功

html - AngularJS - 我可以在 HTML 文件中显示文档吗?

javascript - ../plugins/cordova-plugin-file/www/FileWriter.js 中的无效字符“u0187”

cordova - InAppBrowser header /cookie

javascript - cordova inappbrowser 引用元素

javascript - 显示从 Javascript 应用程序生成的 HTML