Home

Awesome

cordova-plugin-crosswalk-webview

Makes your Cordova application use the Crosswalk WebView instead of the System WebView. Requires cordova-android 4.0 or greater.

Benefits

Drawbacks

Install

The following directions are for cordova-cli (most people). Alternatively you can use the Android platform scripts workflow.

$ cordova plugin add cordova-plugin-crosswalk-webview
$ cordova build android

The build script will automatically fetch the Crosswalk WebView libraries from Crosswalk project download site (https://download.01.org/crosswalk/releases/crosswalk/android/maven2/) and build for both X86 and ARM architectures.

For example, building android with Crosswalk generates:

/path/to/hello/platforms/android/build/outputs/apk/hello-x86-debug.apk
/path/to/hello/platforms/android/build/outputs/apk/hello-armv7-debug.apk

Note that you might have to run cordova clean before building, if you previously built the app without cordova-plugin-crosswalk-webview. Also, manually uninstall the app from the device/emulator before attempting to install the crosswalk-enabled version.

Also note that it is also possible to publish a multi-APK application on the Play Store that uses Crosswalk for Pre-L devices, and the (updatable) system webview for L+:

To build Crosswalk-enabled apks, add this plugin and run:

$ cordova build --release

To build System-webview apk, remove this plugin and run:

$ cordova build --release -- --minSdkVersion=21

Configure

You can try out a different Crosswalk version by specifying certain variables while installing the plugin, or by changing the value of xwalkVersion in your config.xml after installing the plugin. Some examples:

<!-- These are all equivalent -->
cordova plugin add cordova-plugin-crosswalk-webview --variable XWALK_VERSION="org.xwalk:xwalk_core_library:14+"
cordova plugin add cordova-plugin-crosswalk-webview --variable XWALK_VERSION="xwalk_core_library:14+"
cordova plugin add cordova-plugin-crosswalk-webview --variable XWALK_VERSION="14+"
cordova plugin add cordova-plugin-crosswalk-webview --variable XWALK_VERSION="14"
<preference name="xwalkVersion" value="org.xwalk:xwalk_core_library:14+" />
<preference name="xwalkVersion" value="xwalk_core_library:14+" />
<preference name="xwalkVersion" value="14+" />
<preference name="xwalkVersion" value="14" />

You can also use a Crosswalk beta version. Some examples:

<!-- These are all equivalent -->
cordova plugin add cordova-plugin-crosswalk-webview --variable XWALK_VERSION="org.xwalk:xwalk_core_library_beta:14+"
<preference name="xwalkVersion" value="org.xwalk:xwalk_core_library_beta:14+" />

You can set command-line flags as well:

<!-- This is the default -->
cordova plugin add cordova-plugin-crosswalk-webview --variable XWALK_COMMANDLINE="--disable-pull-to-refresh-effect"
<preference name="xwalkCommandLine" value="--disable-pull-to-refresh-effect" />

You can use the Crosswalk shared mode which allows multiple Crosswalk applications to share one Crosswalk runtime downloaded from the Play Store.

<!-- These are all equivalent -->
cordova plugin add cordova-plugin-crosswalk-webview  --variable XWALK_MODE="shared"
<preference name="xwalkMode" value="shared" />

You can also use a Crosswalk beta version on shared mode, e.g.:

<!-- Using a Crosswalk shared mode beta version -->
cordova plugin add cordova-plugin-crosswalk-webview --variable XWALK_VERSION="org.xwalk:xwalk_shared_library_beta:14+"

You can use the Crosswalk lite mode which is the Crosswalk runtime designed to be as small as possible by removing less common libraries and features and compressing the APK.

<!-- These are all equivalent -->
cordova plugin add cordova-plugin-crosswalk-webview  --variable XWALK_MODE="lite"
<preference name="xwalkMode" value="lite" />

You can set background color with the preference of BackgroundColor.

<!-- Set red background color -->
<preference name="BackgroundColor" value="0xFFFF0000" />

You can also set user agent with the preference of xwalkUserAgent.

<preference name="xwalkUserAgent" value="customer UA" />

Release Notes

2.4.0 (January 18, 2018)

2.3.0 (January 21, 2017)

2.2.0 (November 4, 2016)

2.1.0 (September 9, 2016)

2.0.0 (August 17, 2016)

1.8.0 (June 30, 2016)

1.7.0 (May 4, 2016)

1.6.0 (March 11, 2016)

1.5.0 (January 18, 2016)

1.4.0 (November 5, 2015)

1.3.0 (August 28, 2015)

1.2.0 (April 22, 2015)

1.1.0 (April 21, 2015)

1.0.0 (Mar 25, 2015)