skryp
...@yahoo.fr schrieb am 23.10.08 17:42:
> I can't find a way to remove (for an add-on about privacy) an entry from
> the "closed tabs" list.
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