[tor-commits] [tor-browser/tor-browser-68.1.0esr-9.0-2] Bug 31955: On macOS avoid throwing inside nonBrowserWindowStartup()

gk at torproject.org gk at torproject.org
Thu Oct 3 14:17:35 UTC 2019


commit 7ad264c14007eaa870db55eba82b1e32faf299bf
Author: Kathy Brade <brade at pearlcrescent.com>
Date:   Thu Oct 3 10:05:33 2019 -0400

    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.
---
 browser/base/content/nonbrowser-mac.js | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/browser/base/content/nonbrowser-mac.js b/browser/base/content/nonbrowser-mac.js
index 44f5cfd03127..a7174a9295d0 100644
--- a/browser/base/content/nonbrowser-mac.js
+++ b/browser/base/content/nonbrowser-mac.js
@@ -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);



More information about the tor-commits mailing list