Open McBen opened 3 years ago
Alternative solution: simple storage management plugin.
In theory your expiration feature could be easier for end-user, but I'm not sure that proposed scheme is general enough to handle all the cases in expected way.
E.g. what if I have some rarely used plugin, but still don't want to loose any data after year of idle.
One more idea. It would be good if we have not raw localStorage keys/values, but also some metadata, to let easily identify related plugin. It will not harm if plugin has (optional) possibility to specify expiration date as well.
My few bits regarding this - I'd say it's impossible to enforce plugins doing this. As we all likely know, due to the nature of the IITC plugin ecosystem, it's near impossible to deprecate things and enforce usage of new APIs in all plugins. What I think would be possible to do in this case:
navigator.storage.persist()
, check by navigator.permissions.query({name:"persistent-storage"}).then(console.log)
-> when browser global limits are reached, "best-effort" stored origins are cleared first, then user is asked which persistent origins to clean upnavigator.storage.estimate().then(console.log)
on startup and warn user if quota is xx% full, possibly with some enumeration which keys use most space (plugin names will probably be obvious from that) and allow selective cleanup. A telemetry on this would be great (2.1 MB out of 2 GB used for me on firefox), but I suppose that was discussed many times and denied with opsec and privacy concerns (also there was some spyware affair iirc)
- make IITC storage persistent [...]
- monitor available storage [...]
That may be good in general, but will not help with localStorage
at all.
Many plugins (stock or 3rd-party) store data on the user device. All localstorage or DB stuff will stay there forever. In a really bad case it could fill up the whole web-storage space.
It's hard to detect if a plugin is still installed and it's impossible to detect if a plugin is just deactivated for a while.
Let me propose a 'expire' date for all data?
registerVariable
to increase the expire date