Page 1 of 1

clear browser history

PostPosted: Wed Oct 30, 2024 12:29 pm
by Gionter
Quick way to clear browser history without going into settings? Thanks in advance.

Re: clear browser history

PostPosted: Wed Oct 30, 2024 6:15 pm
by ndesktop
Delete files History and History-journal from cache_path ?

Re: clear browser history

PostPosted: Wed Oct 30, 2024 6:45 pm
by Gionter
ndesktop wrote:Delete files History and History-journal from cache_path ?


Yes, clear SQLite DB file with name - History, and others like it.

Re: clear browser history

PostPosted: Thu Oct 31, 2024 6:38 am
by Gionter
ndesktop wrote:Delete files History and History-journal from cache_path ?


I can only delete them if I unload the browser completely from memory, otherwise the system won't let me delete them.

Re: clear browser history

PostPosted: Thu Oct 31, 2024 5:11 pm
by ndesktop
Programmatically, I think HistoryService::ExpireHistoryBetween is what is needed for a programmatic clear. But I don't remember HistoryService being intercepted/overriden in CEF.

I don't know how the history service can and should be operated, but one may start from ChromeBrowserContext::AddVisitedURLs implementation as a first example: get the profile with AsProfile(), history service with HistoryServiceFactory::GetForProfile(profile, ServiceAccessType::IMPLICIT_ACCESS) or perhaps ServiceAccessType::EXPLICIT_ACCESS, and call ExpireHistoryBetween with min and max time values (there are examples in history service unit test).

Re: clear browser history

PostPosted: Sat Nov 02, 2024 7:38 am
by Gionter
ndesktop wrote:Programmatically, I think HistoryService::ExpireHistoryBetween is what is needed for a programmatic clear. But I don't remember HistoryService being intercepted/overriden in CEF.

I don't know how the history service can and should be operated, but one may start from ChromeBrowserContext::AddVisitedURLs implementation as a first example: get the profile with AsProfile(), history service with HistoryServiceFactory::GetForProfile(profile, ServiceAccessType::IMPLICIT_ACCESS) or perhaps ServiceAccessType::EXPLICIT_ACCESS, and call ExpireHistoryBetween with min and max time values (there are examples in history service unit test).


What would it look like in the api of other languages? C#, for example.

Re: clear browser history

PostPosted: Sat Nov 02, 2024 8:18 am
by ndesktop
Not sure. I do not have much experience with CefSharp, but I'm sure these methods use data types already there.