如何在webview中加载网页时启动inappbrowser

编程入门 行业动态 更新时间:2024-10-26 22:23:27
本文介绍了如何在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

本文发布于:2023-11-27 22:54:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1639944.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:网页时   加载   如何在   inappbrowser   webview

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!