jetpack.future.import("pageMods"); var callback = function(document){ var stemURL = "https://HOSTNAME/show_bug.cgi?id="; var titleStr = $("title",document).text(); var REArr = RegExp("[0-9]+").exec(titleStr); var REHostname = RegExp("\/\/([^/]+)\/").exec(document.location.toString()); if (REArr) { var bugNo = REArr[0]; var hostname = REHostname[1]; console.log("bugNo = " + bugNo + ", hostname = " + hostname); // jetpack.notifications.show('Bug ' + bugNo); var emailsSent = $("#bugzilla-body > dl:first",document).text(); emailsSent = emailsSent.replace(/^(\s*)$/mg,""); //console.log(emailsSent); // to be sent to jetpack.notifications.show when available document.location = stemURL.replace("HOSTNAME",hostname) + bugNo; } }; var options = {}; options.matches = [ "https://bugzilla.redhat.com/process_bug.cgi", "https://bugzilla.redhat.com/post_bug.cgi", "https://bugzilla.mozilla.org/post_bug.cgi", "https://bugzilla.mozilla.org/process_bug.cgi" ]; jetpack.pageMods.add(callback, options);