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.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

clearBrowserData automatic

Post Reply
gorgor
Posts: 5
Joined: Sun Dec 08, 2024 9:09 am

clearBrowserData automatic

Post by gorgor »

Tell me how to automatically clear all data without user intervention (and without restarting the program)
If I try this way:
chrome://settings/clearBrowserData

, I still need to press the button
------
Chromium1.ClearDataForOrigin('*', TCefClearDataStorageTypes.cdstCacheStorage);
Chromium1.ClearCache;
Chromium1.DeleteCookies();
so it doesn't clean everything.
------
is there an example MDIBrowser for linux ?

Thanks
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: clearBrowserData automatic

Post by salvadordf »

Hi,

Try using Chromium1.ClearDataForOrigin('*', TCefClearDataStorageTypes.cdstAll); to clear all data asynchronously without restarting the browser.

Lazarus in Linux only supports MDI in Qt and not in Gtk:
https://forum.lazarus.freepascal.org/index.php/topic,41067.0.html

Use the TabbedBrowser2 demo for Linux instead.
gorgor
Posts: 5
Joined: Sun Dec 08, 2024 9:09 am

Re: clearBrowserData automatic

Post by gorgor »

salvadordf wrote: Mon Dec 09, 2024 3:53 pm Hi,

Try using Chromium1.ClearDataForOrigin('*', TCefClearDataStorageTypes.cdstAll); to clear all data asynchronously without restarting the browser.
did not help with clearing the form data. When filling out a form on the site, previously entered data starts popping up. Is it possible to somehow prohibit autofilling of forms?
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: clearBrowserData automatic

Post by salvadordf »

Try using this :

Code: Select all

MyChromium.SetContentSetting(requesting_url, top_level_url, CEF_CONTENT_SETTING_TYPE_FORMFILL_METADATA, CEF_CONTENT_SETTING_VALUE_BLOCK);
Read the code comments for TChromiumCore.SetContentSetting for more details.
gorgor
Posts: 5
Joined: Sun Dec 08, 2024 9:09 am

Re: clearBrowserData automatic

Post by gorgor »

Chromium1.SetContentSetting('*', '*', CEF_CONTENT_SETTING_TYPE_FORMFILL_METADATA , CEF_CONTENT_SETTING_VALUE_BLOCK);

I tried this, it didn't work. What am I doing wrong?
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: clearBrowserData automatic

Post by salvadordf »

Use URLs instead of asterisks.
gorgor
Posts: 5
Joined: Sun Dec 08, 2024 9:09 am

Re: clearBrowserData automatic

Post by gorgor »

and if needed for any sites?
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: clearBrowserData automatic

Post by salvadordf »

Try calling that function in the TChromiumCore.OnBeforeBrowse event with the frame.url value
Post Reply