7

The History API makes it possible to store a state object in the browser history. Now try this demo (but it's the same behavior with any other else, pick your favorite :)):

  1. Click on some links to build some history
  2. Clear your browser history (full, or just for this site)
  3. You are still able to walk through the history

I expected that clearing the history would have an impact, but it's not the case...
Can someone explain this behavior ?

Jocelyn LECOMTE
  • 830
  • 1
  • 7
  • 15

2 Answers2

1

The history.pushState() method

"The state object can be anything that can be serialized. Because Firefox saves state objects to the user's disk so they can be restored after the user restarts her browser, we impose a size limit of 640k characters on the serialized representation of a state object. If you pass a state object whose serialized representation is larger than this to pushState(), the method will throw an exception. If you need more space than this, you're encouraged to use sessionStorage and/or localStorage."

Reference: https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history

Rahen Rangan
  • 705
  • 5
  • 8
1

OK it seems I got too much focused on the history API. I finally tried to do the same things (building history on any site, then clearing the history), and it's the same behavior: still able to go back and forth.
So my understanding is that clearing history doesn't really clear the history of an open tab: it just disappears from the list, but not from the real history until the tab is closed.

Jocelyn LECOMTE
  • 830
  • 1
  • 7
  • 15