From 4238f1570db4391b7e0f4b70c63a28b0a29c6fa5 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Thu, 26 Apr 2018 10:23:42 +0200 Subject: [PATCH] Bug 1221330 - Show the app icon in the XUL upgraded notifications alert --- application/palemoon/components/nsBrowserGlue.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/application/palemoon/components/nsBrowserGlue.js b/application/palemoon/components/nsBrowserGlue.js index 6bac1d2234..b8de4f00dd 100644 --- a/application/palemoon/components/nsBrowserGlue.js +++ b/application/palemoon/components/nsBrowserGlue.js @@ -1414,7 +1414,10 @@ BrowserGlue.prototype = { let win = RecentWindow.getMostRecentBrowserWindow(); win.openUILinkIn(data, "tab"); } - let imageURL = "chrome://browser/skin/web-notifications-icon.svg"; + // Show the application icon for XUL notifications. We assume system-level + // notifications will include their own icon. + let imageURL = this._hasSystemAlertsService() ? "" : + "chrome://branding/content/about-logo.png"; let title = gBrowserBundle.GetStringFromName("webNotifications.upgradeTitle"); let text = gBrowserBundle.GetStringFromName("webNotifications.upgradeBody"); let url = Services.urlFormatter.formatURLPref("browser.push.warning.infoURL"); @@ -1428,6 +1431,14 @@ BrowserGlue.prototype = { } }, + _hasSystemAlertsService: function() { + try { + return !!Cc["@mozilla.org/system-alerts-service;1"].getService( + Ci.nsIAlertsService); + } catch (e) {} + return false; + }, + _getPersist: function BG__getPersist(aSource, aProperty) { var target = this._dataSource.GetTarget(aSource, aProperty, true); if (target instanceof Ci.nsIRDFLiteral)