c# - How can I prevent navigation back using CEFSharp library? -
i want prevent navigation application using cefsharp library , winforms. have found no solutions this, links here: how disable backspace "go back" navigation? it`s not work me. me?
--> requesthandler.cs
class requesthandler : irequesthandler { public bool onbeforebrowse(iwebbrowser browser, irequest request, bool isredirect, bool ismainframe) { if ((request.transitiontype & transitiontype.forwardback) != 0) { return true; } return false; } public bool oncertificateerror(iwebbrowser browser, ceferrorcode errorcode, string requesturl) { return false; } public void onplugincrashed(iwebbrowser browser, string pluginpath) { } public cefreturnvalue onbeforeresourceload(iwebbrowser browser, irequest request, bool ismainframe) { return cefreturnvalue.continue; } public bool getauthcredentials(iwebbrowser browser, bool isproxy, string host, int port, string realm, string scheme, ref string username, ref string password) { return true; } public bool onbeforepluginload(iwebbrowser browser, string url, string policyurl, webplugininfo info) { return true; } public void onrenderprocessterminated(iwebbrowser browser, cefterminationstatus status) { } }
--> in program.cs
_browser = new chromiumwebbrowser(url) { requesthandler = new requesthandler(), dock = dockstyle.fill, requesthandler = new requesthandler() };
p.s. application launched in browser single page.
Comments
Post a Comment