About two years ago (a few months after switching to Mac OSX) I noticed that the badge on the Thunderbird app icon, which notifies about new and how many emails were received, is quite distracting for me when I work. As soon as it pops up I would notice it and felt an urge to immediately check what the new email is about. Then of course, the current focus and concentration is lost.
I wanted to turn the badge of, as this is generally supported on OSX, but found out that this is not the case with Thunderbird. I didn’t give up easily and went to search the Internet. Unfortunately, no one had attempted this, complained about it or filed a bug report. Also, I could not find any documentation about this on the Thunderbird pages.
I wanted to know more and started digging into the source code of Thunderbird. An advantage of open source software. Because this is a Mac OSX specific thing, searching for files related to OSX seemed logical. Eventually, I found a file nsMessengerOSXIntegration.cpp
(it is now nsMessengerOSXIntegration.mm
) where the logic for this functionality is implemented. While I did find an interesting piece of code, the revisions also were helpful, which led me to bug report #274688. In this bug report, a hook was introduced, which allows to observe a property called before-unread-count-display
. Upon notification, the desired badge label can be modified/adjusted (e.g., making 100+ for all counts greater than 100) before it is displayed. If an empty string is returned, however, the badge will be hidden.
And that was it. I digged into it and found an (unfortunately) undocumented extension feature. This allowed to write an extension with the purpose of hiding the badge in all situations. I have actually used it for more than two years. My intention was always to release it and share it with others, but kind of put it off. Since I was updating my other extension anyway, I finally did it.
To my surprise, it was fully reviewed without any complaints right away. So if you want to work without distractions, you can now use Hide Badge Icon to hide the badge of the Thunderbird app icon.