HTML5 Local Storage management

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
User avatar
Tomaso
Board Warrior
Board Warrior
Posts: 1622
Joined: 2015-07-23, 16:09
Location: Norway

HTML5 Local Storage management

Unread post by Tomaso » 2017-07-19, 17:51

Would it be possible to change the 'HTML5 Local Storage' feature, to something like the one for 'Offline Web Content and User Data'..
thereby having a manageable list of sites that are allowed to store this type of data?

The current setting is just enable and disable (dom.storage.enabled = true/false), with the only option to limit the max amount of data per domain (dom.storage.default_quota).
This doesn't leave us with a whole lot of user control.

User avatar
Tomaso
Board Warrior
Board Warrior
Posts: 1622
Joined: 2015-07-23, 16:09
Location: Norway

Re: HTML5 Local Storage management

Unread post by Tomaso » 2017-09-20, 15:16

If the feature that I suggested above requires too much work, then could you at least add this option?:

Image

dark_moon

Re: HTML5 Local Storage management

Unread post by dark_moon » 2017-09-20, 19:29

Would be a nice feature! :thumbup:

coffeebreak
Moon Magic practitioner
Moon Magic practitioner
Posts: 2986
Joined: 2015-09-26, 04:51
Location: U.S.

Re: HTML5 Local Storage management

Unread post by coffeebreak » 2017-09-20, 20:32

Yes! It would be a terrific feature. Please consider it!

JustOff

Re: HTML5 Local Storage management

Unread post by JustOff » 2017-09-20, 20:56

What do you mean by 'HTML5 Local Storage'? Both sessionStorage and localStorage are removed from the browser along with cookies when 'Cookies' is selected in 'Settings for Clearing History'.

User avatar
Tomaso
Board Warrior
Board Warrior
Posts: 1622
Joined: 2015-07-23, 16:09
Location: Norway

Re: HTML5 Local Storage management

Unread post by Tomaso » 2017-09-20, 21:11

HTML5 Local Storage (a.k.a 'Web storage' / 'DOM storage'):
https://en.wikipedia.org/wiki/Web_storage
https://www.w3schools.com/html/html5_webstorage.asp

The data remains in these folders, regardless of PM's settings for clearing history:
C:\Users\*****\AppData\Roaming\Moonchild Productions\Pale Moon\Profiles\*****.default\storage\default
C:\Users\*****\AppData\Roaming\Moonchild Productions\Pale Moon\Profiles\*****.default\storage\temporary

AFAICT, this is directly related:
viewtopic.php?f=3&t=16736/
Be sure to check out the article that dark_moon linked to in the 9th post of that thread.
The third screenshot in that article shows a typical example of how this type of data remains in the folders that I mentioned.

JustOff

Re: HTML5 Local Storage management

Unread post by JustOff » 2017-09-20, 21:24

Tomaso wrote:The data remains in these folders, regardless of PM's settings for clearing history:
C:\Users\*****\AppData\Roaming\Moonchild Productions\Pale Moon\Profiles\*****.default\storage\default
C:\Users\*****\AppData\Roaming\Moonchild Productions\Pale Moon\Profiles\*****.default\storage\temporary
Well, this is not 'HTML5 Local Storage', there are IndexedDB databases, asm.js cache and similar data from websites you visited and add-ons you installed (see Storage_API for details).

User avatar
Tomaso
Board Warrior
Board Warrior
Posts: 1622
Joined: 2015-07-23, 16:09
Location: Norway

Re: HTML5 Local Storage management

Unread post by Tomaso » 2017-09-20, 21:32

Hmm..
When messing around with this stuff a while ago, I think that disabling HTML5 Local Storage (dom.storage.enabled = false) prevented this data from being created.
I had to enable it again though, because it broke video playback at certain sites.

coffeebreak
Moon Magic practitioner
Moon Magic practitioner
Posts: 2986
Joined: 2015-09-26, 04:51
Location: U.S.

Re: HTML5 Local Storage management

Unread post by coffeebreak » 2017-09-20, 21:41

Tomaso wrote:Be sure to check out the article that dark_moon linked to in the 9th post of that thread.

There is this gHacks article on clearing local storage: https://www.ghacks.net/2015/02/05/how-to-clear-web-storage-in-your-browser-of-choice/
JustOff wrote:Both sessionStorage and localStorage are removed from the browser along with cookies when 'Cookies' is selected in 'Settings for Clearing History'.

The suggested feature would require uncoupling HTML5 storage from cookies, yes? - So they would no longer have to be managed as one. It would be a step in the direction of giving people more control over this data.
Last edited by coffeebreak on 2017-09-20, 21:42, edited 1 time in total.

