【发布时间】:2019-06-20 22:05:56
【问题描述】:
我正在查看使用 localStorage.getItem() 和 localStorage.setItem() 的 JS 代码。它在某处存放物品,但我不知道在哪里。
当我去这里时(使用 Mac Chrome):
~/Library/Application Support/Google/Chrome/Default/Local Storage/
有leveldb,但我找不到确切的存储位置。
这是确切的代码:
if (!localStorage.getItem('myapp')){
localStorage.setItem('myapp', JSON.stringify({next: 0, items: []}));
}
【问题讨论】:
-
在 Chrome 的开发者工具中,Tab Application 有它。
-
@Our_Benefactors 啊,是的.. 它看起来像正确的目录.. OP:你是说那个目录中没有文件?
-
@Keith 有 .ldb 文件、清单文件和日志文件。它是 .ldb 文件之一吗? (我必须把所有这些都看一遍,找到通过JS代码设置的那个?)
-
@Keith Alex 提供了一个很好的链接,丹尼尔在下面回答了它。他们的回答正是我所需要的。谢谢。
标签: javascript google-chrome local-storage google-chrome-storage