NW.js Local Storage Cache Still Persists Even After App Uninstallation

Viewed 711

In my NW.js app, I store some data in the Local Storage. Now I want to delete the app and surely the Local Storage data as well. I move the app to the trash and clean it up. Also, I delete cache information related to the app located in /Users/<username>/Library/Caches/<yourmagicapp>.

But unfortunately, all this doesn't help. After building a new copy of the app and shipping it to the macOS Application folder the Local Storage data restores from somewhere like it never has been deleted at all. All the data still here.

The question is how to delete all the stored data and where does it sit? Or at least from where to read about it because I couldn't find information in the nw.js official docs. Thank you.

2 Answers

You can find the location of the local app data on any OS by doing console.log(nw.App.dataPath);. This folder is created automatically by Chromium and exists separately from your app in a user account specific location. When you delete the app, this folder remains because it may contain settings, in case you reinstall it or replace it with a newer version of the app.

In macOS to reset your NW.js app Local Storage manually you need to delete the next folder:

/Users/<userName>/Library/ApplicationSupport/<yourAppName>/Default/Local Storage

After deleting this folder your NW.js app local storage will be reset.

In the Default folder, you can also find Session Storage and IndexedDB folders as well, in case you need to reset different data.

To remove all the data of your app you can also delete a folder located here:

/Users/<userName>/Library/Caches/<yourAppName>
Related