- Code: Select all
public class CustomJSDialogs: CefJSDialogHandler
{
protected override bool OnJSDialog(CefBrowser browser, string originUrl, string acceptLang, CefJSDialogType dialogType, string message_text, string default_prompt_text, CefJSDialogCallback callback, out bool suppress_message)
{
suppress_message = true;
callback.Continue(true, "");
return true;
}
protected override bool OnBeforeUnloadDialog(CefBrowser browser, string messageText, bool isReload, CefJSDialogCallback callback)
{
callback.Continue(true, "");
return true;
}
protected override void OnResetDialogState(CefBrowser browser)
{
return;
}
protected override void OnDialogClosed(CefBrowser browser)
{
return;
}
}
And returned them in CefClient like this:
- Code: Select all
protected virtual CefJSDialogHandler GetJSDialogHandler()
{
return new CustomJSDialogs();
}
Yet alerts are still showing. What am I doing wrong please?