Bug 887045 Some private windows appear in the undo close window list r=IanN a=Callek
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Mon, 22 Jul 2013 19:43:31 +0100
changeset 15592 ad06842957a185e296815ca4758399c9de2ffcbf
parent 15591 56d3f3b988208454b21ccc4fb281bcebbd5e12f4
child 15593 6b01d727384d40ee8ff81a4e317b43909200cbdb
push id936
push userneil@parkwaycc.co.uk
push dateMon, 22 Jul 2013 18:45:26 +0000
treeherdercomm-beta@d4c1227b1eea [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIanN, Callek
bugs887045
Bug 887045 Some private windows appear in the undo close window list r=IanN a=Callek
suite/common/src/nsSessionStore.js
--- a/suite/common/src/nsSessionStore.js
+++ b/suite/common/src/nsSessionStore.js
@@ -30,20 +30,19 @@ const PRIVACY_NONE = 0;
 const PRIVACY_ENCRYPTED = 1;
 const PRIVACY_FULL = 2;
 
 const NOTIFY_WINDOWS_RESTORED = "sessionstore-windows-restored";
 const NOTIFY_BROWSER_STATE_RESTORED = "sessionstore-browser-state-restored";
 
 // global notifications observed
 const OBSERVING = [
-  "domwindowopened", "domwindowclosed",
-  "quit-application-requested", "quit-application-granted",
-  "browser-lastwindow-close-granted",
-  "quit-application", "browser:purge-session-history"
+  "domwindowclosed",
+  "quit-application-requested", "quit-application-granted", "quit-application",
+  "browser-lastwindow-close-granted", "browser:purge-session-history"
 ];
 
 /*
 XUL Window properties to (re)store
 Restored in restoreDimensions()
 */
 const WINDOW_ATTRIBUTES = {
   width: "outerWidth",
@@ -362,22 +361,16 @@ SessionStoreService.prototype = {
   /**
    * Handle notifications
    */
   observe: function sss_observe(aSubject, aTopic, aData) {
     // for event listeners
     var _this = this;
 
     switch (aTopic) {
-    case "domwindowopened": // catch new windows
-      aSubject.addEventListener("load", function aSubjectLoad(aEvent) {
-        aEvent.currentTarget.removeEventListener("load", aSubjectLoad, false);
-        _this.onLoad(aEvent.currentTarget);
-      }, false);
-      break;
     case "domwindowclosed": // catch closed windows
       this.onClose(aSubject);
       break;
     case "quit-application-requested":
       // get a current snapshot of all windows
       this._forEachBrowserWindow(function(aWindow) {
         this._collectWindowData(aWindow);
       });