1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Readout the Browser History?

Discussion in 'HTML & JavaScript' started by 0NYX2, Feb 18, 2012.

  1. 0NYX2

    0NYX2 Newbie

    Joined:
    Jul 24, 2011
    Messages:
    12
    Likes Received:
    1
    Location:
    Germany
    Hello,

    i know, that in the past it was possible to read out the Browser history with a simple javascript like this:

    Code:
    //when the page is ready
    $(document).ready(function() {
      //the list of domains to check and an array which will store hits
      var domains = ['list','of','domains'];
      var visited = [];
      //for every domain...
      $.each(domains,function() {
        //inject a link into page
        var a = $('<a></a>').attr({
          href: 'h.t.t-.p://' + this,
          'class': 'checkme'
        }).appendTo(document.body);
        //check the color of the link
    	alert($(a).css('color'));
        if($(a).css('color') == '#ff0000' || $(a).css('color') == 'rgb(255, 0, 0)') { //either format of color
          alert('lol');
    	  $(a).addClass('highlight');
          visited.push(this);
        }
        //remove from the page -- no longer need the links
        a.remove();
      });
      if(visited.length) {
        //save via ajax!  shady!
        //display items on the page based on "hits"
      }
    });
    But this Code doese not work anymore.
    Have someone of you an idea / solution to read out the Browser History?
     
  2. Grizzy

    Grizzy Senior Member

    Joined:
    Nov 11, 2008
    Messages:
    919
    Likes Received:
    999
    I believe most browsers have finally plugged the :visited selector hack.

    I remember hearing about a cache timing attack not too long ago. Maybe check that out.