diff --git a/mailnews/base/prefs/resources/content/pref-notifications.js b/mailnews/base/prefs/resources/content/pref-notifications.js index e2083aec26ed..a970bdef5afa 100644 --- a/mailnews/base/prefs/resources/content/pref-notifications.js +++ b/mailnews/base/prefs/resources/content/pref-notifications.js @@ -1,6 +1,16 @@ function Startup() { PlaySoundCheck(); + + // if we can't get the alert service, hide the pref UI for using alerts to notify on new mail + // see bug #158711 + try { + var alertService = Components.classes["@mozilla.org/alerts-service;1"].getService(Components.interfaces.nsIAlertsService); + } + catch(ex) { + var newMailNotificationAlertUI = document.getElementById("newMailNotificationAlert"); + newMailNotificationAlertUI.setAttribute("hidden","true"); + } } function PlaySoundCheck() diff --git a/xpfe/components/prefwindow/resources/content/pref-download.js b/xpfe/components/prefwindow/resources/content/pref-download.js index e2083aec26ed..a970bdef5afa 100644 --- a/xpfe/components/prefwindow/resources/content/pref-download.js +++ b/xpfe/components/prefwindow/resources/content/pref-download.js @@ -1,6 +1,16 @@ function Startup() { PlaySoundCheck(); + + // if we can't get the alert service, hide the pref UI for using alerts to notify on new mail + // see bug #158711 + try { + var alertService = Components.classes["@mozilla.org/alerts-service;1"].getService(Components.interfaces.nsIAlertsService); + } + catch(ex) { + var newMailNotificationAlertUI = document.getElementById("newMailNotificationAlert"); + newMailNotificationAlertUI.setAttribute("hidden","true"); + } } function PlaySoundCheck()