Permalink
Browse files

added uninstall

  • Loading branch information...
1 parent 8506d78 commit 8b72de7137d065ec17eb11803ddd437968564019 @ianb committed Apr 23, 2012
Showing with 17 additions and 0 deletions.
  1. +17 −0 index.html
View
@@ -81,6 +81,22 @@
};
});
+ $('#uninstall').click(function () {
+ var pending = navigator.mozApps.getSelf();
+ pending.onsuccess = function () {
+ var uninstall = this.result.uninstall();
+ uninstall.onsuccess = function () {
+ setInstalled();
+ };
+ uninstall.onerror = function () {
+ alert('Error in uninstall: ' + (this.error.name || this.error));
+ };
+ };
+ pending.onerror = function () {
+ alert('Error in getSelf: ' + (this.error.name || this.error));
+ };
+ });
+
});
</script>
@@ -105,6 +121,7 @@
<div>To install or reinstall:
<button type="button" id="install">Install</button>
+ <button type="button" id="uninstall">Uninstall</button>
</div>
<pre id="record"></pre>

0 comments on commit 8b72de7

Please sign in to comment.