If you would like to trigger the “deviceready” event fires when Cordova is fully loaded for some plugin usage,
document.addEventListener("deviceready", callbackFunction, false);
you need to include cordova.js in your application.
OK, you are done.
If you facing some unknown error in console as below even you have whitelist plugin added, cordova.js included,
Uncaught Error: Module cordova-plugin-whitelist.whitelist does not exist. cordova.js:891 deviceready has not fired after 5 seconds. cordova.js:884 Channel not fired: onPluginsReady cordova.js:884 Channel not fired: onCordovaReady
then probably you include cordova.js wrongly as what I did (get from /platforms/android/assets/www/cordova.js)
NOTE: You does not need to copy cordova.js from anywhere, just include as above mention will do, Cordova will figure out for u 🙂