How to clear localStorage after deleting an Extension?

General Discussion of Scripting for Flex, Flash & CS SDK

Moderators: xbytor, DavideBarranca, Paul MR

Post Reply
Vlad
Posts: 5
Joined: Wed May 23, 2018 9:10 am

How to clear localStorage after deleting an Extension?

Post by Vlad » Sun Oct 06, 2019 1:31 pm

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.

User avatar
Kukurykus
Posts: 209
Joined: Mon Jul 25, 2016 12:36 pm

Re: How to clear localStorage after deleting an Extension?

Post by Kukurykus » Mon Oct 07, 2019 10:23 am

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.

Vlad
Posts: 5
Joined: Wed May 23, 2018 9:10 am

Re: How to clear localStorage after deleting an Extension?

Post by Vlad » Mon Oct 07, 2019 11:05 am

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).

User avatar
Kukurykus
Posts: 209
Joined: Mon Jul 25, 2016 12:36 pm

Re: How to clear localStorage after deleting an Extension?

Post by Kukurykus » Thu Oct 10, 2019 2:06 pm

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

Vlad
Posts: 5
Joined: Wed May 23, 2018 9:10 am

Re: How to clear localStorage after deleting an Extension?

Post by Vlad » Sat Oct 12, 2019 5:14 pm

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.

Post Reply