diff options
Diffstat (limited to 'lib/main.js')
-rw-r--r-- | lib/main.js | 24 |
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; |