Page 1 of 1

How to clear localStorage after deleting an Extension?

Posted: Sun Oct 06, 2019 1:31 pm
by Vlad
Hello, my question is how do I delete a localStorage content after deleting an Extension for CC2015 and higher?
I realized that after I deleted the Extension the local storage is sill present. I know that I can clear it through the CSInterface but that is not what I want because I want to clear it, for example, after deleting an application.
Can I delete some folder on the file system where the extension stored some data? Any thought?
Thankful in advance.

Re: How to clear localStorage after deleting an Extension?

Posted: Mon Oct 07, 2019 10:23 am
by Kukurykus
Write a script that is going to delete desired folder. The extension must asynchronous way run such evalScript, while the next command should be to close extension. This way the local storage folder normally used by extension when it's working, won't be used at the attepmt of deleting it.

Re: How to clear localStorage after deleting an Extension?

Posted: Mon Oct 07, 2019 11:05 am
by Vlad
Thank you for the answer, Marek.
This will be no problem if I would know where this folder(data) sits in the file system Win/macOS.
As you said, for now, I can only delete it with a script within Photoshop. But if, say, I have the ability to uninstall the app through the standard Windows uninstaller that would not trigger the script. The app just will be deleted and that's it, the local storage is still there. And after the second installation, the app just hops up the old data. Where those nasty files sit, that's the question. :) I found a folder that might resemble the local storage but it seems like it combines all storages from all the extensions installed(don't know if true/false).

Re: How to clear localStorage after deleting an Extension?

Posted: Thu Oct 10, 2019 2:06 pm
by Kukurykus
Please tell me which folder you found that might hold localstorage for all extensions, what is path on Windows to it?

Anyway that you look for you should find inside your extension folder at end of this path: C:\Users\User\AppData\Local\Temp\cep_cache

Re: How to clear localStorage after deleting an Extension?

Posted: Sat Oct 12, 2019 5:14 pm
by Vlad
Thank you, Marek, this is exactly what I was looking for.
In macOS this path is /Users/username/Library/Caches/CSXS/cep_cache/.
What's more, I found one more issue regarding this type of storing data. If someone using such a program like CleanMyMac or CleanMyPC.
These programs clean the system cache and accordingly cleaning the necessary local storage data. And so, if someone likes to clean its system all the time, that this is might be another problem.
Once again, thank you for the tip-off.