diff --git a/chrome/content/mailhops.js b/chrome/content/mailhops.js index a95994a..27e0094 100644 --- a/chrome/content/mailhops.js +++ b/chrome/content/mailhops.js @@ -6,6 +6,7 @@ var mailHops = { + msgURI: null, resultTextDataPane: null, resultTextDataPane2: null, resultContainerDataPane: null, @@ -25,8 +26,9 @@ var mailHops = isLoaded: false, options: {'map':'goog','unit':'mi','api_url':'http://api.mailhops.com'}, - appVersion: 'MailHops Postbox 0.7.1', + appVersion: 'MailHops Postbox 0.8', message: {secure:[]}, + client_location: null } mailHops.init = function() @@ -114,11 +116,17 @@ mailHops.loadPref = function() 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.client_location = mailHops.getCharPref('mail.mailHops.client_location',''); + if(mailHops.options.use_private) mailHops.options.api_url = mailHops.getCharPref('mail.mailHops.api_url','http://api.mailhops.com'); else mailHops.options.api_url='http://api.mailhops.com'; + if(mailHops.options.client_location == ''){ + mailHops.setClientLocation(); + } + }; mailHops.StreamListener = @@ -177,7 +185,7 @@ mailHops.loadHeaderData = function() { return ; } - + mailHops.msgURI = msgURI; var messenger = Components.classes["@mozilla.org/messenger;1"].createInstance ( Components.interfaces.nsIMessenger ) ; var msgService = messenger.messageServiceFromURI ( msgURI ) ; msgService.CopyMessage ( msgURI , mailHops.StreamListener , false , null , msgWindow , {} ) ; @@ -250,7 +258,7 @@ var regexAllIp = /(1\d{0,2}|2(?:[0-4]\d{0,1}|[6789]|5[0-5]?)?|[3-9]\d?|0)\.(1\d{ all_ips.unshift( ip[0] ); } if ( all_ips.length != 0 ){ - mailHops.lookup ( all_ips ) ; + mailHops.lookupRoute ( all_ips ) ; } else { mailHops.displayResult(); } @@ -279,9 +287,9 @@ mailHops.testIP = function(ip,header){ //check if this IP was part of a secure transmission if(retval){ if(header.indexOf('using SSL') != -1) - mailHops.message.secure.push(ip+':'+header.substring(header.indexOf('using SSL'),11)); + mailHops.message.secure.push(ip+':'+header.substring(header.indexOf('using SSL'),header.indexOf('using TLS')+11)); else if(header.indexOf('using TLS') != -1) - mailHops.message.secure.push(ip+':'+header.substring(header.indexOf('using TLS'),11)); + mailHops.message.secure.push(ip+':'+header.substring(header.indexOf('using TLS'),header.indexOf('using TLS')+11)); else if(header.indexOf('version=TLSv1/SSLv3') != -1) mailHops.message.secure.push(ip+':'+'using TLSv1/SSLv3'); } @@ -576,8 +584,13 @@ mailHops.displayResult = function ( header_route, response, meta, lookup_url ){ document.getElementById('dataPaneMailHopsMetaContainer').style.display='none'; } - if(response){ + if(response && response.route && response.route.length > 0){ + if(mailHops.options.client_location){ + var client_location = JSON.parse(mailHops.options.client_location); + response.route.push(client_location.route[0]); + } + for(var i=0; i + @@ -75,9 +76,22 @@ + + + + + + Your location is cached to reduce the number of lookups by one. + + + + diff --git a/chrome/skin/classic/mailhops.css b/chrome/skin/classic/mailhops.css index ed28af7..45814e2 100644 --- a/chrome/skin/classic/mailhops.css +++ b/chrome/skin/classic/mailhops.css @@ -85,4 +85,6 @@ #mailhopsDataPaneMeta label{ padding-left: 20px; -} \ No newline at end of file +} + +#mhTabs .act { padding-left: 20px; background-repeat: no-repeat; outline : none;} \ No newline at end of file diff --git a/install.rdf b/install.rdf index 2944f98..f1c15a1 100644 --- a/install.rdf +++ b/install.rdf @@ -7,7 +7,7 @@ postbox@mailhops.com 2 MailHops - 0.7.1 + 0.8 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-0.7.1-pb.xpi b/mailhops-0.7.1-pb.xpi index a4a8946..f2c3d5a 100644 Binary files a/mailhops-0.7.1-pb.xpi and b/mailhops-0.7.1-pb.xpi differ diff --git a/mailhops-0.8-pb.xpi b/mailhops-0.8-pb.xpi new file mode 100644 index 0000000..7957660 Binary files /dev/null and b/mailhops-0.8-pb.xpi differ