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.

Clear cache, history and form data while application running

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

Re: Clear cache, history and form data while application running

Post by salvadordf »

Hitman wrote: Sun Dec 09, 2018 1:10 pmcan you please tell how do i free the running TChromium and create a new one?
There are 5 demos that create and destroy browsers at run-time : MDIBrowser, MDIExternalPumpBrowser, TabbedBrowser, ToolBoxBrowser and FMXToolBoxBrowser.

Please, use MDIBrowser as the template for your application and modify TChildForm.FormShow to always create a new request context with a different cache directory for each new child browser.

You can also use the other 4 demos but you would need to add the code to create a new request context.
Hitman
Posts: 73
Joined: Sat May 20, 2017 11:08 am

Re: Clear cache, history and form data while application running

Post by Hitman »

salvadordf wrote: Sun Dec 09, 2018 2:22 pm
Hitman wrote: Sun Dec 09, 2018 1:10 pmcan you please tell how do i free the running TChromium and create a new one?
There are 5 demos that create and destroy browsers at run-time : MDIBrowser, MDIExternalPumpBrowser, TabbedBrowser, ToolBoxBrowser and FMXToolBoxBrowser.

Please, use MDIBrowser as the template for your application and modify TChildForm.FormShow to always create a new request context with a different cache directory for each new child browser.

You can also use the other 4 demos but you would need to add the code to create a new request context.
Thanks for the response!
I can't use MDIBrowser because it doesn't serve my purpose :(

We already know,
the problem is with the history during use which we need to fix.

So,
when the browser is running, we do the refresh after being inactive for let's say 2 minutes. The question is,
how do we refresh the browser with out having the history and cache?

I have already tested,
restarting the browser (close and re-open), terminates both the cache and the history. The goal is to be able to terminate the history and cache without closing and re-opening the browser.
Please keep in mind, we do not want cache, we do not want history, we do not want any folders to store those either.

Once more,
how can we refresh the browser with out loading cache and history?
can you please make a demo?
a demo which has only few lines of code, has nothing extra in it.
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Clear cache, history and form data while application running

Post by salvadordf »

Hitman wrote: Mon Dec 10, 2018 8:49 amI can't use MDIBrowser because it doesn't serve my purpose :(
Then extract what you need from those demos and use it in your application.
Hitman wrote: Mon Dec 10, 2018 8:49 am how can we refresh the browser with out loading cache and history?
can you please make a demo?
a demo which has only few lines of code, has nothing extra in it.
The 5 demos I commented previously have the minimum code CEF3 needs to create and destroy browsers safely. The MDIBrowser demo only has about 500 code lines and half of them are type declarations, comments, licenses, etc.

Creating a new browser is really simple but destroying them requires following the "destruction sequence" found in all other demos.
Besides that, the main form can't be closed until all child browsers have been properly destroyed.
Hitman
Posts: 73
Joined: Sat May 20, 2017 11:08 am

Re: Clear cache, history and form data while application running

Post by Hitman »

salvadordf wrote: Mon Dec 10, 2018 9:23 am
Hitman wrote: Mon Dec 10, 2018 8:49 amI can't use MDIBrowser because it doesn't serve my purpose :(
Then extract what you need from those demos and use it in your application.
Hitman wrote: Mon Dec 10, 2018 8:49 am how can we refresh the browser with out loading cache and history?
can you please make a demo?
a demo which has only few lines of code, has nothing extra in it.
The 5 demos I commented previously have the minimum code CEF3 needs to create and destroy browsers safely. The MDIBrowser demo only has about 500 code lines and half of them are type declarations, comments, licenses, etc.

Creating a new browser is really simple but destroying them requires following the "destruction sequence" found in all other demos.
Besides that, the main form can't be closed until all child browsers have been properly destroyed.
Hi Salvador,
thanks for trying to help!
this however is not taking me anywhere.
None of your demos does the clearing of history and cache and none of your demos are properly explaining how to terminate the existed browser and create a new one by preventing any sort of history and cache, that is why i keep bothering you because i simply cannot make anything out of them which would help me to tackle the cache and history issue.

What i would like to see is,
OnFormShow ==> Browser starts with "www.google.com"
- I do few searches and visit the results of my searches.
- I after this click "Refresh" button which i have.
- Browser refresh itself with the same page (www.google.com) with no history nor cache in it.
Post Reply