Bug 1565780 - Await masterPasswordLogin before copying passwords. r=jaws a=RyanVM
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Fri, 19 Jul 2019 07:47:48 +0000
changeset 537271 b6cc9968b1772b8ccd239bef0087b4c7ddd8198d
parent 537270 b4235a5646959f8aa55031ef5b61f28557cc6ed5
child 537272 5a504fde3c4a7c32b0ba142048c3a4f7e105ce0e
push id2118
push userarchaeopteryx@coole-files.de
push dateThu, 01 Aug 2019 11:01:26 +0000
treeherdermozilla-release@e815b40e9e70 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws, RyanVM
bugs1565780
milestone68.0.2
Bug 1565780 - Await masterPasswordLogin before copying passwords. r=jaws a=RyanVM Differential Revision: https://phabricator.services.mozilla.com/D38551
toolkit/components/passwordmgr/content/passwordManager.js
--- a/toolkit/components/passwordmgr/content/passwordManager.js
+++ b/toolkit/components/passwordmgr/content/passwordManager.js
@@ -626,20 +626,20 @@ function CopySiteUrl() {
   // Copy selected site url to clipboard
   let clipboard = Cc["@mozilla.org/widget/clipboardhelper;1"].
                   getService(Ci.nsIClipboardHelper);
   let row = signonsTree.currentIndex;
   let url = signonsTreeView.getCellText(row, {id: "siteCol"});
   clipboard.copyString(url);
 }
 
-function CopyPassword() {
+async function CopyPassword() {
   // Don't copy passwords if we aren't already showing the passwords & a master
   // password hasn't been entered.
-  if (!showingPasswords && !masterPasswordLogin()) {
+  if (!showingPasswords && !(await masterPasswordLogin())) {
     return;
   }
   // Copy selected signon's password to clipboard
   let clipboard = Cc["@mozilla.org/widget/clipboardhelper;1"].
                   getService(Ci.nsIClipboardHelper);
   let row = signonsTree.currentIndex;
   let password = signonsTreeView.getCellText(row, {id: "passwordCol" });
   clipboard.copyString(password);