SilentDev
SilentDev

Reputation: 22777

How to view javascript HTML5 localstorage?

I'm looking at JS code that uses localStorage.getItem() and localStorage.setItem(). It's storing items somewhere, but I can't find out where.

When I go here (using Mac Chrome):

~/Library/Application Support/Google/Chrome/Default/Local Storage/

there is leveldb but I can't find where the exact items are being stored.

This is the exact code:

if (!localStorage.getItem('myapp')){
    localStorage.setItem('myapp', JSON.stringify({next: 0, items: []}));
}

Upvotes: 0

Views: 850

Answers (1)

Daniel
Daniel

Reputation: 8687

For example in Google Chrome:

1) open console.

2) go to the Application

3) open storage -> local storage

4) you should see a table with keys and values

enter image description here

If you asking about "when it is stored on computer disc" it depends from browser and system:

How is HTML5 WebStorage data physically stored?

Where does PERSISTENT file system storage store with chrome?

Where in the filesystem does IE8 store values stored in localStorage?

Upvotes: 2

Related Questions