Saturday, June 13, 2009

Mass Browser History Sniffing with Javascript

For a long while, I have known about that feature/flaw in browsers which allows you to sniff a user's history. Any examples I've seen are rather selective about which pages can be detected. It seems great to detect user's feed aggregators and offer them suitable subscription buttons, as Niall Kennedy showed.

However, I have been more interested in finding all websites a user visits. Only then does it become unconstrained by its application. It can now be used to find out what types of websites a user visits and provide targeted advertisements or services, based on a less boolean-logical approach.

So, I set on a little investigation while I had five minutes to spare and came up with this:


It's a clever piece of Javascript (if I may say so myself) which will check lots of links to see if they have been visited. This is how my "checker" works:

1. It checks to see whether the user has visited the homepage of the most popular websites.
2. Then, if the user has visited a homepage, an AJAX request downloads a list of the most popular pages from that site. For each page, it checks if the user has visited it.
3. It then stores this information and does some analysis to see what types of websites users like to visit (profiling). In the demo, it will just output the pages into a list.

You can try it out for yourself: View the Demo

Source

No comments: