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

I would like to see more tools to see what is stored inside localStorage. Right now, afaik, there is not easy way to inspect.


  for( var i = localStorage.length - 1; i >= 0; --i ){
     var key = localStorage.key(i);
     console.log( key + ": " + localStorage.getItem(key) );
  }


It is a sqlite database (in Google Chrome and Firefox), so with the sqlite console you can access the database.


Tip: To get a random localStorage key:

    localStorage.key(Math.random()*localStorage.length)


Chrome DevTools and Safari (and I am sure FF) have had tools for a long time to see inside localStorage. It is inspection tools for IndexedDB we haven't got.


Actually according to http://peter.sh/2012/02/scoped-styles-deflated-websockets-an... we now have IndexedDB inspection in the latest Chromium (behind a flag).


> and I am sure FF

It's pretty primitive, you have to go into the DOM tab for `window` and scroll down to `localStorage`.

Same for `globalStorage`.




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

Search: