title: Accessing a user's history using JS
body: <p><strong>I'm not looking for code/how to. Just knowledge.</strong></p>
  
  <p>A client has just come to us with a question: Can we access the user's history from within a banner advert to give them some targeted advertising based on their history.</p>
  
  <p>Obviously, this <strong>presents a privacy issue</strong>, but I need to give a good case for why it is technically not a viable option.</p>
  
  <p>So I have a few questions...</p>
  
  <ol>
  <li>Which browsers <em>still</em>, if any, support accessing a user's history, using <code>window.history</code>.</li>
  <li>If some do and some don't. When did those who don't allow it stop allowing it?</li>
  <li>If all browsers allow it (I have yet to find a script that works), why is it not commonly used?</li>
  </ol>
  
  <p>Finally,
  Having been on Amazon.co.uk, I then go to Macrumors.com and the adverts give me adverts based on products I have bought/looked at. I'm guessing this is just based on cookies/a system that amazon has implemented?</p>
  
  <p><strong>Just to make things clear:</strong></p>
  
  <ul>
  <li>I know it is a privacy issue. I am not looking for code/a way to do it (as I mentioned above)</li>
  <li>There are ways to "sniff" for visited links within a page.</li>
  <li>There used to be a way using the JavaScript <code>history</code> object, to list all the objects within your history (from the current site). <code>history.length</code> still works now. I seem to remember some browsers only returning <code>undefined</code> for each item, some returning them as an unreadable <code>object</code>.</li>
  </ul>