xulthunderbirdthunderbird-addon

Thunderbird extension: add button in message reader toolbar


I'm trying to add a button in the message reader toolbar :

I successfully added a button in the mail toolbar, using the chrome.manifest and XUL files. I just don't know how to access this particular toolbar. I have tried finiding it using the DOM Inspector, to no avail. My button doesn't appear in the "Customize" box either.

My question is therefore: how can I add a button to this particular toolbar?


Solution

  • After looking some more with the DOM Inspector I finally got it.

    The toolbar and toolbox ids are header-view-toolbar and header-view toolbox and the classes are inline-toolbar and inline-toolbox. The CSS class for buttons is msgHeaderView-button. The XUL for adding a button there should look like this:

    <toolbarpalette id="header-view-toolbar">
      <toolbarbutton id="my-button"/>
    </toolbarpalette>
    
    <toolbarbutton id="my-button"
      label="This is my button!"
      tooltiptext="Click on it!"
      oncommand="MyButton[1]()"
      class="toolbarbutton-1 msgHeaderView-button my-button"
    />