Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
clear browser history
clear browser history
Quick way to clear browser history without going into settings? Thanks in advance.
- salvadordf
- Posts: 4563
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: clear browser history
Try calling TChromiumCore.ExecuteChromeCommand(IDC_CLEAR_BROWSING_DATA, CEF_WOD_CURRENT_TAB) or deleting the history database files before initializing CEF.
Re: clear browser history
calling TChromiumCore.ExecuteChromeCommand(IDC_CLEAR_BROWSING_DATA, CEF_WOD_CURRENT_TAB) chrome://settings/clearBrowserData opens and you need to press Delete data. It is not difficult for me to execute javascript, but is it possible to press it automatically?salvadordf wrote: Thu Oct 31, 2024 10:04 am Try calling TChromiumCore.ExecuteChromeCommand(IDC_CLEAR_BROWSING_DATA, CEF_WOD_CURRENT_TAB) or deleting the history database files before initializing CEF.
Although this script doesn't work for some reason Chromium1.browser.MainFrame.ExecuteJavaScript('document.getElementById("clearButton").click();',Chromium1.browser.MainFrame.GetURL, 0);
- salvadordf
- Posts: 4563
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: clear browser history
Do you want to clear the browser cache or only the navigation history?
As far as I know there are only a few ways to clear the navigation history :
As far as I know there are only a few ways to clear the navigation history :
- calling TChromiumCore.ExecuteChromeCommand(IDC_CLEAR_BROWSING_DATA, CEF_WOD_CURRENT_TAB) or navigating to chrome://settings/clearBrowserData and then click on the "Delete data" button manually.
- Executing the Page.resetNavigationHistory DevTools method to reset navigation history for the current page. https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-resetNavigationHistory
- Deleting the database files related to the navigation history before the CEF initialization.
- Call TChromiumCore.ClearCache
- Call TChromiumCore.ClearDataForOrigin with custom "aStorageTypes" values.
- Set GlobalCEFApp.DeleteCache to True before the GlobalCEFApp.StarMainProcess call.
Re: clear browser history
Very briefly, I want to clear the History cache file without unloading the browser. None of the methods above will clear it. TChromiumCore.ExecuteChromeCommand(IDC_CLEAR_BROWSING_DATA, CEF_WOD_CURRENT_TAB) - only opens options where you still need to click ‘Delete data’. Thanks for the reply.salvadordf wrote: Fri Nov 01, 2024 9:59 am Do you want to clear the browser cache or only the navigation history?
The Cef forum answered like this, but I didn't understand anything https://www.magpcss.org/ceforum/viewtopic.php?f=6&t=20028
Last edited by Fvert on Fri Nov 01, 2024 10:18 am, edited 1 time in total.
- salvadordf
- Posts: 4563
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: clear browser history
I'm sorry but CEF doesn't expose any method to clear the navigation history only.
The previous methods is all we have.
The previous methods is all we have.