Lusito / forget-me-not

Make the browser forget website data, except for the data you want to keep.
zlib License
226 stars 25 forks source link

"Cleanup" -> Clean Now, not deleting current tab cookies #32

Closed Joel889 closed 6 years ago

Joel889 commented 6 years ago

Go to any webpage that sets cookies (verify with Firefox cookie manager). Click "Clean Now" under "Cleanup" (all boxes are selected). Cookie is still there. Clicking "This tab" clean now, will delete it. No domain rules have been set.

Lusito commented 6 years ago

This is currently intended behavior, as tabs that are still open are in a protected state and people usually want their open tabs to keep working properly. I guess I could add an extra checkbox to apply the cleanup even to websites that are still open in a tab.

Joel889 commented 6 years ago

That makes sense, although I would imagine someone who is running "Clean All" manually (as opposed to using the time-based cleaner functionality), would specifically want to clean everything.

Lusito commented 6 years ago

Yes, I understand the confusion and it should be improved.

Joel889 commented 6 years ago

This is still a bug (version 0.9). IMHO, instead of having two "Clean Now!" buttons in different tabs, why not add a checkbox to the "manual cleanup" tab that reads "Clean active tabs" or "Active Tabs" or similar.

Lusito commented 6 years ago

Did you uncheck the "protect the currently open domains if..." checkbox? Because I did not change the default behavior. I just added an option to do change this behavior.

Joel889 commented 6 years ago

You are right, that fixes it. :)

I did notice that "current tab" cleaning won't delete subdomain cookies and also won't delete local storage for that domain. I know some of it is due to API limitations, I'm just not sure what the application would be to delete cookies only from that domain (but keeping subdomain cookies and local storage), nor whether it is clear to the user what is being done.

Lusito commented 6 years ago

Cookies

Subdomains are currently not cleaned, no. This is actually something that could be changed, but I haven't decided how to fix this yet. To understand why I haven't decided, understand, that there are two ways to look at cookie storage:

  1. Cookies are always bound to the parent domain. If want this to be true, then of course, cookies for subdomains should be cleared as well. But in turn, you'd have to wait for every tab with the parent-domain to be closed before automatic cleanup kicks in. Also the rule expressions lose part of their power.
  2. Each domain and subdomain can have its own cookies independent of its parent domain. Allowing you to have a more fine-grained control over which domains are whitelisted and which aren't. Deleting subdomain cookies while on a.com would possibly destroy cookies from b.a.com someone wanted to keep.

This could of course be solved by adding two buttons.. one for clean the current domain and one for clean the current domain and its subdomains. But then it'd be confusing to the user why this would only affect cookies and not local storage.

Local storage

Localstorage should currently be cleaned, if it is the exact domain where the localstorage was saved on. If the localstorage was saved on a subdomain, then it won't be cleaned. This is actually due to limitations in the API, as there is (currently) no way to actually see which domains or subdomains have something in local storage. So at best, I could remember all domains the user was on so I can delete them later (which is what I do for the cleanup on start bit).

If you have a case, where local storage does not get cleaned with the "clean now" button on the "current tab" page, then please give me more information.

So, you see both of these issues are not just a simple decision and a couple of hours coding effort.

Joel889 commented 6 years ago

If you have a case, where local storage does not get cleaned with the "clean now" button on the "current tab" page, then please give me more information.

Perhaps I'm mixing up localstorage and IndexedDB. What isn't getting deleted on the "current tab" page is stored inside the profile folder under storage/default. I would imagine someone manually cleaning cookies from "current tab" would want everything deleted, not just cookies.

Joel889 commented 6 years ago

Did you uncheck the "protect the currently open domains if..." checkbox?

Perhaps the wording could be changed so that everything is deleted when the box is checked. This would be consistent with the wording scheme on the tab (box checked = things get deleted).

Lusito commented 6 years ago

I've created an issue for that

Lusito commented 6 years ago

I'm actually not sure myself where the files are stored. Are you sure the localstorage was stored on the exact domain? as said, subdomain cleaning is not as easy to solve with the currently available API.

Lusito commented 6 years ago

I will investigate this further once I've finished moving to my new city. Saturday is the moving day, but getting settled in and having everything set up will take some more time.

Joel889 commented 6 years ago

I'm actually not sure myself where the files are stored. Are you sure the localstorage was stored on the exact domain? as said, subdomain cleaning is not as easy to solve with the currently available API.

youtube might be a good example. It creates files under /storage/default. Closing youtube and performing manual clean up gets rid of it, but not while the youtube is still open. The same is true for 3rd party cookies from that domain.

Lusito commented 6 years ago

Thanks for the example, I'll try to reproduce it.

Joel889 commented 6 years ago

For the record, Indexed DB is what I'm referring to located inside your Firefox profile folder, under \storage\default.