Page 1 of 1

Clear history on page load

Posted: Tue Feb 05, 2019 4:48 pm
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)

Re: Clear history on page load

Posted: Tue Feb 05, 2019 8:27 pm
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.

Re: Clear history on page load

Posted: Wed Feb 06, 2019 7:24 pm
by petko
So, it seems the only way to clear the current navigation history is to recreate ChromiumWindow control when needed?

Re: Clear history on page load

Posted: Wed Feb 06, 2019 8:59 pm
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.

Re: Clear history on page load

Posted: Wed Feb 06, 2019 9:15 pm
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

Re: Clear history on page load

Posted: Thu Feb 07, 2019 11:55 am
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 :)