Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Custom Header Pane Button

Posted on 2011-02-19
Medium Priority
Last Modified: 2012-05-11
Hi! I'd like to add a button to the header pane / message preview pane window in Thunderbird. I'd like it to move the selected message to a pre-defined IMAP folder.

I've done some research on this, but first of all my button code doesn't work, and secondly, I cannot find any information on how to add a button to the preview pane toolbar, only to the main toolbar.

The toolbar I mean is the one where you have the Reply / Forward / Archive / Junk / Delete buttons when a message is selected (the message preview pane below the thread pane).

This is the JS code I tried that didn't work:
CustomButton = {

1: function () {


Open in new window

I tested this using the guide here:

Any help with this would be much appreciated.

Question by:Julian Matz
  • 4
  • 3
LVL 20

Accepted Solution

ElrondCT earned 2000 total points
ID: 34962145
I'm not an expert on this, but I just went through the instructions on the page you noted, and was able to get my button to work (though I'm using a POP3, rather than IMAP, email account). So I'd be happy to try to work with you to troubleshoot.

First off, if you use as your JS code their sample of:

alert("Just testing")      

do you get an alert box displaying on your screen? If not, the most likely scenario is that you're missing one of the files needed to get the button in place. Check their profile directory listing, and make sure you have all the files, named properly and in the correct folders.

Figuring out how to get a button into the toolbar for the message (preview) pane wasn't easy (the problem was figuring out what the palette is called, and I couldn't find a general listing), but I found the trick. In your button.xul file, include the following code:  
<!-- Thunderbird message -->
<toolbarpalette id="header-view-toolbar-palette">
  <toolbarbutton id="custom-button-1"/>

Open in new window

Note that it's the same as the other toolbar references that you already have, just changing the toolbarpalette ID. If you change the name of your button from custom-button-1, alter the code given accordingly.
LVL 21

Author Comment

by:Julian Matz
ID: 34963715
Yes, I managed to get the alert('testing') test working, and I also managed to create a "check for updates" test button. The only thing I failed on was the msgMoveMessage function (and getting the button into the right toolbar).

However, I did afterwards manage to get the default "Junk" button to do what I wanted.

That siad, I'm always looking for ways to make my life (I mean work) easier, so, I appreciate you finding this for me. I couldn't find the toolbar palette ID anywhere. I tested it and it worked - my test button showed up in the correct toolbar.

Perhaps the function doesn't exist in this context. Does Javascript have a method for testing if a function exists?
LVL 20

Assisted Solution

ElrondCT earned 2000 total points
ID: 34964871
Hmm, mine's not working either. It displays correctly on the main toolbar, a bit differently on the message pane, and nothing happens when I click either one.

With more poking around, I found part of the issue. We need a second function to do an internal conversion:


It's still not doing anything when I click on it in the message pane. When I click on it on the main toolbar, though, I get a message: "The folder Test is full, and can't hold any more messages. To make room for more messages, delete any old or unwanted mail and compact the folder." This is spurious; I originally had no messages at all in the folder, and then copied a single small message. (Just to make sure, I did a Compact, which made no difference.)

I'll try to research this more, but thought I'd post what I have so you can look into it as well.
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

LVL 21

Author Comment

by:Julian Matz
ID: 34965739
That's interesting. So, are you saying that the selected message moved for you when you pressed the main toolbar button but gave an error, or do you mean it didn't work at all and you just manually copied a message to the target folder for testing?

Sure, I'll test it myself too and see what I get. Thanks!
LVL 20

Expert Comment

ID: 34966554
From the main toolbar, I got the error message. I tried separately copying a message over, then trying again, just to make sure it wasn't an issue of not having a message in the folder. From the message pane, I got no response when I clicked.
LVL 21

Author Comment

by:Julian Matz
ID: 35003178
Strange. Well, for now, my work-around is to use the default Junk button, which seems to be working fine. My other issue is that the Move to "FOLDER NAME" Again option in the context menu is disabled (greyed out). I'm not sure why, but apparently it's something that's supposed to be fixed in the next release. Not sure if the two things are related, but I'll keep testing and will update here. In the meantime, I will close this. At least now I know how to add a button to the header pane.

I appreciate your help.
LVL 20

Expert Comment

ID: 35003645
Sorry I couldn't get it all resolved, but I'm glad I at least helped somewhat. It was an interesting question.

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Often, the users face difficulty in accessing Outlook 2016 PST files on Windows 10 computer. One of the reasons behind it is the improper functioning of MS Outlook when the user tries to open it. MS Outlook suddenly stops working, or it will not op…
Why WooCommerce is one of the majorly favored choices when it comes to having an eCommerce store. This article will acquaint you with some reasons that I believe make it one of the best eCommerce platforms available.
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

569 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question