diff options
Diffstat (limited to 'lib/bzpage.js')
-rw-r--r-- | lib/bzpage.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/bzpage.js b/lib/bzpage.js index 25c9498..9fa02c0 100644 --- a/lib/bzpage.js +++ b/lib/bzpage.js @@ -46,6 +46,7 @@ var BZPage = function BZPage(win, config) { var that = this; this.win = win; this.doc = win.document; + this.hostname = this.win.location.hostname; // First, preflight check ... if we are not logged in, there // is nothing we can do. @@ -132,14 +133,13 @@ BZPage.prototype.getBugId = function getBugId () { BZPage.prototype.getInstalledPackages = function getInstalledPackages(cfg) { var installedPackages = {}; var enabledPackages = []; - var hostname = this.win.location.hostname; // Collect enabled packages per hostname (plus default ones) if (cfg.gJSONData && ("commentPackages" in cfg.gJSONData)) { if ("enabledPackages" in cfg.gJSONData.configData) { var epObject = cfg.gJSONData.configData.enabledPackages; - if (hostname in epObject) { - enabledPackages = enabledPackages.concat(epObject[hostname].split(/[, ]/)); + if (this.hostname in epObject) { + enabledPackages = enabledPackages.concat(epObject[this.hostname].split(/[, ]/)); } if ("any" in epObject) { enabledPackages = enabledPackages.concat(epObject["any"].split(/[, ]/)); @@ -710,8 +710,7 @@ BZPage.prototype.getPassword = function getPassword (login) { var passPrompt = "Enter your Bugzilla password for fixing MIME attachment types"; var switchPrompt = "Do you want to switch off features requiring password completely?"; var prefName = BTSPrefNS+"withoutPassowrd"; - var loc = this.win.location; - var domain = loc.protocol + "//" + loc.hostname; + var domain = this.win.location.protocol + "//" + this.hostname; var pass = passUtils.getPassword(login, domain, BTSPassRealm); // pass === null means no appropriate password in the storage |