how to launch inappbrowser when a webpage is loaded in webview

穿精又带淫゛_ 提交于 2019-12-25 01:13:03

问题


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.


回答1:


_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.

use self instead of blank



来源:https://stackoverflow.com/questions/25373600/how-to-launch-inappbrowser-when-a-webpage-is-loaded-in-webview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!