Onbeforeunload event

Think CEF could benefit from a new feature or capability? Discuss CEF feature requests here.

Onbeforeunload event

Postby milton » Tue Nov 16, 2021 10:23 pm

There are 4 events in the ILoadHandler class
1) OnFrameLoadStart
2) OnFrameLoadEnd
3) OnLoadError
4) OnLoadingStateChange
I suggest adding another fifth load event, Onbeforeunload. This event will indicate that a new page will be loaded now. This event is needed to organize a quick transition through the pages, without unnecessary waiting for the download. The fact is that sometimes there is a click on an element that is on the page of the site, but there is no certainty that after clicking on it the page will load, because the element may not be a link to another page but ordinary text and therefore you have to wait an extra second before after each click per each items (or half a second). There is no certainty that you need to wait when the new page starts loading, after clicking, if the click occurs on an element that does not cause the page to load. At the moment I am using the onbeforeunload event which is in javascript and the OnBeforeUnloadDialog event which is in the IJsDialogHandler class. Therefore, sometimes I have to write extra code to subscribe to an event via javascript. In addition, the onbeforeunload javascript event does not work when the page is refreshed without actually reloading, but is refreshed using the load function in the jqery library eg $('# content').Load('content.html');
And also the onbeforeunload javascript event does not occur if the window is not focused(after page refresh, even with event subscription). This is the main flaw. CefSharp version 57 did not have such a flaw.
milton
Newbie
 
Posts: 2
Joined: Tue Nov 16, 2021 9:47 pm

Return to Feature Request Forum

Who is online

Users browsing this forum: No registered users and 11 guests