Bug 596649 - Check if a web app is installed to not install dupes [r=mfinkle]

This commit is contained in:
Fabrice Desré 2011-07-11 01:59:33 -07:00
parent 023b86a7ec
commit 641cc29fa2

View File

@ -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) {