Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

can anyone explain the browser bug they are leveraging?


Not really a browser bug:

   <style>
   .first:visited {background:url(visited-ycombinator.png)}
   .second:visited {background:url(visited-twitter.png)}
   #layer {text-indent:-10000px}
   </style>
   <div id="layer">
      <a href="http://news.ycombinator.com/ class="first">first</a>
      <a href="http://www.twitter.com// class="second">second</a>
   </div>
That code will hit a PNG file if you visited the link. Now just replace the PNG for a pixel beacon which logs every hit and it's done.


It's using the :visited css pseudo-class. If you put visited link in a different color in your css, you can then check what is the current color of the link with Javascript, and from that infer wether the link has been visited or not




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: