mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-04 19:25:01 +00:00
fc9e6dc9ad
So the callback wrapper has been added so can now be executed async. SuppressMessage is now possible. Fixes #999
20 lines
749 B
C#
20 lines
749 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, 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;
|
|
}
|
|
}
|
|
}
|