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 history on page load

Post Reply
petko
Posts: 52
Joined: Sun Jul 02, 2017 9:58 am

Clear history on page load

Post by petko »

Is it possible to clear the current browser history when loading a page? I see that it was implemented in CEF (https://bitbucket.org/chromiumembedded/ ... story/diff)
User avatar
salvadordf
Posts: 4056
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Clear history on page load

Post by salvadordf »

Hi,

That's an old pull request that cannot be merged due to conflicts. The current API has no load_urlwith_params function in the frame as you can see here :
https://bitbucket.org/chromiumembedded/ ... ew-default

The issue that it's trying to fix is this :
https://bitbucket.org/chromiumembedded/ ... on-history

That issue is still open and it was marked has "has fix". Perhaps because at that time CefRenderProcessHandler::OnBeforeNavigation could be used to block history-related navigations.
https://magpcss.org/ceforum/viewtopic.p ... 810#p25197
https://magpcss.org/ceforum/viewtopic.p ... 310#p26207

However, CefRenderProcessHandler::OnBeforeNavigation was removed from the API a few months ago.
petko
Posts: 52
Joined: Sun Jul 02, 2017 9:58 am

Re: Clear history on page load

Post by petko »

So, it seems the only way to clear the current navigation history is to recreate ChromiumWindow control when needed?
User avatar
salvadordf
Posts: 4056
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Clear history on page load

Post by salvadordf »

I haven't used it much and my experience with it is very limited. I use a custom navigation history in BriskBard.

Other user commented that CEF doesn't show old navigation entries from the previous session and all you can see is the list of entries since you executed your application.

You can create a new browser with a new request context and a different cache directory to start with a fresh navigation history without closing your application.
User avatar
salvadordf
Posts: 4056
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Clear history on page load

Post by salvadordf »

I forgot to say that if you or anyone else has C++ experience and is willing to help then you can also create a pull requests in the CEF3 project with your new features and/or fixes.

The CEF3 maintainer always say that pull requests are welcome! :D

https://bitbucket.org/chromiumembedded/cef
petko
Posts: 52
Joined: Sun Jul 02, 2017 9:58 am

Re: Clear history on page load

Post by petko »

salvadordf wrote: Wed Feb 06, 2019 8:59 pmI use a custom navigation history in BriskBard.
salvadordf wrote: Wed Feb 06, 2019 8:59 pmYou can create a new browser with a new request context and a different cache directory to start with a fresh navigation history without closing your application.
I will use some of these suggestions then.

salvadordf wrote: Wed Feb 06, 2019 9:15 pm I forgot to say that if you or anyone else has C++ experience and is willing to help then you can also create a pull requests in the CEF3 project with your new features and/or fixes.
I am afraid that such a change will require a considerable knowledge of the CEF3 internals, which I do not have yet :)
Post Reply