Bug 366986 - "[SessionStore] Browser components are handling listened events before extensions on removeTab" [p=zeniko@gmail.com (Simon Bünzli) r=dietrich r=mfinkle a1.9=beltzner]

This commit is contained in:
reed@reedloden.com 2007-12-13 23:41:48 -08:00
parent f66f102dde
commit 2edb091453

View File

@ -540,6 +540,12 @@ SessionStoreService.prototype = {
* TabPanel reference
*/
onTabClose: function sss_onTabClose(aWindow, aTab) {
// notify the tabbrowser that the tab state will be retrieved for the last time
// (so that extension authors can easily set data on soon-to-be-closed tabs)
var event = aWindow.document.createEvent("Events");
event.initEvent("SSTabClosing", true, false);
aTab.dispatchEvent(event);
var maxTabsUndo = this._prefBranch.getIntPref("sessionstore.max_tabs_undo");
// don't update our internal state if we don't have to
if (maxTabsUndo == 0) {