cancel the tab close programmatically

Talk about add-ons and extension development.
Post Reply
Diamanti
Posts: 779
Joined: June 12th, 2008, 9:02 am

cancel the tab close programmatically

Post by Diamanti »

I have a TabClose event.
How to cancel the tab close programmatically?
gBrowser.tabContainer.addEventListener("TabClose", function(){return false;}, false);
lithopsian
Posts: 3664
Joined: September 15th, 2010, 9:03 am

Re: cancel the tab close programmatically

Post by lithopsian »

TabClose isn't cancellable and has no default action. It is simply a notification.
lithopsian
Posts: 3664
Joined: September 15th, 2010, 9:03 am

Re: cancel the tab close programmatically

Post by lithopsian »

Just guessing, but you still want a way to stop tabs closing? You could try overwriting gBrowser.removeTab(). This is certainly a common way to close tabs, but I don't know if it is the only way. You'll have to try it and see. I'm not an expert on tabs, pesky things.
Diamanti
Posts: 779
Joined: June 12th, 2008, 9:02 am

Re: cancel the tab close programmatically

Post by Diamanti »

I did so ty
Post Reply