Bug 784028: password manager doesn't prompt to save passwords in popup windows. r=MattN
authorGavin Sharp <gavin@gavinsharp.com>
Thu, 27 Sep 2012 19:32:38 -0700
changeset 109298 d406bd8dc895eb5dfa2e9f6cbb2dee6b2eba40fa
parent 109297 3d6caa803dca37534fd4d4c8d1139579813b6bd3
child 109299 5a7b8047348543b0197731431164edf49fd82ab3
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewersMattN
bugs784028
milestone18.0a1
Bug 784028: password manager doesn't prompt to save passwords in popup windows. r=MattN
toolkit/components/passwordmgr/nsLoginManagerPrompter.js
--- a/toolkit/components/passwordmgr/nsLoginManagerPrompter.js
+++ b/toolkit/components/passwordmgr/nsLoginManagerPrompter.js
@@ -815,17 +815,17 @@ LoginManagerPrompter.prototype = {
                         browser.focus();
                     }
                 }
             ];
 
             var notifyWin = this._getNotifyWindow();
             var chromeWin = this._getChromeWindow(notifyWin).wrappedJSObject;
             var browser = chromeWin.gBrowser.
-                                    getBrowserForDocument(this._window.top.document);
+                                    getBrowserForDocument(notifyWin.top.document);
 
             aNotifyObj.show(browser, "password-save", notificationText,
                             "password-notification-icon", mainAction,
                             secondaryActions, { timeout: Date.now() + 10000,
                                                 persistWhileVisible: true });
         } else {
             var notNowButtonText =
                   this._getLocalizedString("notifyBarNotNowButtonText");
@@ -1013,17 +1013,17 @@ LoginManagerPrompter.prototype = {
                 callback:  function(aNotifyObj, aButton) {
                     self._updateLogin(aOldLogin, aNewPassword);
                 }
             };
 
             var notifyWin = this._getNotifyWindow();
             var chromeWin = this._getChromeWindow(notifyWin).wrappedJSObject;
             var browser = chromeWin.gBrowser.
-                                    getBrowserForDocument(this._window.top.document);
+                                    getBrowserForDocument(notifyWin.top.document);
 
             aNotifyObj.show(browser, "password-change", notificationText,
                             "password-notification-icon", mainAction,
                             null, { timeout: Date.now() + 10000,
                                     persistWhileVisible: true });
         } else {
             var dontChangeButtonText =
                   this._getLocalizedString("notifyBarDontChangeButtonText");
@@ -1185,17 +1185,17 @@ LoginManagerPrompter.prototype = {
                 var webnav = notifyWin.
                              QueryInterface(Ci.nsIInterfaceRequestor).
                              getInterface(Ci.nsIWebNavigation);
 
                 // Check to see if the current window was opened with chrome
                 // disabled, and if so use the opener window. But if the window
                 // has been used to visit other pages (ie, has a history),
                 // assume it'll stick around and *don't* use the opener.
-                if (chromeDoc.hasAttribute("chromehidden") &&
+                if (chromeDoc.getAttribute("chromehidden") &&
                     webnav.sessionHistory.count == 1) {
                     this.log("Using opener window for notification bar.");
                     notifyWin = notifyWin.opener;
                 }
             }
 
             return notifyWin;