mozilla/collusion — pull request #108 by jonoxia (2012-10-08 06:25:38+00:00)
Title: Fix for Issue #6 (first attempt)

Hey Dethe,
Here's a first pass at a fix for bug 6. The tab.ready() listener now looks at the history of the tab -- if the last two sites are A and B, then it knows you navigated from A to B, and it adds the "user_navigation" datatype to that link. The grapher simply doesn't display any links with "user_navigation" as a datatype.

This is not strictly correct, since it's possible that something made a tracking connection between A and B AND the user manually navigated between them. The new behavior will be to not show the link, when really we would like to show it. But this is still better than nothing?

The way this is implemented is not the most elegant -- I had to dip into XPCOM to examine the tab history, and then interate through the simpleEnumerator to get all the items even though I only want the next-to-last one. If you know of a better way, I'm open to suggestions.

Manual test case: go to mozilla.com. Click the link to Twitter at the bottom of the page. Open the Collusion graph: observe there's no link from Mozilla to Twitter.