From 641cc29fa2fac9e616d2562e6c1a72089a78928a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrice=20Desr=C3=A9?= Date: Mon, 11 Jul 2011 01:59:33 -0700 Subject: [PATCH] Bug 596649 - Check if a web app is installed to not install dupes [r=mfinkle] --- mobile/chrome/content/common-ui.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mobile/chrome/content/common-ui.js b/mobile/chrome/content/common-ui.js index c6bae4c9f894..1b3af303f30e 100644 --- a/mobile/chrome/content/common-ui.js +++ b/mobile/chrome/content/common-ui.js @@ -1753,7 +1753,13 @@ var WebappsUI = { }, updateWebappsInstall: function updateWebappsInstall(aNode) { - return !document.getElementById("main-window").hasAttribute("webapp"); + if (document.getElementById("main-window").hasAttribute("webapp")) + return false; + + let browser = Browser.selectedBrowser; + + let webapp = Cc["@mozilla.org/webapps/support;1"].getService(Ci.nsIWebappsSupport); + return !(webapp && webapp.isApplicationInstalled(browser.currentURI.spec)); }, install: function(aURI, aTitle, aIcon) {