Update check
This commit is contained in:
parent
8c10812a91
commit
5e98635237
@ -91,9 +91,21 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
var request = navigator.mozApps.getInstalled();
|
var request = navigator.mozApps.getInstalled();
|
||||||
request.onsuccess = function() {
|
request.onsuccess = function() {
|
||||||
|
var update;
|
||||||
|
var selfApp = navigator.mozApps.getSelf();
|
||||||
|
selfApp.onsuccess = function() {
|
||||||
|
if( this.result ) update = true;
|
||||||
|
else update = false;
|
||||||
|
}
|
||||||
|
selfApp.onsuccess = function() {
|
||||||
|
update = false;
|
||||||
|
}
|
||||||
var app = this.result[0];
|
var app = this.result[0];
|
||||||
if( !app && confirm('A new version is available, do you want to update?') ) {
|
if( !app ) {
|
||||||
var ins = navigator.mozApps.install('mdibaiee.github.io/Sketchy/Web/manifest-web.webapp');
|
if( update ) confirm('A new version is available, do you want to update?')
|
||||||
|
else confirm('Do you want to Install this app?');
|
||||||
|
|
||||||
|
var ins = navigator.mozApps.install('http://mdibaiee.github.io/Sketchy/Web/manifest-web.webapp');
|
||||||
ins.onsuccess = function() {
|
ins.onsuccess = function() {
|
||||||
alert('The app was installed successfuly');
|
alert('The app was installed successfuly');
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user