Files
cefsharp/CefSharp.Example/JsDialogHandler.cs
T
amaitland 6daff6e780 Update OnBeforeUnloadDialog to expose IJsDialogCallback
Add a Continue overload to IJsDialogCallback to simplify use (just passes in an empty CefString)
2015-06-01 11:31:57 +10:00

20 lines
754 B
C#

namespace CefSharp.Example
{
public class JsDialogHandler : IJsDialogHandler
{
public bool OnJSDialog(IWebBrowser browser, string originUrl, string acceptLang, CefJsDialogType dialogType, string messageText, string defaultPromptText, IJsDialogCallback callback, ref bool suppressMessage)
{
return false;
}
public bool OnJSBeforeUnload(IWebBrowser browser, string message, bool isReload, IJsDialogCallback callback)
{
//NOTE: No need to execute the callback if you return false
// callback.Continue(true);
//NOTE: Returning false will trigger the default behaviour, you need to return true to handle yourself.
return false;
}
}
}