fanglingsu / vimb

Vimb - the vim like browser is a webkit based web browser that behaves like the vimperator plugin for the firefox and usage paradigms from the great editor vim. The goal of vimb is to build a completely keyboard-driven, efficient and pleasurable browsing-experience.
https://fanglingsu.github.io/vimb/
GNU General Public License v3.0
1.34k stars 99 forks source link

`:cleardata` doesn't work? #705

Open jjakob opened 2 years ago

jjakob commented 2 years ago

Steps to reproduce

:cleardata

Expected behaviour

All browsing data should be deleted

Actual behaviour

Nothing is deleted. Looking at files in .local/share/vimb, the files "history", "cookies.db", "command", "closed", contents of "localstorage" are unchanged. There are also "closed", "command", "cookies.db", "history", "search" in .config/vimb, which are dated around September 2020, which aren't changed as well. Since they are identical to those in .local/share/vimb, I assume that's their old location, they got moved in some version of vimb, which left the old files laying around, requiring a manual cleanup with rm. Also .local/share/webkitgtk, .local/share/webkitgtk-4.0, .cache/webitgtk-4.0 aren't changed or deleted other than with a manual rm. I'd assume they would all get cleaned up with .cache maybe getting completely deleted.

vimb --bug-info

vimb --bug-info Version: 3.6.0-57-g6dbde47 WebKit compile: 2.34.3 WebKit run: 2.34.3 GTK compile: 3.24.29 GTK run: 3.24.29 libsoup compile: 2.72.0 libsoup run: 2.72.0 Extension dir: /usr/lib/vimb

.config/vimb/config:

set dark-mode=true
set home-page=https://duckduckgo.com/
set download-path=~/Downloads
set webinspector=true
set accelerated-2d-canvas=true
fanglingsu commented 2 years ago

@jjakob The :cleardata clears only those data that are stored and caches by webkit like memory-cache, disk-cache, offline-cache, session-storage, local-storage,indexeddb-databases, plugin-data, cookies and the hsts-cache. All the data sotred by vimb like last fired commands, visited websites, last searches are kept intact.

Following directories are cleared on my system:

Vimb uses https://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebsiteDataManager.html#webkit-website-data-manager-clear to clear the data. There is no information that this clear only partial data. But might be related to the WebKitWebsiteDataManager which might not be shared bewteen vimb instances.

jjakob commented 2 years ago

I also noticed a change in behavior after I manually deleted all the above mentioned files, before this none of my website logins would get remembered even if I ticked the checkbox, now they do get remembered. So maybe a file (cookies?) got corrupted and wasn't being used or cleared, now it's back to working. After that, I tried cleardata, and it did forget my logins, so it must be doing some clearing at least. It may be useful to other people to know that this doesn't actually delete all on-disk browsing data, if a user wants to really delete his browsing history? Or is it expected that it would delete it all, and is not behaving properly?

fanglingsu commented 2 years ago

@jjakob My understanding of the cleardata without any timerange is to delete everything. This is what the documentation says.

Asynchronously clear the website data of the given types modified in the past timespan . If timespan is 0, all website data will be removed.