Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: Allow auto-cleaning on browser termination #9

Closed
Gitoffthelawn opened this issue Sep 21, 2017 · 11 comments
Closed

FR: Allow auto-cleaning on browser termination #9

Gitoffthelawn opened this issue Sep 21, 2017 · 11 comments

Comments

@Gitoffthelawn
Copy link

Gitoffthelawn commented Sep 21, 2017

Hello Andy. :)

Can you add an option to perform the cleaning when the browser terminates (well, obviously, just before it terminates)?

@andy-portmen
Copy link
Owner

As far as I know, there is no event to listen for that reliably calls your observer when the browser is about to exit. Note that to have no effect on the browser performance, this extension uses "event page" background script; https://github.com/andy-portmen/ecleaner/blob/master/manifest.json#L21 (this is not yet supported on Firefox!)

This means there is no persistent background script at all. We need to rely on the Chrome's runtime events and there is no exit event as far as I can tell

andy-portmen added a commit that referenced this issue Sep 23, 2017
@andy-portmen
Copy link
Owner

andy-portmen commented Sep 23, 2017

So in the latest dev version, the extension performs the last cleaning when there is no browser window open. This is the closest to what you are looking for. Note that the option is disabled by default and can be turned on from the options page.

Also, note that you need to perform at least one manual cleaning from the popup so that the extension could record whatever you want to be cleaned.

@Gitoffthelawn
Copy link
Author

Thanks Andy!

Ah, the (current) limitations of WebExtensions API.

Just FYI, this extension can delete everything on Firefox termination: https://addons.mozilla.org/firefox/addon/clickclean/

Of course, it does not use WebExtensions API.

Also, note that you need to perform at least on manual cleaning from the popup so that the extension could record what even you want to be cleaned.

Hmmm.... can an options page allow this be set ahead of time?

@andy-portmen
Copy link
Owner

I meant "one manual cleaning". This is to know what is the preferred cleaning preferences of the user.

@Gitoffthelawn
Copy link
Author

I figured that's what you meant. I wonder if you can create an options menu to specify what should be cleaned on termination so that one manual cleaning need not be performed.

@andy-portmen
Copy link
Owner

Yes, you can now set whatever you prefer to be cleaned on exit from the panel without actually performing the cleaning

screen shot 2017-09-24 at 11 09 21 am

@Gitoffthelawn
Copy link
Author

Thanks!

BTW, does it really clean IndexedDB Databases? I thought that wasn't possible (yet) with WebExtensions.

@andy-portmen
Copy link
Owner

IndexedDB is removed from the latest release (only for FF)

@Gitoffthelawn
Copy link
Author

I think it is on the Mozilla schedule to make IndexedDB clearable... perhaps for version 58.

@andy-portmen
Copy link
Owner

since FF throws error, I had to remove these types.
https://github.com/andy-portmen/ecleaner/blob/master/data/panel/index.js#L9-L11

Let me know when it is supported and I'll remove it from the list.

@Gitoffthelawn
Copy link
Author

Gitoffthelawn commented Sep 26, 2017

I created a new issue for this new topic: #10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants