aboutsummaryrefslogtreecommitdiffstats
path: root/lib/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/main.js')
-rw-r--r--lib/main.js37
1 files changed, 6 insertions, 31 deletions
diff --git a/lib/main.js b/lib/main.js
index cbb3ba6..0afa67d 100644
--- a/lib/main.js
+++ b/lib/main.js
@@ -41,35 +41,8 @@ function skipThisPage(doc) {
}
}
-
-/*
-exports.main = function main(options, callbacks) {
- initialize(function (config) {
- browser.whenContentLoaded(
- function(window) {
- // is this good for anything?
- if ("window" in window) { window = window.window; }
-
- if (isOurPage(window, config.matches)) {
- try {
- var curPage = new config.objConstructor(window, config);
- } catch (ex) {
- if (ex instanceof require("bzpage").NotLoggedinException) {
- return ; // Bail out if the user is not logged in
- } else {
- throw ex; // rethrow the exception otherwise
- }
- }
- } else if (isOurPage(window, config.skipMatches)) {
- skipThisPage(window.document);
- }
- }
- );
- });
-};
-
-*/
var messageHandler = exports.messageHandler = function messageHandler(worker, msg) {
+ console.log("messageHandler: msg = " + msg.toSource());
switch (msg.cmd) {
case "LogMessage":
console.log(msg.data);
@@ -79,6 +52,7 @@ var messageHandler = exports.messageHandler = function messageHandler(worker, ms
break;
case "GetInstalledPackages":
// send message with packages back
+ console.log("msg = " + msg.toSource());
libbz.getInstalledPackages(msg.data, function (pkgsMsg) {
worker.postMessage(pkgsMsg);
});
@@ -106,17 +80,18 @@ var contentScriptLibraries = {
"bugzilla.redhat.com": [
self.data.url("util.js"),
self.data.url("color.js"),
- self.data.url("bzpage.js"),
- self.data.url("rhbzpage.js")
+ self.data.url("bzpage.js")
+// self.data.url("rhbzpage.js")
]
};
+libbz.initialize();
pageMod.PageMod({
include: [
"https://bugzilla.redhat.com/show_bug.cgi?id=*"
],
contentScriptWhen: 'ready',
- // contentScriptFile: contentScriptLibraries["bugzilla.redhat.com"],
+ contentScriptFile: contentScriptLibraries["bugzilla.redhat.com"],
onAttach: function onAttach(worker, msg) {
console.log("worker: " + worker);
worker.on('message', function (msg) {