Saturday, January 30, 2010

I know what you read on dzone last summer

You should know that depending upon how CSS is coloring your links; I can figure out that what are the links you visited already.
This is a nice hack, many people use it for knowing user interests e.g
  • What social networking site you use.
  • What banking site you use.
  • And many more what you can think of.
I have created a hack to show all popular links from dzone, I am sorting the links based what you have read already. Before you read further Check This, (will not work in IE8)

Here is how you can inspect CSS color of a link in your browser


document.write('<style>');
document.write('
#linkID:visited {color: #FF0000;}");
document.write('
</style>');

/* quickly add and remove the link from the DOM with enough time to save the visible computed color. */
document.body.appendChild(link);
var color = document.defaultView.getComputedStyle(
link,null).getPropertyValue("color");
document.body.removeChild(link);

/* check to see if the link has been visited if the computed color is red */
if (
color == "rgb(255, 0, 0)") {

/*visited do something*/

}
else {

/*not visited, do something else*/

}




Read More about How I brought All Dzone links on 1 page

Read More About How This CSS hack works?

Read Rest of My Hacks


No comments:

Post a Comment