Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Add Option to Context Menu

Assuming this on chrome.manifest:

overlay    chrome://messenger/content/mailWindowOverlay.xul     chrome://myext/content/thunderbird-overlay.xul

Add the next in thunderbird-overlay.xul.

For Thunderbird 2

 

  <?xml version="1.0"?>
  <overlay id="sample" 
         xmlns="https://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  <menupopup id="messagePaneContext">       
      <menuitem 
        id="my_option"          
        label="My option concise and cool label"          
        oncommand="alert('Hi')"/>   
    </menupopup>
  </overlay>

For Thunderbird 3

  <?xml version="1.0"?>
  <overlay id="sample" 
         xmlns="https://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
      <popup id="mailContext">
       <menuitem 
        id="my_option" 
        label="My option concise and cool label" 
        oncommand="alert('Hi')"/>
    </popup>
</overlay>

For Thunderbird 2 and 3 in the same XPI

If our extension needs to support Thunderbird 2 and 3 we need to make custom overlays for each version. This can be reached by adding these lines to the chrome.manifest file:

overlay chrome://messenger/content/mailWindowOverlay.xul chrome://myaddon/content/tbOverlay-tb2.xul appversion<3.0
overlay chrome://messenger/content/mailWindowOverlay.xul chrome://myaddon/content/tbOverlay-tb3.xul appversion=>3.0

Than we need two overlay XUL files with content from examples above.

Note: If our extension supports more Mozilla applications (for example Mozilla Firefox and Mozilla Thunderbird) we need also specify application flag. For more details see Chrome Registration.

Document Tags and Contributors

 Contributors to this page: wbamberg, poohsen, takeoyasha, Ondrejd, jllogan
 Last updated by: wbamberg,