简体   繁体   English

如何查看JavaScript HTML5 localstorage?

[英]How to view javascript HTML5 localstorage?

I'm looking at JS code that uses localStorage.getItem() and localStorage.setItem() . 我正在查看使用localStorage.getItem()localStorage.setItem() JS代码。 It's storing items somewhere, but I can't find out where. 它将物品存储在某个地方,但我找不到位置。

When I go here (using Mac Chrome): 当我去这里(使用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. leveldb但我找不到确切的项目存储在哪里。

This is the exact code: 这是确切的代码:

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

For example in Google Chrome: 例如在谷歌浏览器中:

1) open console. 1)打开控制台。

2) go to the Application 2)转到应用程序

3) open storage -> local storage 3)打开存储->本地存储

4) you should see a table with keys and values 4)您应该看到包含键和值的表格

在此处输入图片说明

If you asking about "when it is stored on computer disc" it depends from browser and system: 如果您询问“何时将其存储在计算机磁盘上”,则取决于浏览器和系统:

How is HTML5 WebStorage data physically stored? HTML5 WebStorage数据如何物理存储?

Where does PERSISTENT file system storage store with chrome? PERSISTENT文件系统存储设备在哪里存储Chrome?

Where in the filesystem does IE8 store values stored in localStorage? IE8在文件系统中的哪个位置存储存储在localStorage中的值?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM