TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Javascript, AJAX, E4X (http://www.talkphp.com/javascript-ajax-e4x/)
-   -   The Perfect Trick for Prying Eyes (http://www.talkphp.com/javascript-ajax-e4x/1386-perfect-trick-prying-eyes.html)

Wildhoney 11-05-2007 10:33 PM

The Perfect Trick for Prying Eyes
 
Let's face it, without getting all philosophical on the subject, marketing is everywhere these days. It's literally in our faces. In 20 years I wouldn't be surprised if a small flying drone followed us around with a television screen implanted in it, providing custom adverts for us to see, based on our consumerism patterns. This little trick, achieved using Javascript, allows you to essentially build an entire profile on your visitors. You can see which websites they've been to and act accordingly.

I'm confident we're all familiar with the Internet's default blue colour for links, I'm sure it once had a dedicated Wikipedia page but I'm unable to locate it now. I was going to throw some hints like the fact TalkPHP doesn't yet have a Wikipedia page - wink, wink, nudge, nudge, and all that. Even though it seems to have been stripped of its Wikipedia page for one reason or another, it's still perhaps the most popular colour on the Internet these days.

For those of you who I've left far behind with the previous paragraph - this is the famous blue!

...And for those of you who are quite fond of the default blue colour, don't worry, it's not the culprit. However, it is part of the problem in the sense that browsers take-over the colours. The default blue is used for links that have not been visited, whilst links that have been visited turn a nice purple colour by default. Consider the following link:

Code:

<a href="http://www.google.com/">Google.com</a>
If you've visited Google.com before then without any styles applied, this link colour would appear purple to you, whereas it would be blue if you haven't. Using a crafty bit of Javascript we can ascertain whether or not you visited a website by detecting the purple colour. The following code works in Firefox, I have not exerted myself to make it cross-compatible.

PHP Code:

<script type="text/javascript">
    
    var 
pA document.getElementsByTagName('a');
    
    for(
iIndex 0iIndex pA.lengthiIndex++)
    {
        var 
szColor document.defaultView.getComputedStyle(pA[iIndex], null).getPropertyValue('color');
        
        
alert(szColor == 'rgb(85, 26, 139)' 'Visited' 'Not Visited');
    }

</script> 

What the above code does is obtains every single a element from the website, and check whether or not you've visited that page before. If you have then it will pop-up with a message box saying Visited. However, if you've never been to the destination before, it will say Not Visited. Good, eh?

Naturally, there are copious amounts of uses for such a technique. How about these possibilities:
  1. Allow law enforcement bodies to detect if you've been to a website, and in turn a page on that website where you need to be logged in, which is serving illegal content.
  2. Allow marketers to build a comprehensive profile of your surfing habits by using the power of AJAX to log its findings in to a database.
  3. Allow such sites as Digg and Reddit to detect if you've been to a website, such as Subvert and Profit, and accessed a page on there to which you need to be logged in to view.

As you can clearly see from the above list. Each outcome would have its negative downsides. For point 1, you could subsequently be monitored and then arrested. Point 2, your personal surfing habits could be logged and sold on. Point 3, your Digg and/or Reddit account will be banned.

So the next time you think you're invincible on the Internet, think again. If you're extremely paranoid about this little trick being used against you, then the best way to combat it is to instruct your browser not to cache any data, as well as your surfing habits, that way all links will be blue, and remember, a blue link is now a good link! Well, purple was always a very mystic colour anyway!


All times are GMT. The time now is 06:09 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0