Commit c94b0210 authored by Kathleen Brade's avatar Kathleen Brade Committed by Matthew Finkel
Browse files

Bug 31955: On macOS avoid throwing inside nonBrowserWindowStartup()

Inside nonBrowserWindowStartup(), do not assume that XUL elements
that are only part of the Mac hidden window are available in all
non-browser windows.
parent d25d6e32
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -102,10 +102,17 @@ function nonBrowserWindowStartup() {
  }

  if (PrivateBrowsingUtils.permanentPrivateBrowsing) {
    document.getElementById("macDockMenuNewWindow").hidden = true;
    element = document.getElementById("macDockMenuNewWindow");
    if (element) {
      element.hidden = true;
    }
  }

  if (!PrivateBrowsingUtils.enabled) {
    document.getElementById("macDockMenuNewPrivateWindow").hidden = true;
    element = document.getElementById("macDockMenuNewPrivateWindow");
    if (element) {
      element.hidden = true;
    }
  }

  delayedStartupTimeoutId = setTimeout(nonBrowserWindowDelayedStartup, 0);