Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7766693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:29:11+00:00 2026-06-01T15:29:11+00:00

We have developed a Thunderbird (11) plugin that allows us to save the content

  • 0

We have developed a Thunderbird (11) plugin that allows us to save the content of a message to disk. Now we are extending this extension to allow automatic processing of a message when you close it. We run into a number of issues:

We cannot find a way to hook into a ‘close tab’ event. We are also having trouble getting the Message URI of the currently open tabs (we are trying catching click and keyboard events now). This information does not appear to be available in the DOM of the tab container.

Is there a way to detect closing of a mail message tab or window in a generic way, together with retrieving the URI of the closed mail message for further processing?

We have looked at the documentation of the tab container, the NsIWindowMediator, tried various event listeners, but no luck so far.

Edit: We are getting some results using the most recently closed tabs list. Not a very elegant solution but at least we have a reference to the tab. Now we only have to get the URI to the message that was contained inside the tab.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T15:29:13+00:00Added an answer on June 1, 2026 at 3:29 pm

    We cannot find a way to hook into a ‘close tab’ event.

    The (badly documented) <tabmail> element allows registering tab monitors. Something like this should work:

    var tabmail = document.getElementById("tabmail");
    var monitor = {
      onTabClosing: function(tab)
      {
        ...
      }
    };
    tabmail.registerTabMonitor(monitor);
    

    We are also having trouble getting the Message URI of the currently open tabs

    The <tabmail> element has a property tabInfo containing information on the currently open tabs. You probably want to look only at the tabs where mode.name is "message" (there is a bunch of other modes as well, e.g. "folder" or "contentTab"). This mode has a getBrowser() method, so something like this should do:

    var tabmail = document.getElementById("tabmail");
    for (var i = 0; i < tabmail.tabInfo.length; i++)
    {
      var tab = tabmail.tabInfo[i];
      if (tab.mode.name == "message")
        alert(tab.mode.getBrowser().currentURI.spec);
    }
    

    Edit: As Peter points out in the comments, the approach to get the URI for a message will only work the currently loaded message – all tabs reuse the same browser element for the mail messages. Getting the URI properly is more complicated, you have to get the nsIMsgDBHdr instance for the message via TabInfo.folderDisplay.selectedMessage and then use nsIMsgFolder.getUriForMsg() to construct the URI for it:

    var tabmail = document.getElementById("tabmail");
    for (var i = 0; i < tabmail.tabInfo.length; i++)
    {
      var tab = tabmail.tabInfo[i];
      if (tab.mode.name != "message")
        continue;
      var message = tab.folderDisplay.selectedMessage;
      alert(message.folder.getUriForMsg(message));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed a C# application which makes heavy use of events. Now this
I have developed a simple library in Ruby and need to use this in
I have developed code on a m-file script in Matlab that communicates with a
I have developed a web application that uses the jQuery DateTimePicker by Trent Richardson
I have developed a sample WCF REST service that accepts that creates an Order
I have developed a grails application that stores a great deal of information. Currently,
I have developed an application that is to be run on android Tablet as
Have developed an MVC3 application which monitors when users access static content on the
I have developed a simple API to allow communication between my Android/iPhone apps and
I have developed a VB.NET WCF service that recives and sends back data. When

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.