diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/util.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/util.js b/lib/util.js index b72f7f0..f582d1d 100644 --- a/lib/util.js +++ b/lib/util.js @@ -197,7 +197,10 @@ var filterByRegexp = exports.filterByRegexp = * * @return String with the password */ -var getPassword = exports.getPassword = function getPassword() { +var getPassword = exports.getPassword = function getPassword(prompt) { + if (prompt === null) { + prompt = "Enter password:"; + } var prompts = Cc["@mozilla.org/embedcomp/prompt-service;1"] .getService(Ci.nsIPromptService); var password = { @@ -206,7 +209,7 @@ var getPassword = exports.getPassword = function getPassword() { var check = { value : true }; // default the checkbox to true - var result = prompts.promptPassword(null, "Title", "Enter password:", + var result = prompts.promptPassword(null, "Title", prompt, password, null, check); // result is true if OK was pressed, false if cancel was pressed. // password.value is set if OK was pressed. @@ -216,4 +219,4 @@ var getPassword = exports.getPassword = function getPassword() { } else { return undefined; } -};
\ No newline at end of file +}; |