Any hint ?
Regards
--
Benoit Bailleux
If you want to remove _all_ closed tabs, just set
browser.sessionstore.max_tabs_undo to 0 and then back to its original value.
Removing a single closed tab isn't that simple. I've filed a bug about
this (see https://bugzilla.mozilla.org/show_bug.cgi?id=461634 ), but
until the API has been extended, you can use the following work-around
(leads to some flickering, but does the job):
function forgetClosedTab(aIndex) {
var selectedTab = getBrowser().selectedTab;
// reopen the tab to forget
var tab = undoCloseTab(aIndex) || gBrowser.selectedTab
var browser = gBrowser.getBrowserForTab(tab);
// load a blank document and clear its history
browser.contentDocument.location = "about:blank";
with (browser.webNavigation.sessionHistory) PurgeHistory(count);
// don't wait for the tab to complete loading
// (this clears data associated with partially loaded tabs)
var event = document.createEvent("Events");
event.initEvent("load", true, false);
browser.dispatchEvent(event);
// close the tab for good (blank tabs can't be reopened)
gBrowser.removeTab(tab);
gBrowser.selectedTab = selectedTab;
}
Cheers,
Simon
Thanks for the trick (I didn't know that "blank tabs can't be reopened").
I could not try it until this last week-end, but it works as I need.
By the way, do you agree / mind to be listed as a contributor in my little
extension ?
Regards,
--
BBa