简体   繁体   English

科尔多瓦的Crosswalk InAppBrowser

[英]Crosswalk InAppBrowser in Cordova

I am struggling with opening the website inside the Cordova app using the Crosswalk engine. 我正在努力使用Crosswalk引擎在Cordova应用程序内部打开网站。 The default InAppBrowser is rendering the page inproperly, because it uses native WebView(which works bad on older phones like Android 4.3). 默认的InAppBrowser无法正确渲染页面,因为它使用的是本机WebView(在Android 4.3等较旧的手机上效果不佳)。 I am trying to use the cordova-plugin-crosswalk-webview and while it seems to render the cordova view with Crosswalk(the navigator.userAgent says so), when I call either window.open or cordova.InAppBrowser (after installing cordova-plugin-inappbrowser ) it uses the native WebView. 我正在尝试使用cordova-plugin-crosswalk-webview ,尽管它似乎使用Crosswalk渲染了cordova视图( navigator.userAgent如此表示),但是当我调用window.opencordova.InAppBrowser (安装cordova-plugin-inappbrowser ),它使用本机WebView。

Is there something special I have to do to make it render that way ? 我需要做些特殊的事情才能使它呈现这种方式吗? I also tried this package github , but it seems to not be able to allow executing scripts in the inner browser and I need some sort of communication between the Cordova app and the browser page. 我也尝试了这个github包,但是它似乎无法允许在内部浏览器中执行脚本,并且我需要在Cordova应用程序和浏览器页面之间进行某种形式的通信。 Maybe there is some other way for making this communication work(the intention is to be able to show barcode scanner when clicking on the button). 也许还有其他方法可以使这种通信正常进行(目的是当单击按钮时能够显示条形码扫描仪)。

Do you have any idea how to solve this issue ? 您有解决该问题的想法吗? Big thanks ! 太谢谢了 !

Try using this: 尝试使用此:

//config.xml
<allow-navigation href="http://cordova.apache.org/*" />

//code
window.open('http://cordova.apache.org/', '_self');

https://issues.apache.org/jira/browse/CB-9573 https://issues.apache.org/jira/browse/CB-9573

Open a website in crosswalk webview 在人行横道网络视图中打开网站

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM