diff options
author | Matěj Cepl <mcepl@redhat.com> | 2011-01-28 16:38:36 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2011-01-31 20:33:33 +0100 |
commit | 4a0bcc39b1e1b49dcaa0aa2ab674c6f1ba51e9e5 (patch) | |
tree | 642411d3b3b433e8903e0bbbbf46004a37477b58 /lib/main.js | |
parent | 83a7d703cbabd6e514a6d8a948b39325b59e9f58 (diff) | |
download | bugzilla-triage-4a0bcc39b1e1b49dcaa0aa2ab674c6f1ba51e9e5.tar.gz |
Tons of fixes, we are almost in state that the primitive run is possible.
TOOD:
* The most important part is we have to run libbz.initialize() and wait
until it is done.
Diffstat (limited to 'lib/main.js')
-rw-r--r-- | lib/main.js | 37 |
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) { |