UNPKG

cordova-app-loader

Version:

Cordova App Loader - remote update your cordova app

1 lines 673 B
!function(){function e(){o.check().then(function(){return o.download()}).then(function(){return o.update()},function(e){console.error("Auto-update error:",e)})}function t(){document.webkitHidden||e()}var r,o,n,i,d="undefined"!=typeof cordova;if(n=document.querySelector("script[server]"),n&&(i=n.getAttribute("server")),!i)throw new Error('Add a "server" attribute to the bootstrap.js script!');r=new CordovaPromiseFS({persistent:d,Promise:Promise}),o=new CordovaAppLoader({fs:r,localRoot:"app",serverRoot:i,mode:"mirror",cacheBuster:!0}),e(),r.deviceready.then(function(){document.addEventListener("resume",e)}),document.addEventListener("webkitvisibilitychange",t,!1)}();