Bug 1388166 - Handle case where chromeWin.getBrowser() doesn't exist. r=johannh a=jorgk DONTBUILD THUNDERBIRD560b1_2017080501_RELBRANCH
authorJorg K <jorgk@jorgk.com>
Mon, 07 Aug 2017 14:44:00 -0400
branchTHUNDERBIRD560b1_2017080501_RELBRANCH
changeset 421090 3566a92f2698ed06ceeb68a2dc6b738c22b49465
parent 420984 74e49a52007c609495c6cbc673487ed457838d9e
child 421095 10ef398044d811945f08a74c49b49240f47b9878
push id7595
push usermozilla@jorgk.com
push dateWed, 09 Aug 2017 22:34:21 +0000
treeherdermozilla-beta@3566a92f2698 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjohannh, jorgk
bugs1388166
milestone56.0
Bug 1388166 - Handle case where chromeWin.getBrowser() doesn't exist. r=johannh a=jorgk DONTBUILD
toolkit/components/passwordmgr/nsLoginManagerPrompter.js
--- a/toolkit/components/passwordmgr/nsLoginManagerPrompter.js
+++ b/toolkit/components/passwordmgr/nsLoginManagerPrompter.js
@@ -1429,17 +1429,18 @@ LoginManagerPrompter.prototype = {
                              .getInterface(Ci.nsIWebNavigation)
                              .QueryInterface(Ci.nsIDocShell)
                              .chromeEventHandler.ownerGlobal;
       if (!chromeWin) {
         return null;
       }
 
       // gBrowser only exists on some apps, like Firefox.
-      let tabbrowser = chromeWin.gBrowser || chromeWin.getBrowser();
+      let tabbrowser = chromeWin.gBrowser ||
+        (typeof chromeWin.getBrowser == "function" ? chromeWin.getBrowser() : null);
       // At least serve the chrome window if getBrowser()
       // or getBrowserForContentWindow() are not supported.
       if (!tabbrowser || typeof tabbrowser.getBrowserForContentWindow != "function") {
         return { win: chromeWin };
       }
 
       let browser = tabbrowser.getBrowserForContentWindow(aWindow);
       return { win: chromeWin, browser };