html5教程-在html5中,使用localStorage存储的数据放在哪个文件里?

发布时间:2018-12-12 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了html5教程-在html5中,使用localStorage存储的数据放在哪个文件里?脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
小宝典致力于为广大程序猿(媛)提供高品质的代码服务,请大家多多光顾小站,小宝典在此谢过。

自己在做博客系统中保存博文功能的时候,想用localStorage来存储博文,但是突然想了解localStorage究竟把数据持久化在哪里了,于是查阅一番资料后找到了文件夹路径:

C:/Users/unive/AppData/Local/Google/Chrome/User Data/Default/Local Storage

但随后发现一个问题:

html5教程-在html5中,使用localStorage存储的数据放在哪个文件里?

为什么最新的修改日期都是2017年?存放数据的文件到底在哪里?

找了一会才发现地方---就是该文件夹下有个leveldb文件夹,点进去后有个001531.log文件(我的是这个名字)

因为修改日期是最新的,所以也就确定其数据是存放在了这里面:

html5教程-在html5中,使用localStorage存储的数据放在哪个文件里?

然后写一个页面测试一下:

html5教程-在html5中,使用localStorage存储的数据放在哪个文件里?

测试完后打开该log文件,搜索123456789,成功找到:

html5教程-在html5中,使用localStorage存储的数据放在哪个文件里?

关于该log文件,其实它还存放了很多个人百度搜索的内容,以及你访问过哪些网站,可以去看一下。

最后,关于不同浏览器下localStorage存储的路径如下:

Firefox

Firefox stores localstorage inwebappsstore.sqlitefile in theprofilefolder.

Firefox (Windows XP):

 C:/Documents and Settings//Application Data/Mozilla/Firefox/Profiles//webappsstore.sqlite 

Firefox (Windows Vista and above):

 C:/Users//AppData/Roaming/Mozilla/Firefox/Profiles//webappsstore.sqlite 

or:

 %APPDATA%/Mozilla/Firefox/Profiles//webappsstore.sqlite 

Firefox on linux:

 ~/.mozilla/firefox//webappsstore.sqlite 

Firefox on mac:

 ~/Library/Application Support/Firefox/Profiles//webappsstore.sqlite 

or:

 ~/Library/Mozilla/Firefox/Profiles//webappsstore.sqlite 

Chrome

Chrome stores in separate files inside theLocal Storagedirectory.

Chrome on windows:

 %LocalAppData%/Google/Chrome/User Data/Default/Local Storage/ 

Chrome on linux:

 ~/.config/google-chrome/Default/Local Storage/ 

Chrome on mac:

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

commonly:

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

Internet explorer:

I am a bit unsure, but think this will do the trick

 %userprofile%/AppData/LocalLow/Microsoft/Internet Explorer/DOMStorage 

Opera

As said by OammieR:

 C:/Users/Administrator/AppData/Roaming/Opera/Opera/sessions/autosave.win 

or as said by Kevin Hakanson:

 C:/Users/Administrator/AppData/Local/Opera/Opera/pstorage/

自己在做博客系统中保存博文功能的时候,想用localStorage来存储博文,但是突然想了解localStorage究竟把数据持久化在哪里了,于是查阅一番资料后找到了文件夹路径:

C:/Users/unive/AppData/Local/Google/Chrome/User Data/Default/Local Storage

但随后发现一个问题:

html5教程-在html5中,使用localStorage存储的数据放在哪个文件里?

为什么最新的修改日期都是2017年?存放数据的文件到底在哪里?

找了一会才发现地方---就是该文件夹下有个leveldb文件夹,点进去后有个001531.log文件(我的是这个名字)

因为修改日期是最新的,所以也就确定其数据是存放在了这里面:

html5教程-在html5中,使用localStorage存储的数据放在哪个文件里?

然后写一个页面测试一下:

html5教程-在html5中,使用localStorage存储的数据放在哪个文件里?

测试完后打开该log文件,搜索123456789,成功找到:

html5教程-在html5中,使用localStorage存储的数据放在哪个文件里?

关于该log文件,其实它还存放了很多个人百度搜索的内容,以及你访问过哪些网站,可以去看一下。

最后,关于不同浏览器下localStorage存储的路径如下:

Firefox

Firefox stores localstorage inwebappsstore.sqlitefile in theprofilefolder.

Firefox (Windows XP):

 C:/Documents and Settings//Application Data/Mozilla/Firefox/Profiles//webappsstore.sqlite 

Firefox (Windows Vista and above):

 C:/Users//AppData/Roaming/Mozilla/Firefox/Profiles//webappsstore.sqlite 

or:

 %APPDATA%/Mozilla/Firefox/Profiles//webappsstore.sqlite 

Firefox on linux:

 ~/.mozilla/firefox//webappsstore.sqlite 

Firefox on mac:

 ~/Library/Application Support/Firefox/Profiles//webappsstore.sqlite 

or:

 ~/Library/Mozilla/Firefox/Profiles//webappsstore.sqlite 

Chrome

Chrome stores in separate files inside theLocal Storagedirectory.

Chrome on windows:

 %LocalAppData%/Google/Chrome/User Data/Default/Local Storage/ 

Chrome on linux:

 ~/.config/google-chrome/Default/Local Storage/ 

Chrome on mac:

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

commonly:

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

Internet explorer:

I am a bit unsure, but think this will do the trick

 %userprofile%/AppData/LocalLow/Microsoft/Internet Explorer/DOMStorage 

Opera

As said by OammieR:

 C:/Users/Administrator/AppData/Roaming/Opera/Opera/sessions/autosave.win 

or as said by Kevin Hakanson:

 C:/Users/Administrator/AppData/Local/Opera/Opera/pstorage/

觉得可用,就经常来吧! 脚本宝典 欢迎评论哦! html5教程,巧夺天工,精雕玉琢。小宝典献丑了!

脚本宝典总结

以上是脚本宝典为你收集整理的html5教程-在html5中,使用localStorage存储的数据放在哪个文件里?全部内容,希望文章能够帮你解决html5教程-在html5中,使用localStorage存储的数据放在哪个文件里?所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签:HTML