Gerry
Gerry

Reputation: 1246

Adding a toolbar button to a Thundebird Compose Message window

Anyone had any luck adding a custom toolbar button to the Compose window of Thunderbird or know of an example plugin that does it? I'm new to Thunderbird development and haven't had any luck getting https://developer.mozilla.org/en/Custom_Toolbar_Button to work for the Compose window.

Upvotes: 2

Views: 2542

Answers (2)

bgmCoder
bgmCoder

Reputation: 6370

What Mr. Jonathan pointed out is a good tip, and that particular extension does have an example of what you are looking for.

Open up your own chrome manifest file and make sure your code is telling Thunderbird which of your own xul files to "align" with its own xul files. In these examples, we will assume that your xul file is named overlay.xul and it has the code for both the button in the toolbar, as well as anything you want to do in the message-compose window.

If you find that your button won't show in the "customize toolbar" dialogue, it is because the xul is mismatched in your chrome manifest.

Make sure this in your chrome.manifest:

#THIS will use your xul file for the message-composing window
overlay chrome://messenger/content/messengercompose/messengercompose.xul chrome://youraddon/content/overlay.xul

#If you want a button, too, make sure this is in your file, too.
overlay chrome://global/content/customizeToolbar.xul chrome://youraddon/content/overlay.xul

Upvotes: 3

Jonathan Protzenko
Jonathan Protzenko

Reputation: 1739

You should look at the code of addons that perform (succesfully) a similar task, e.g. https://addons.mozilla.org/en-US/thunderbird/addon/latex-it/. In particular, look at the chrome.manifest file and the overlay.css and overlay.xul files.

Please keep in mind that the toolbar button will not appear by default, you'll first have to right-click on the toolbar then hit "customize".

Upvotes: 1

Related Questions