added support for cordova.js