From 3f70ba468a91e0f5abe20034dd50e3c63a6fcb1a Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Fri, 16 Jul 2010 04:25:30 +0200 Subject: Use Firefox nsILoginManager to store password and make it optional. Fixes #16. --- lib/rhbzpage.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/rhbzpage.js') diff --git a/lib/rhbzpage.js b/lib/rhbzpage.js index 82d5e05..bc3394c 100644 --- a/lib/rhbzpage.js +++ b/lib/rhbzpage.js @@ -61,7 +61,7 @@ var RHBugzillaPage = function RHBugzillaPage(win, config) { this.chipMagicInterestingLine = ""; this.login = this.getLogin(); - this.password = this.getPassword(); + this.password = this.getPassword(this.login); var ITbutton = this.doc.getElementById("cf_issuetracker"); this.its = ITbutton ? ITbutton.value.trim() : ""; @@ -288,6 +288,10 @@ RHBugzillaPage.prototype.pasteBacktraceInComments = function() { */ RHBugzillaPage.prototype.markBadAttachments = function() { var badMIMEArray = [ "application/octet-stream", "text/x-log", "undefined" ]; + if (!this.password) { + return ; // User didn't provide password, so whole MIME fixing business + // should be switched off. + } var badAttachments = this.attachments.filter(function(att, idx, arr) { return (util.isInList(att[2], badMIMEArray)); -- cgit