如何在webview中加载网页时启动inappbrowser [英] how to launch inappbrowser when a webpage is loaded in webview

查看:640
本文介绍了如何在webview中加载网页时启动inappbrowser的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过点击index.html页面上的按钮,在worklight 6.2容器(对于android和ios)中启动一个网页。在我的网页中,我使用 window.open(url,_ blank,location = yes)在inappbrowser启动一个外部网站,而不是inappbrowser。我认为这是发生,因为我放弃cordova插件,当网页加载到我的webview。当我写 window.open(url,_ blank,location = yes)我能够在inappbrowser启动外部url。有什么方法有同样的行为从cordova / worklight webview中的网页启动inappbrowser。

I am launching a web page in worklight 6.2 container (for android and ios) by clicking a button on index.html page. In my web page I have used window.open(url,"_blank","location=yes") to launch an external website in inappbrowser, however it launches in the webview instead of inappbrowser. I assume this is happening because I am loosing cordova plugins when ever the webpage is loaded in my webview. When I write window.open(url,"_blank","location=yes") I am able to launch external url in inappbrowser. Is there any way to have same behavior of launching the inappbrowser from a webpage in cordova/worklight webview.

推荐答案

_self:  Opens in the Cordova WebView if the URL is in the white list, otherwise it opens in the InAppBrowser.
_blank: Opens in the InAppBrowser.
_system: Opens in the system's web browser.

使用self而不是空白

use self instead of blank

这篇关于如何在webview中加载网页时启动inappbrowser的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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