序的sessionStorage和localStorage存储在

序的sessionStorage和localStorage存储在

本文介绍了电子应用程序的sessionStorage和localStorage存储在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行一个电子应用程序,在该应用程序的渲染过程中,我使用HTML5 localStorage.
我想知道此localStorage实际上存储在文件系统中的什么位置(我相信它是SQLite格式的).
我看到了将浏览器 localStorage存储在哪里的答案: sessionStorage和localStorage存储在哪里?

我之所以这样问,是因为我希望能够运行该电子应用程序的2个实例,以便每个应用程序都具有不同设置,我将这些设置保存在localStorage中.
具体来说,我对Windows 10最为感兴趣,但是包装所有操作系统的答案都很棒.

I am running an electron app, where in its renderer process I use HTML5 localStorage.
I'm interested to know where in my file-system is this localStorage actually stored (I believe it is in SQLite format).
I saw the answer for where is a browser localStorage stored, here:Where the sessionStorage and localStorage stored?

I'm asking this because I would like to be able to run 2 instances of this electron application, so that each application will have different settings in which I save in localStorage.
Specifically I'm most interested in windows 10, but an answer wrapping all OS will be great.

推荐答案

它存储在AppData文件夹中,您可以通过查看require('app').getPath('userData')的值来找到它.

It's stored in the AppData folder, which you can find by looking at the value of require('app').getPath('userData').

这意味着即使删除了该应用程序,数据也仍然存在.如果您正在运行两个实例,则需要找到某种区分它们的方法,以免它们破坏彼此的数据.

This means the data persists even if the app is deleted. If you're running two instances, you'll need to find some way of distinguishing between them so they don't trample on each other's data.

这篇关于电子应用程序的sessionStorage和localStorage存储在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 00:44