mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-06 04:00:07 +00:00
Remove unused resultString param, CefJSDialogCallback->Continue is used for multiple callbacks, in this case only the success param is required.
Change isReload to a normal param (was an out param), so the user can be notified correctly Add some rough documentation to IJsDialogHandlerAdd some additional comments to JsDialogHandler for demonstrating code to users Add JsDialogHandler that implements the default behavior Assign in the WinForms example Fix typo in IRequestHandler
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
namespace CefSharp.Example
|
||||
{
|
||||
public class JsDialogHandler : IJsDialogHandler
|
||||
{
|
||||
public bool OnJSAlert(IWebBrowser browser, string url, string message)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool OnJSConfirm(IWebBrowser browser, string url, string message, out bool retval)
|
||||
{
|
||||
retval = false;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool OnJSPrompt(IWebBrowser browser, string url, string message, string defaultValue, out bool retval, out string result)
|
||||
{
|
||||
retval = false;
|
||||
result = null;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool OnJSBeforeUnload(IWebBrowser browser, string message, bool isReload, out bool allowUnload)
|
||||
{
|
||||
//NOTE: Setting allowUnload to false will cancel the unload request
|
||||
allowUnload = false;
|
||||
|
||||
//NOTE: Returning false will trigger the default behaviour, you need to return true to handle yourself.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user