tryphotino / photino.NET

https://tryphotino.io
Apache License 2.0
915 stars 74 forks source link

Ability to clear cache #116

Open bradmartin333 opened 1 year ago

bradmartin333 commented 1 year ago

Having the ability for HTML inputs to remember between sessions is great, but I would like to have an option for the user to clear the cache if the autofill list gets large. Right now, the user can only clear one item at a time.

To be clear, this would not change the UI shown in the picture, but instead be something in C# like window.ClearCache() and would remove/reset whatever file is responsible in the window.TemporaryFilesPath.

image

Alternatively, if someone knows the file responsible in the window.TemporaryFilesPath, then I can manage it myself. Thanks!

ottodobretsberger commented 1 year ago

We have spent some time discussing this internally, but have not come to a conclusion yet. We will continue to dig deeper and see if we can find an approach applicable to this problem. Additionally it's troublesome that each OS requires a different approach, as the underlying HTML controls are different.

MikeYeager commented 1 year ago

@bradmartin333 We have successfully implemented and tested this for the Edge control in Windows. We will move on to Mac and Linux and, if all goes well, we'll get it into the next version.

philippjbauer commented 1 year ago

I looked into implementing the ability to clear the autofill cache on macOS and Linux. I observed that the autocomplete tag is not enabling the desired behavior in the current version of Webkit for either OS. I. e. I can enter text in an input field that has the autocomplete="on" tag, but it will not suggest previous inputs as selectable options to autofill.

The WebkitGTK bugtracker includes a bug with this attached code diff, that suggests that there should be some autocomplete functionality. But as explained, I could not trigger the behavior.

The docs shows that there is a WebsiteDataManager Clear Method that can clear different types of website data, the list of types does not suggest that there is a type for autofill data (WebsiteDataTypes).

@bradmartin333 have you tested your application on any OS other than Windows? Have you noticed different behavior?

bradmartin333 commented 1 year ago

@philippjbauer just tested on Ubuntu, and the inputs were not suggesting previous inputs as selectable options to autofill.