diff --git a/chrome/content/mailhops.js b/chrome/content/mailhops.js
index 3f1de64..0ccc406 100644
--- a/chrome/content/mailhops.js
+++ b/chrome/content/mailhops.js
@@ -24,12 +24,18 @@ var mailHops =
resultMeta: null,
isLoaded: false,
- options: {'map':'goog','unit':'mi','api_url':'http://api.mailhops.com'},
+ options: {'map':'goog','unit':'mi','api_url':'http://api.mailhops.com','debug':false},
appVersion: 'MailHops Postbox 0.8.2',
message: {secure:[]},
client_location: null
}
+function LOG(msg) {
+ var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
+ .getService(Components.interfaces.nsIConsoleService);
+ consoleService.logStringMessage('MailHops: '+msg);
+}
+
mailHops.init = function()
{
//load preferences
@@ -120,7 +126,8 @@ mailHops.loadPref = function()
//Hosting
mailHops.options.use_private = mailHops.getCharPref('mail.mailHops.use_private','false')=='true'?true:false;
mailHops.options.hosting = mailHops.getCharPref('mail.mailHops.hosting','personal');
-
+ mailHops.options.debug = mailHops.getCharPref('mail.mailHops.debug','false')=='true'?true:false;
+
mailHops.options.client_location = mailHops.getCharPref('mail.mailHops.client_location','');
if(mailHops.options.use_private)
@@ -921,11 +928,16 @@ mailHops.lookupRoute = function(header_route){
var cached_results=mailHops.getResults();
if(cached_results){
+ if(mailHops.options.debug)
+ LOG('Found Cached Result');
cached_results = JSON.parse(cached_results);
mailHops.displayResult(header_route, cached_results.response, cached_results.meta, lookupURL);
return;
}
+if(mailHops.options.debug)
+ LOG(lookupURL);
+
//call mailhops api for lookup
var xmlhttp = new XMLHttpRequest();
@@ -942,11 +954,15 @@ mailHops.lookupRoute = function(header_route){
//display the result
mailHops.displayResult(header_route,data.response,data.meta, lookupURL);
} else {
+ if(mailHops.options.debug)
+ LOG(JSON.stringify(data));
//display the error
mailHops.displayError(data);
}
}
catch (ex){
+ if(mailHops.options.debug)
+ LOG(JSON.stringify(ex));
mailHops.displayError();
}
}
diff --git a/chrome/content/preferences.js b/chrome/content/preferences.js
index fd1eb71..6319094 100644
--- a/chrome/content/preferences.js
+++ b/chrome/content/preferences.js
@@ -102,6 +102,11 @@ var mailHopPreferences =
else
document.getElementById("mailhop.use_private").checked = false;
+ if(pref.getCharPref("mail.mailHops.debug",'true')=='true')
+ document.getElementById("mailhop.debug").checked = true;
+ else
+ document.getElementById("mailhop.debug").checked = false;
+
this.api_url.value = pref.getCharPref("mail.mailHops.api_url",'http://api.mailhops.com');
ResetLocation(document.getElementById("mailhop.refresh_location"));
@@ -123,6 +128,7 @@ var mailHopPreferences =
pref.setCharPref("mail.mailHops.show_lists", String(document.getElementById("mailhop.show_lists").checked)) ;
pref.setCharPref("mail.mailHops.show_auth", String(document.getElementById("mailhop.show_auth").checked)) ;
pref.setCharPref("mail.mailHops.use_private", String(document.getElementById("mailhop.use_private").checked)) ;
+ pref.setCharPref("mail.mailHops.debug", String(document.getElementById("mailhop.debug").checked)) ;
pref.setCharPref("mail.mailHops.hosting", document.getElementById("mailhop.hosting").selectedItem.value) ;
pref.setCharPref("mail.mailHops.api_url", String(document.getElementById("mailhop.api_url").value)) ;
}
diff --git a/chrome/content/preferences.xul b/chrome/content/preferences.xul
index 110f2da..dc54ada 100644
--- a/chrome/content/preferences.xul
+++ b/chrome/content/preferences.xul
@@ -74,6 +74,7 @@
+
diff --git a/install.rdf b/install.rdf
index 10494f2..b2c4682 100644
--- a/install.rdf
+++ b/install.rdf
@@ -7,7 +7,7 @@
postbox@mailhops.com
2
MailHops
- 0.8.2
+ 0.8.3
MailHops maps the route an email traveled to get to you. Using GeoIP it also displays distance traveled along with the location (city, state and country) of the sender.
chrome://mailhops/content/images/mailhops32.png
http://mailhops.com
diff --git a/mailhops.xpi b/mailhops.xpi
new file mode 100644
index 0000000..af54102
Binary files /dev/null and b/mailhops.xpi differ