Close all opened tabs.

User support for problems with custom buttons

Close all opened tabs.

Postby mandriospo » Sun Apr 09, 2017 7:59 pm

Is it any chance to close all opened tabs (except main one) with custom button?
mandriospo
 
Posts: 23
Joined: Mon Apr 04, 2016 10:13 am

Re: Close all opened tabs.

Postby BarbieBarb » Sun Apr 09, 2017 11:59 pm

Does this work for your browser version?
Closes all tabs except the selected tab. With notification popup or read down the page further for without notification popup
viewtopic.php?f=2&t=994
BarbieBarb
 
Posts: 751
Joined: Thu Jun 14, 2012 6:14 am

Re: Close all opened tabs.

Postby mandriospo » Mon Apr 10, 2017 6:28 pm

I have in Thunderbird option "Close all other tabs" when I right mouse click on main tab. It does not ask me to confirm. Can anyone give me full code to do that? I want combine it with custom button which search for other email (and in the same time I want close all tabs)
mandriospo
 
Posts: 23
Joined: Mon Apr 04, 2016 10:13 am

Re: Close all opened tabs.

Postby morat » Tue Apr 11, 2017 6:09 am

Try this:

Code: Select all
/*Code*/
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].
  getService(Components.interfaces.nsIWindowMediator);
var win = wm.getMostRecentWindow("mail:3pane");
var tabmail = win.document.getElementById("tabmail");
var tab = tabmail.tabContainer.selectedItem;
tabmail.closeOtherTabs(tab);
morat
 
Posts: 909
Joined: Wed Dec 28, 2011 2:38 pm


Return to Buttons

cron