MozillaZine

Mute/disable all the error notifications

User Help for Mozilla Thunderbird
richiehustle
 
Posts: 13
Joined: April 5th, 2017, 2:15 am

Post Posted June 6th, 2018, 8:24 pm

Is there a way to suppress all modal dialogs that originate from thunderbird,
like SMTP error notifications etc.
They're really irritating and prevent following outbox messages to be sent, because when dialog box appears it stops other mail from being sent until you click okay.

Thanks

tanstaafl
Moderator

User avatar
 
Posts: 44124
Joined: July 30th, 2003, 5:06 pm

Post Posted June 6th, 2018, 9:05 pm

Not that I'm aware of.

morat
 
Posts: 2748
Joined: February 3rd, 2009, 6:29 pm

Post Posted June 7th, 2018, 5:43 am

You would need to rebuild the application to suppress the alerts.

Similar thread: viewtopic.php?f=39&t=3037820

I guess a developer could automatically close the alerts after a few seconds with the userChrome.js file.

richiehustle
 
Posts: 13
Joined: April 5th, 2017, 2:15 am

Post Posted June 7th, 2018, 6:30 pm

Any idea how to accomplish that with .js plugin?

morat
 
Posts: 2748
Joined: February 3rd, 2009, 6:29 pm

Post Posted June 8th, 2018, 6:01 am

*** for advanced users only ***

There are multiple types of alerts.

Example 1...

window url: chrome://global/content/alerts/alert.xul
window title: Thunderbird
window description: Failed to connect to server imap.googlemail.com.

Example 2...

window url: chrome://global/content/commonDialog.xul
window title: Send Message Error
window description:

Sending of the message failed.
An error occurred while sending mail: Outgoing server (SMTP) smtp.googlemail.com is unknown. The server may be incorrectly configured. Please verify that your Outgoing server (SMTP) settings are correct and try again.

I got the second type of alert to automatically close after 5 seconds with the following code. I tested it using the error console.

Code: Select all
/* Thunderbird userChrome.js */

(function () {

  if (location == "chrome://messenger/content/messenger.xul") {

    var observer = {
      id: "userChromeJS_observer_1",
      get wrappedJSObject() {
        return this;
      },
      observe: function onOpen(subject, topic, data) {
        // console.log("subject: " + subject);
        // console.log("topic: " + topic);
        // console.log("data: " + data);
        // console.log("uri: " + subject.document.documentURI);
        if (topic == "domwindowopened" &&
            subject instanceof Components.interfaces.nsIDOMWindow) {
          subject.addEventListener("DOMContentLoaded", function onLoad() {
            subject.removeEventListener("DOMContentLoaded", onLoad, false);
            if (subject.document.documentURI == "chrome://global/content/commonDialog.xul") {
              // Services.ww.unregisterNotification(observer);
              // Services.wm.getMostRecentWindow("mail:3pane").inspectObject(subject); // DOM Inspector
              // console.log("uri: " + subject.document.documentURI);
              subject.setTimeout(function () { subject.close(); }, 5000);
            }
          }, false);
        }
      },
    };
    var initialized = false;
    var enumerator = Services.obs.enumerateObservers("domwindowopened");
    while (enumerator.hasMoreElements()) {
      var element = enumerator.getNext();
      if ("wrappedJSObject" in element && element.wrappedJSObject &&
          element.wrappedJSObject.id == observer.id) {
        initialized = true;
        break;
      }
    }
    if (initialized == false) {
      Services.ww.registerNotification(observer);
    }

  }

})();

I got a test dialog similar to the "Send Message Error" dialog to open in the 3pane window with the following code.

Code: Select all
Services.prompt.alert(window, "title", "description");

Similar thread: viewtopic.php?f=38&t=3011729

richiehustle
 
Posts: 13
Joined: April 5th, 2017, 2:15 am

Post Posted June 10th, 2018, 8:54 pm

how to use it within Thunderbird afterwards, and what compilator to use to paste code in?

morat
 
Posts: 2748
Joined: February 3rd, 2009, 6:29 pm

Post Posted June 11th, 2018, 3:40 am

Instructions:

* install userChromeJS extension
* close email client
* create or edit the userChrome.js file in the chrome folder
* open email client with the -purgecaches command line option

i.e.

thunderbird.exe -purgecaches
ThunderbirdPortable.exe -purgecaches

You have to purge the javascript caches only after creating or editing the userChrome.js file.

http://userchromejs.mozdev.org/
http://userchromejs.mozdev.org/faq.html

Also, I believe userChromeJS 2.0 has a bug in Thunderbird 57 and above.

More info: viewtopic.php?p=14783122#p14783122

Return to Thunderbird Support


Who is online

Users browsing this forum: No registered users and 2 guests