Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
cordova-plugin-ionic4-crosswalk-webview
Advanced tools
该插件的功能是在cordova ionic4
项目中使用cordova-plugin-crosswalk-webview
浏览器内核。
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
目前只支持cordova-android@8.0.0或以下平台,高于cordova-android@8.0.0将出现启动空白情况
使用了cordova-plugin-crosswalk-webview
作为 cordova 浏览器内核,cordova使用file:///
协议访问app内置的html页面,但由于angular
ionic4
中无法兼容file:///
协议。
因此在ionic4中,ionic官方提供了一个插件cordova-plugin-ionic-webview
,将file:///
协议替换成了http://
协议,以兼容angular
框架,但是该插件调用的android
系统自带的浏览器,且无法同时兼容cordova-plugin-crosswalk-webview
插件。
为了能在ionic4
项目中同时使用cordova-plugin-crosswalk-webview
,可以安装此插件。
使用前需卸载cordova-plugin-ionic-webview
与cordova-plugin-crosswalk-webview
cordova plugin remove cordova-plugin-crosswalk-webview
cordova plugin remove cordova-plugin-ionic-webview
android sdk 24 以下
,使用crosswalk webview
浏览器内核;
android sdk 24及以上
,使用安卓系统内置的高版本浏览器内核。
cordova plugin add cordova-plugin-ionic4-crosswalk-webview --variable WEBVIEW_ENGINE=AUTO
始终使用CrosswalkWebView内核
cordova plugin add cordova-plugin-ionic4-crosswalk-webview --variable WEBVIEW_ENGINE=CROSSWALK
始终使用SystemWebView内核
cordova plugin add cordova-plugin-ionic4-crosswalk-webview --variable WEBVIEW_ENGINE=SYSTEM
在你的cordova
启动页面index.html中写以下脚本
<head>
<script>
// 在加载cordova.js之前调用
if (window.location.href.indexOf("file:") == 0){
window.location.href = "http://localhost";
}
</script>
</head>
//在下次启动APP时使用CrosswalkWebView内核后
Ionic.WebView.useCrosswalkWebViewAtTheNextStartup();
//在下次启动APP时使用SystemkWebView内核
Ionic.WebView.useSystemWebViewAtTheNextStartup();
由于crosswalk编译成了不同架构的apk,因此原来的命令ionic cordova run android --emulator
不再适用,请改用以下命令调试apk
ng run app:ionic-cordova-build --platform=android && cordova run android --emulator
可以使用npm封装命令,在package.json
中
{
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"debug": "ng run app:ionic-cordova-build --platform=android && cordova run android --emulator"
}
}
使用npm命令调试
npm run debug
你可以参考示例
https://github.com/waitaction/cordova-plugin-ionic4-crosswalk-demo
FAQs
Ionic Crosswalk Web View Engine Plugin
The npm package cordova-plugin-ionic4-crosswalk-webview receives a total of 0 weekly downloads. As such, cordova-plugin-ionic4-crosswalk-webview popularity was classified as not popular.
We found that cordova-plugin-ionic4-crosswalk-webview demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.