Bug 1551671 - don't allow restoring minimized or toolbarless initial windows, r=mikedeboer, a=jcristau
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Wed, 19 Jun 2019 15:35:15 +0000
changeset 537049 2737f084510e096d14e37ba4bf6d00c9da3c4b85
parent 537048 34e40ed5a5e9f3ff55572270ac66e1309374eaab
child 537050 6f87bc5460f76ce43c4db98ebf26744667d907c6
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmikedeboer, jcristau
bugs1551671
milestone68.0
Bug 1551671 - don't allow restoring minimized or toolbarless initial windows, r=mikedeboer, a=jcristau Differential Revision: https://phabricator.services.mozilla.com/D34271
browser/components/sessionstore/SessionStore.jsm
--- a/browser/components/sessionstore/SessionStore.jsm
+++ b/browser/components/sessionstore/SessionStore.jsm
@@ -695,16 +695,24 @@ var SessionStoreInternal = {
               state.windows[0].tabs[0].entries[0].url = "about:sessionrestore";
               state.windows[0].tabs[0].entries[0].triggeringPrincipal_base64 = E10SUtils.SERIALIZED_SYSTEMPRINCIPAL;
             }
           }
 
           // Update the session start time using the restored session state.
           this._updateSessionStartTime(state);
 
+          // Make sure that at least the first window doesn't have anything hidden.
+          delete state.windows[0].hidden;
+          // Since nothing is hidden in the first window, it cannot be a popup.
+          delete state.windows[0].isPopup;
+          // We don't want to minimize and then open a window at startup.
+          if (state.windows[0].sizemode == "minimized")
+            state.windows[0].sizemode = "normal";
+
           // clear any lastSessionWindowID attributes since those don't matter
           // during normal restore
           state.windows.forEach(function(aWindow) {
             delete aWindow.__lastSessionWindowID;
           });
         }
       } catch (ex) { debug("The session file is invalid: " + ex); }
     }