aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2010-04-21 16:37:56 +0200
committerMatěj Cepl <mcepl@redhat.com>2010-04-21 16:37:56 +0200
commit0c87af0bff666c98f410499eef40adfe821206de (patch)
tree880fdb28d20b2fc8172c114fca4213433612814e
parentbca03de52865012c54b7e7bdd55970507dd7f5f0 (diff)
downloadbugzilla-triage-0c87af0bff666c98f410499eef40adfe821206de.tar.gz
Don't show notifications on FF 3.5
-rw-r--r--skip-process-bug.js27
1 files changed, 23 insertions, 4 deletions
diff --git a/skip-process-bug.js b/skip-process-bug.js
index 9123b6f..3f82578 100644
--- a/skip-process-bug.js
+++ b/skip-process-bug.js
@@ -1,5 +1,21 @@
jetpack.future.import("pageMods");
+// http://maymay.net/blog/2008/06/15/\
+// ridiculously-simple-javascript-version-string-to-object-parser/
+function parseVersionString (str) {
+ if (typeof(str) != 'string') { return false; }
+ var x = str.split('.');
+ // parse from string or default to 0 if can't parse
+ var maj = parseInt(x[0]) || 0;
+ var min = parseInt(x[1]) || 0;
+ var pat = parseInt(x[2]) || 0;
+ return {
+ major: maj,
+ minor: min,
+ patch: pat
+ };
+}
+
var callback = function(document){
var stemURL = "https://HOSTNAME/show_bug.cgi?id=";
var titleStr = $("title",document).text();
@@ -9,10 +25,13 @@ var callback = function(document){
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,"");
- jetpack.notifications.show(emailsSent); // to be sent to jetpack.notifications.show when available
+ var currentFFVersion = parseVersionString(jetpack.__parent__.navigator.vendorSub);
+ console.log("currentFFVersion = " + currentFFVersion.toSource());
+ if ((currentFFVersion.major >= 3) && (currentFFVersion.minor >= 6)) {
+ var emailsSent = $("#bugzilla-body > dl:first",document).text();
+ emailsSent = emailsSent.replace(/^(\s*)$/mg,"");
+ jetpack.notifications.show(emailsSent);
+ }
document.location = stemURL.replace("HOSTNAME",hostname) + bugNo;
}
};