JustOff

Re: HTML5 Local Storage management

Unread post by JustOff » 2017-09-20, 21:42

Tomaso wrote:When messing around with this stuff a while ago, I think that disabling HTML5 Local Storage (dom.storage.enabled = false) prevented this data from being created
This disables storage API completely, but if you are concerned only about data from directories above, you can try 'dom.indexedDB.enabled = false', however many modern sites and some add-ons also don't work without indexedDB enabled.

JustOff

Re: HTML5 Local Storage management

Unread post by JustOff » 2017-09-20, 21:47

coffeebreak wrote:There is this gHacks article on clearing local storage: https://www.ghacks.net/2015/02/05/how-to-clear-web-storage-in-your-browser-of-choice/
This article is about IndexedDB problem, not 'HTML5 Local Storage', this is why I try to clarify the subject in this topic.

User avatar
Tomaso
Board Warrior
Board Warrior
Posts: 1622
Joined: 2015-07-23, 16:09
Location: Norway

Re: HTML5 Local Storage management

Unread post by Tomaso » 2017-09-20, 21:51

I ran some further tests, and no..
Setting 'dom.storage.enabled' to 'false' does NOT prevent the data from being created!

Setting 'dom.indexedDB.enabled' to 'false' works, but it only seems to prevent creation in the "default" folder.
The "temporary" folder is still being used, and the data remains regardlessly!

JustOff

Re: HTML5 Local Storage management

Unread post by JustOff » 2017-09-20, 22:02

Tomaso wrote:I ran some further tests, and no..
Setting 'dom.storage.enabled' to 'false' does NOT prevent the data from being created!
Well, that mean I was mistaken and this preference controls only sessionStorage and localStorage :roll:
Setting 'dom.indexedDB.enabled' to 'false' works, but it only seems to prevent creation in the "default" folder.
The "temporary" folder is still being used, and the data remains regardlessly!
Thank you for the observation, but I'd prefer to find a way to selectively clear this data, instead of disabling IndexedDB completely. It should be not so hard.

User avatar
Tomaso
Board Warrior
Board Warrior
Posts: 1622
Joined: 2015-07-23, 16:09
Location: Norway

Re: HTML5 Local Storage management

Unread post by Tomaso » 2017-09-20, 22:14

Same thing as I suggested in post #2 then, but simply call it "Local Storage" instead, and have it include ALL forms of local storage:

Image

JustOff

Re: HTML5 Local Storage management

Unread post by JustOff » 2017-09-20, 23:09

Ok, let's start with IndexedDB and Website data, here is Storage Cleaner 1.0.1. Use it at your own risk and don't forget to backup your profile.

coffeebreak
Moon Magic practitioner
Moon Magic practitioner
Posts: 2986
Joined: 2015-09-26, 04:51
Location: U.S.

Re: HTML5 Local Storage management

Unread post by coffeebreak » 2017-09-20, 23:54

JustOff wrote:Ok, let's start with IndexedDB and Website data,

JustOff, What is meant by "Website data"?

JustOff

Re: HTML5 Local Storage management

Unread post by JustOff » 2017-09-21, 00:34

It means that it will not delete IndexedDB data that is set by add-ons and the browser itself, but only by websites.

coffeebreak
Moon Magic practitioner
Moon Magic practitioner
Posts: 2986
Joined: 2015-09-26, 04:51
Location: U.S.

Re: HTML5 Local Storage management

Unread post by coffeebreak » 2017-09-21, 01:14

JustOff wrote:It means that it will not delete IndexedDB data that is set by add-ons and the browser itself, but only by websites.

Thank you for explaining :)

Does 'storage-cleaner' delete data from any locations that are not in the Storage directory/folder? If so, what are they?

And request: Is it possible for 'storage-cleaner' to run on demand, as well as on exit? Would you consider this?

User avatar
Tomaso
Board Warrior
Board Warrior
Posts: 1622
Joined: 2015-07-23, 16:09
Location: Norway

Re: HTML5 Local Storage management

Unread post by Tomaso » 2017-09-21, 04:58

JustOff wrote:here is Storage Cleaner 1.0.1.
Thanks, it works! :)

dark_moon

Re: HTML5 Local Storage management

Unread post by dark_moon » 2017-09-21, 07:27

JustOff wrote:Ok, let's start with IndexedDB and Website data, here is Storage Cleaner 1.0.1. Use it at your own risk and don't forget to backup your profile.
Thanks!

Locked