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]

git-svn-id: svn://10.0.0.236/trunk@241236 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
reed%reedloden.com 2007-12-14 07:41:48 +00:00
parent 9ecc27fe23
commit d3e8887a15

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) {