Home  >  Article  >  Web Front-end  >  Detailed explanation of physical storage instances of localStorage in nw.js

Detailed explanation of physical storage instances of localStorage in nw.js

零下一度
零下一度Original
2017-06-28 10:31:122535browse

Preface

Because we are working on the nw.js shell project for Meituan’s takeaway merchants, we need to ensure that the data using localStorage in the shell can be persisted.
I found that nw can be saved, even if the application is deleted and rewritten and packaged, it can be saved, so this requirement is solved, but you still need to know where it is stored, otherwise it is not clear under what circumstances the data will be lost.

Storage location

The localStorage storage directory of the application packaged by nw.js is:
**C:\Users\[user name]\AppData\Local\[nw application Name]\User Data\Default\Local Storage\chrome-extension_[Random characters]_0.localstorage**

For example, the location on my computer is:
C:\Users\xxcanghai\AppData\ Local\waimai_e_client_nw\User Data\Default\Local Storage\chrome-extension_blodpelipeilefodephhjbnidgkbghmj_0.localstorage

Detailed explanation of physical storage instances of localStorage in nw.js

Opening method

This localStorage file is a binary file and cannot be used directly A text editor opens, but can be accessed via a binary file viewer.
For example, I set a localStorage value in the nw application: xxcanghai 123
Detailed explanation of physical storage instances of localStorage in nw.js

Then use the hexadecimal editor WinHexOpen the chrome-extension_blodpelipeilefodephhjbnidgkbghmj_0.localstorage file, you can view the stored xxcanghai and 123
Detailed explanation of physical storage instances of localStorage in nw.js

Attached to other browsers localStorage Storage location

Firefox

Firefox stores the localstorage file:webappsstore.sqlite in the configuration file folder
Firefox (Windows XP):
C:\Documents and Settings\\Application Data\Mozilla\Firefox\Profiles\

The above is the detailed content of Detailed explanation of physical storage instances of localStorage in nw.js. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn