diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libbugzilla.js | 17 | ||||
-rw-r--r-- | lib/main.js | 33 |
2 files changed, 22 insertions, 28 deletions
diff --git a/lib/libbugzilla.js b/lib/libbugzilla.js index bdcf8fb..9300c49 100644 --- a/lib/libbugzilla.js +++ b/lib/libbugzilla.js @@ -176,7 +176,8 @@ exports.getInstalledPackages = function getInstalledPackages(locationLoginObj, c } } - if ("sentUpstreamString" in config.gJSONData.commentStrings) { + if (config.gJSONData.commentStrings && + "sentUpstreamString" in config.gJSONData.commentStrings) { config.constantData.commentStrings = {}; config.constantData.commentStrings.sentUpstreamString = config.gJSONData.commentStrings["sentUpstreamString"]; @@ -326,25 +327,13 @@ exports.initialize = function initialize(config, callback) { }); } - // config.logger = new logger.Logger(JSON.parse( - // self.data.load("bugzillalabelAbbreviations.json"))); - config.configData = {}; config.configData.matches = config.gJSONData.configData.matches; config.configData.skipMatches = config.configData.matches.map(function(x) { return x.replace("show_bug.cgi.*","((process|post)_bug|attachment)\.cgi$"); }); - // config.objConstructor = {}; - // var bzType = config.gJSONData.configData.objectStyle; - // if (bzType === "RH") { - // config.objConstructor = require("rhbzpage").RHBugzillaPage; - // } else if (bzType === "MoFo") { - // } - // config.objConstructor = require("mozillabzpage").MozillaBugzilla; - config.constantData = {}; - // TODO this is important and missing if ("constantData" in config.gJSONData) { config.constantData = config.gJSONData.constantData; config.constantData.queryUpstreamBug = JSON.parse( @@ -375,8 +364,6 @@ exports.initialize = function initialize(config, callback) { if ("submitsLogging" in config.gJSONData.configData && config.gJSONData.configData.submitsLogging) { - console.log("initialize : submitsLogin = " + - config.gJSONData.configData.submitsLogging); logger.initialize(JSON.parse(selfMod.data.load( "bugzillalabelAbbreviations.json"))); } diff --git a/lib/main.js b/lib/main.js index 34feb32..b553f6f 100644 --- a/lib/main.js +++ b/lib/main.js @@ -111,24 +111,24 @@ var messageHandler = exports.messageHandler = function messageHandler(worker, ms } }; -var contentScriptLibraries = { - "bugzilla.redhat.com": [ - self.data.url("lib/jumpNextBug.js"), - self.data.url("lib/util.js"), - self.data.url("lib/color.js"), - self.data.url("lib/logging-front.js"), - self.data.url("lib/rhbzpage.js"), - self.data.url("lib/bzpage.js") - ] -}; +var contentScriptLibraries = [ + self.data.url("lib/jumpNextBug.js"), + self.data.url("lib/util.js"), + self.data.url("lib/color.js"), + self.data.url("lib/logging-front.js"), + self.data.url("lib/rhbzpage.js"), + self.data.url("lib/bzpage.js") +]; libbz.initialize(libbz.config, function () { pageMod.PageMod({ include: [ - "https://bugzilla.redhat.com/show_bug.cgi?id=*" + "https://bugzilla.redhat.com/show_bug.cgi?id=*", + "https://bugzilla.mozilla.org/show_bug.cgi?id=*", + "https://bugzilla.gnome.org/show_bug.cgi?id=*" ], contentScriptWhen: 'ready', - contentScriptFile: contentScriptLibraries["bugzilla.redhat.com"], + contentScriptFile: contentScriptLibraries, onAttach: function onAttach(worker, msg) { worker.on('message', function (msg) { messageHandler(worker, msg); @@ -140,7 +140,14 @@ libbz.initialize(libbz.config, function () { pageMod.PageMod({ include: [ "https://bugzilla.redhat.com/process_bug.cgi", - "https://bugzilla.redhat.com/attachment.cgi" + "https://bugzilla.redhat.com/post_bug.cgi", + "https://bugzilla.redhat.com/attachment.cgi", + "https://bugzilla.mozilla.org/process_bug.cgi", + "https://bugzilla.mozilla.org/post_bug.cgi", + "https://bugzilla.mozilla.org/attachment.cgi", + "https://bugzilla.gnome.org/process_bug.cgi", + "https://bugzilla.gnome.org/post_bug.cgi", + "https://bugzilla.gnome.org/attachment.cgi" ], contentScriptWhen: 'ready', contentScriptFile: self.data.url("lib/skip-bug.js") |