From ef369e0ba4f4c8c1f0e3eaad49ff99050e798542 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Sun, 30 May 2010 20:46:45 -0400 Subject: Switch to using the new equivalent of the pageMods API --- lib/main.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'lib/main.js') 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; -- cgit