aboutsummaryrefslogtreecommitdiffstats
path: root/lib/main.js
diff options
context:
space:
mode:
authorEhsan Akhgari <ehsan@mozilla.com>2010-05-30 20:46:45 -0400
committerEhsan Akhgari <ehsan@mozilla.com>2010-05-30 20:46:45 -0400
commitef369e0ba4f4c8c1f0e3eaad49ff99050e798542 (patch)
tree66b64d5e5e9fae2436675fa9c64f9bb027fa9665 /lib/main.js
parent7d892a30966ce621e592ad861e3e76ddf78fd05b (diff)
downloadbugzilla-triage-ef369e0ba4f4c8c1f0e3eaad49ff99050e798542.tar.gz
Switch to using the new equivalent of the pageMods API
Diffstat (limited to 'lib/main.js')
-rw-r--r--lib/main.js24
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/main.js b/lib/main.js
index 608f820..cd4de54 100644
--- a/lib/main.js
+++ b/lib/main.js
@@ -1,15 +1,17 @@
-// access context menu API
-jetpack.future.import("menu");
-jetpack.future.import("clipboard");
-
-/*
-I love me some pageMods, but right now there are multiple-invocations issues
-
-jetpack.future.import("pageMods");
+exports.main = function(options, callback) {
+ require("tab-browser").whenContentLoaded(
+ function(window) {
+ if (window.location.protocol == "https" &&
+ /bugzilla(-[a-zA-Z]+)*\.mozilla\.org/.test(window.location.href)) {
+ require("persistent-page-mod").register(window, function() {
+ tweakBugzilla(window.document);
+ });
+ }
+ }
+ );
+};
-jetpack.pageMods.add(function(d) {
-*/
-jetpack.tabs.onReady(function(d) {
+function tweakBugzilla(d) {
// run on both bugzilla.m.o and bugzilla-stage-tip.m.o
if (!/bugzilla(-[a-zA-Z]+)*\.mozilla\.org/.test(d.location.href))
return;