From ce1535280a2a126419cb230f1e573435fb34e931 Mon Sep 17 00:00:00 2001 From: Mavis Ou Date: Fri, 16 Aug 2013 16:51:30 -0700 Subject: [PATCH] fixed visited sites counter & trackers counter --- data/aggregate.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/data/aggregate.js b/data/aggregate.js index 99da005..7684828 100644 --- a/data/aggregate.js +++ b/data/aggregate.js @@ -151,6 +151,12 @@ function onConnection(conn){ // Retrieve the source node and update, or create it if not found if (aggregate.nodemap[connection.source]){ sourcenode = aggregate.nodemap[connection.source]; + if (connection.sourceVisited && sourcenode.nodeType == "thirdparty"){ + // the previously "thirdparty" site has now become a "visited" site + // +1 on visited sites counter and -1 on trackers counter + aggregate.siteCount++; + aggregate.trackerCount--; + } sourcenode.update(connection, true); }else{ sourcenode = new GraphNode(connection, true);