aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/main.js3
-rw-r--r--lib/util.js12
2 files changed, 14 insertions, 1 deletions
diff --git a/lib/main.js b/lib/main.js
index be4ff8d..0348842 100644
--- a/lib/main.js
+++ b/lib/main.js
@@ -16,6 +16,7 @@ var pageMod = require("page-mod");
var libbz = require("libbugzilla");
var tabs = require("tabs");
var logger = require("logger");
+var Message = require("util").Message;
function isOurPage(window, matchingURLs) {
var url = window.location.href;
@@ -115,7 +116,7 @@ var contentScriptLibraries = {
"bugzilla.redhat.com": [
self.data.url("util.js"),
self.data.url("color.js"),
- self.data.url("rhbzpage.js"),
+ self.data.url("rhbzpage.js"),
self.data.url("bzpage.js")
]
};
diff --git a/lib/util.js b/lib/util.js
index 3532203..089e31c 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -63,3 +63,15 @@ exports.getISODate = function getISODate(dateStr) {
return date.getFullYear() + '-' + pad(date.getMonth() + 1) + '-' +
pad(date.getDate());
};
+
+/**
+ * object to pack messaging. Use as in
+ postMessage(new Message("GetPassword", {
+ login: login,
+ hostname: location.hostname
+ }));
+ */
+exports.Message = function Message(cmd, data) {
+ this.cmd = cmd;
+ this.data = data;
+};